gwx
@ -0,0 +1,4 @@
|
||||
{
|
||||
"alwaysUpdateLinks": true,
|
||||
"attachmentFolderPath": "./attachments"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
{
|
||||
"accentColor": "",
|
||||
"theme": "obsidian",
|
||||
"baseFontSize": 14
|
||||
}
|
@ -0,0 +1 @@
|
||||
[]
|
@ -0,0 +1,29 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"canvas": true,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": true,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
"starred": true,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": true,
|
||||
"slides": false,
|
||||
"audio-recorder": false,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": false
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
[
|
||||
"file-explorer",
|
||||
"global-search",
|
||||
"switcher",
|
||||
"graph",
|
||||
"backlink",
|
||||
"canvas",
|
||||
"outgoing-link",
|
||||
"tag-pane",
|
||||
"page-preview",
|
||||
"daily-notes",
|
||||
"templates",
|
||||
"note-composer",
|
||||
"command-palette",
|
||||
"editor-status",
|
||||
"starred",
|
||||
"outline",
|
||||
"word-count",
|
||||
"file-recovery"
|
||||
]
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"collapse-filter": true,
|
||||
"search": "",
|
||||
"showTags": false,
|
||||
"showAttachments": false,
|
||||
"hideUnresolved": false,
|
||||
"showOrphans": true,
|
||||
"collapse-color-groups": true,
|
||||
"colorGroups": [],
|
||||
"collapse-display": true,
|
||||
"showArrow": false,
|
||||
"textFadeMultiplier": 0,
|
||||
"nodeSizeMultiplier": 1,
|
||||
"lineSizeMultiplier": 1,
|
||||
"collapse-forces": true,
|
||||
"centerStrength": 0.518713248970312,
|
||||
"repelStrength": 10,
|
||||
"linkStrength": 1,
|
||||
"linkDistance": 250,
|
||||
"scale": 1,
|
||||
"close": false
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
{
|
||||
"outline:open-for-current": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt"
|
||||
],
|
||||
"key": "O"
|
||||
}
|
||||
],
|
||||
"outline:open": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt"
|
||||
],
|
||||
"key": "I"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,268 @@
|
||||
const {Plugin, PluginSettingTab, Setting } = require("obsidian");
|
||||
|
||||
let server = 'fastgit'
|
||||
|
||||
let proMap = {
|
||||
fastgit:{
|
||||
down:"https://download.fastgit.org/"
|
||||
,raw:"https://raw.fastgit.org/"
|
||||
,home:"https://hub.fastgit.org/"
|
||||
}
|
||||
,mtr:{
|
||||
down:"https://download.fastgit.org/"
|
||||
,raw:"https://raw-gh.gcdn.mirr.one/"
|
||||
,home:"https://api.mtr.pub/"
|
||||
}
|
||||
,ghproxy:{
|
||||
down:"https://mirror.ghproxy.com/https://github.com/"
|
||||
,raw:"https://mirror.ghproxy.com/https://github.com/"
|
||||
,home:"https://mirror.ghproxy.com/https://github.com/"
|
||||
}
|
||||
,gitclone:{
|
||||
down:"https://download.fastgit.org/"
|
||||
,raw:"https://raw.fastgit.org/"
|
||||
,home:"https://gitclone.com/github.com/"
|
||||
}
|
||||
,mirr:{
|
||||
down:"https://gh.gcdn.mirr.one/"
|
||||
,raw:"https://raw-gh.gcdn.mirr.one/"
|
||||
,home:"https://gh.gcdn.mirr.one/"
|
||||
}
|
||||
}
|
||||
|
||||
let include = [
|
||||
{
|
||||
match: (url) => url.indexOf("/releases/download/") >= 0
|
||||
, to: (url) => url.replace("https://github.com/", proMap[server].down)
|
||||
}
|
||||
, {
|
||||
match: (url) => url.startsWith("https://raw.githubusercontent.com/") >= 0
|
||||
, to: (url) => url.replace("https://raw.githubusercontent.com/", proMap[server].raw)
|
||||
}
|
||||
, {
|
||||
match: (url) => url.startsWith("https://github.com/") >= 0
|
||||
, to: (url) => url.replace("https://github.com/", proMap[server].home)
|
||||
}
|
||||
]
|
||||
|
||||
// 匹配URL
|
||||
function matchUrl(e) {
|
||||
console.log("开始访问:" + JSON.stringify(e))
|
||||
for (var key in include) {
|
||||
let item = include[key]
|
||||
console.log(key)
|
||||
console.log(item)
|
||||
if (e && e.url && item.match(e.url)) {
|
||||
e.url = item.to(e.url)
|
||||
console.log("要访问的地址:" + e.url)
|
||||
if (!e.headers) {
|
||||
e.headers = {}
|
||||
}
|
||||
e.headers["content-type"] = "application/x-www-form-urlencoded";
|
||||
e.headers["Access-Control-Allow-Origin"] = "*"
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 代理访问
|
||||
function proxy(e) {
|
||||
return new Promise((function (t, n) {
|
||||
e.success = t;
|
||||
e.error = function (e, t) {
|
||||
return n(t)
|
||||
}
|
||||
debugger
|
||||
if (app.isMobile) {
|
||||
forMobile(e);
|
||||
return;
|
||||
}
|
||||
forPC(e)
|
||||
}))
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* https://github.com/denolehov/obsidian-git/issues/57
|
||||
* https://capacitorjs.com/blog/bypassing-cors-with-the-http-plugin
|
||||
* https://github.com/capacitor-community/http
|
||||
*
|
||||
* @param {*} e
|
||||
*/
|
||||
async function forMobile(e) {
|
||||
try {
|
||||
const http = require('@capacitor-community/http')
|
||||
const options = {url: e.url};
|
||||
new window.Notice("发送请求:" + e.url, 10000)
|
||||
new window.Notice(JSON.stringify(http.get) + "123", 10000)
|
||||
// http.get(options);
|
||||
const resp = await http.get(options).then((resp) => {
|
||||
new window.Notice("请求成功:", 10000)
|
||||
new window.Notice("请求成功:" + resp.status, 10000)
|
||||
e.success(resp.data)
|
||||
}).catch((error) => {
|
||||
new window.Notice("出错了:" + JSON.stringify(error), 10000)
|
||||
})
|
||||
new window.Notice("请求成功12", 10000)
|
||||
e.success(resp.data)
|
||||
|
||||
} catch (e) {
|
||||
e.error(e)
|
||||
new window.Notice("加载@capacitor-community/http出错", 10000)
|
||||
}
|
||||
}
|
||||
|
||||
function forPC(e) {
|
||||
try {
|
||||
const https = require('https')
|
||||
https.get(e.url, function (res) {
|
||||
new window.Notice("https.get成功", 10000)
|
||||
res.setEncoding('utf8');
|
||||
let rawData = '';
|
||||
res.on('data', (chunk) => {
|
||||
rawData += chunk;
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
new window.Notice("https.get处理数据成功", 10000)
|
||||
e.success(rawData)
|
||||
} catch (e) {
|
||||
new window.Notice("https.get处理数据失败", 10000)
|
||||
e.error(e)
|
||||
}
|
||||
});
|
||||
|
||||
}).on('error', function (e) {
|
||||
new window.Notice("https.get失败", 10000)
|
||||
e.error(e)
|
||||
})
|
||||
} catch (e) {
|
||||
new window.Notice("导入http出错", 10000)
|
||||
new window.Notice(JSON.parse(e), 10000)
|
||||
}
|
||||
}
|
||||
|
||||
function apProxy() {
|
||||
var ap;
|
||||
this.regedit = function() {
|
||||
ap = window.ajaxPromise;
|
||||
window.ajaxPromise = function (e) {
|
||||
if (!matchUrl(e)) {
|
||||
return ap(e);
|
||||
}
|
||||
new window.Notice("正在通过 ProxyGithub 来代理访问社区插件!")
|
||||
return proxy(e)
|
||||
}
|
||||
}
|
||||
this.unRegedit = function() {
|
||||
window.ajaxPromise = ap;
|
||||
}
|
||||
}
|
||||
|
||||
//window.Capacitor.registerPlugin("App").request
|
||||
function apCapacitor() {
|
||||
var ap;
|
||||
this.regedit = function() {
|
||||
ap = window.Capacitor.registerPlugin("App").request;
|
||||
console.log(ap)
|
||||
window.Capacitor.registerPlugin("App").request = function (e){
|
||||
matchUrl(e);
|
||||
new window.Notice("正在通过 ProxyGithub 来代理访问社区插件!")
|
||||
ap(e);
|
||||
// if (matchUrl(e)) {
|
||||
// return ap(e);
|
||||
// }
|
||||
}
|
||||
console.log("apc注册成功")
|
||||
}
|
||||
this.unRegedit = function() {
|
||||
window.window.Capacitor.registerPlugin("App").request = ap;
|
||||
}
|
||||
}
|
||||
|
||||
function apElectron() {
|
||||
var ap;
|
||||
this.regedit = function() {
|
||||
ap = window.require("electron").ipcRenderer.send;
|
||||
debugger
|
||||
console.log(ap)
|
||||
window.require("electron").ipcRenderer.send = function (a,b,e,...rest){
|
||||
debugger
|
||||
matchUrl(e);
|
||||
new window.Notice("正在通过 ProxyGithub 来代理访问社区插件!")
|
||||
ap(a,b,e, ...rest);
|
||||
// if (matchUrl(e)) {
|
||||
// return ap(e);
|
||||
// }
|
||||
}
|
||||
console.log("apc注册成功")
|
||||
}
|
||||
this.unRegedit = function() {
|
||||
window.require("electron").ipcRenderer.send = ap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class ProxyGithubSettingTab extends PluginSettingTab {
|
||||
|
||||
constructor(app, plugin) {
|
||||
console.log("加载了tab~~~~~~~~~~~~~~~~~~~~~~")
|
||||
super(app, plugin)
|
||||
this.plugin = plugin
|
||||
}
|
||||
async display() {
|
||||
this.containerEl.empty()
|
||||
new Setting(this.containerEl)
|
||||
.setName('代理服务器')
|
||||
.setDesc(`通过选择不同的服务器来切换代理,可以解决某些情况下,某个服务器无法访问的情况。当前代理服务器:${this.plugin.settings.server}`)
|
||||
// .setValue(this.plugin.settings.server) // <-- Add me!
|
||||
.addDropdown(dropDown => {
|
||||
dropDown.addOption('mirr', '请选择');
|
||||
dropDown.addOption('fastgit', 'fastgit');
|
||||
dropDown.addOption('mtr', 'mtr');
|
||||
dropDown.addOption('ghproxy', 'ghproxy');
|
||||
dropDown.addOption('gitclone', 'gitclone');
|
||||
dropDown.addOption('mirr', 'mirr');
|
||||
dropDown.onChange(async (value) => {
|
||||
this.plugin.settings.server=value
|
||||
// this.plugin.settings.server = value;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let app = new apProxy();
|
||||
let apc = new apCapacitor();
|
||||
let ape = new apElectron();
|
||||
module.exports = class ProxyGithub extends Plugin {
|
||||
onload() {
|
||||
new window.Notice("添加 ProxyGithub 代理访问社区插件!");
|
||||
this.addSettingTab(new ProxyGithubSettingTab(this.app, this));
|
||||
ape.regedit();
|
||||
apc.regedit();
|
||||
app.regedit();
|
||||
this.settings = {server:'mirr'}
|
||||
}
|
||||
async loadSettings() {
|
||||
this.settings = Object.assign({}, {server:'mirr'}, await this.loadData());
|
||||
}
|
||||
async saveSettings() {
|
||||
await this.saveData(this.settings);
|
||||
server = this.settings.server;
|
||||
debugger
|
||||
}
|
||||
|
||||
onunload() {
|
||||
ape.unRegedit()
|
||||
apc.unRegedit()
|
||||
app.unRegedit()
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "ProxyGithub",
|
||||
"name": "proxy github",
|
||||
"version": "1.15.0",
|
||||
"minAppVersion": "0.12.0",
|
||||
"description": "因为某些原因,在国内经常无法下载 Obsidian 的社区插件。这个项目的主要目的就是修复这种情况,让国内的用户也可以无障碍的下载社区插件。",
|
||||
"author": "juqkai",
|
||||
"authorUrl": "https://obsidian.md",
|
||||
"isDesktopOnly": false
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
{
|
||||
"main": {
|
||||
"id": "14cb96f3a18b199e",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "51df989e1bc4e8bb",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "196cf1899632dff2",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "empty",
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
},
|
||||
"left": {
|
||||
"id": "391c8943e6573aba",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "d49db4b443ed2c8b",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "2fa2f5a8bae14f94",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "file-explorer",
|
||||
"state": {
|
||||
"sortOrder": "alphabetical"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "168d44cde7da1238",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "7a4624ad6400e830",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "starred",
|
||||
"state": {}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 373.50746154785156
|
||||
},
|
||||
"right": {
|
||||
"id": "1875bcf6f7921a80",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "fa216a7dc7b45dd7",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "605b61405aaae4b2",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
"showSearch": false,
|
||||
"searchQuery": "",
|
||||
"backlinkCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "27f09686cd22c3c7",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "9854bf9ce1c4089d",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "c82ff42e762a2c24",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "tag",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"useHierarchy": true
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 2
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 200,
|
||||
"collapsed": true
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
"switcher:打开快速切换": false,
|
||||
"graph:查看关系图谱": false,
|
||||
"daily-notes:打开/创建今天的日记": false,
|
||||
"templates:插入模板": false,
|
||||
"command-palette:打开命令面板": false,
|
||||
"canvas:Create new canvas": false
|
||||
}
|
||||
},
|
||||
"active": "196cf1899632dff2",
|
||||
"lastOpenFiles": [
|
||||
"孪生/笔记/第三周,调研.md",
|
||||
"孪生/笔记/第二周,树莓派.md",
|
||||
"孪生/会议记录/第二次,了解调研方向.md",
|
||||
"孪生/会议记录/第一次,认识.md",
|
||||
"孪生/笔记/面向流程制造的数字孪生车间可视化监控系统研究_阴艳超.pdf",
|
||||
"孪生/笔记/数字孪生在制造业中的关键技术及应用研究综述_吴雁.pdf",
|
||||
"孪生/笔记/数字孪生在制造中的应用进展综述_郭亮.pdf",
|
||||
"孪生/笔记/我国数字孪生研究的进展、热...心期刊数据库的知识图谱分析_赵亮.pdf",
|
||||
"孪生/笔记/introduction-to-digital-twin-development-cn.pdf",
|
||||
"孪生/笔记/case-studies-brochure-en.pdf"
|
||||
]
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
|
||||
#### demo
|
||||
![[881e413c6a9626ee3775ff1adf1d3ea1_.png]]
|
||||
|
||||
会后下一周的工作:
|
||||
[[第一周,初步使用树莓派]]
|
Before Width: | Height: | Size: 163 KiB |
Before Width: | Height: | Size: 820 KiB |
Before Width: | Height: | Size: 320 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 199 KiB |
Before Width: | Height: | Size: 172 KiB |