diff --git a/main.js b/main.js index cfeb6140e8d8ab9f00aa42007b32ed7a3faaa10d..26dd2dfb3a807e9d5873b008bca342c261497e78 100644 --- a/main.js +++ b/main.js @@ -1,33 +1,28 @@ const {Plugin, PluginSettingTab, Setting } = require("obsidian"); - -let server = 'fastgit' - +//改了一下默认镜像 +let server = 'gitmirror' +//删了几个慢的和无效的 let proMap = { - fastgit:{ - down:"https://download.fastgit.org/" - ,raw:"https://raw.fastgit.org/" - ,home:"https://hub.fastgit.org/" + gitmirror:{ + down:"https://hub.gitmirror.com/" + ,raw:"https://raw.gitmirror.com" + ,home:"https://hub.gitmirror.com/" } - ,mtr:{ + ,fastgit:{ down:"https://download.fastgit.org/" - ,raw:"https://raw-gh.gcdn.mirr.one/" - ,home:"https://api.mtr.pub/" + ,raw:"https://raw.fgit.cf" + ,home:"https://hub.fgit.cf/" } ,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/" + down:"https://ghproxy.com/https://github.com/" + ,raw:"https://ghproxy.com/https://github.com/" + ,home:"https://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 = [ @@ -220,12 +215,11 @@ class ProxyGithubSettingTab extends PluginSettingTab { .setDesc(`通过选择不同的服务器来切换代理,可以解决某些情况下,某个服务器无法访问的情况。当前代理服务器:${this.plugin.settings.server}`) // .setValue(this.plugin.settings.server) // <-- Add me! .addDropdown(dropDown => { - dropDown.addOption('mirr', '请选择'); + dropDown.addOption('mirror', '请选择'); + dropDown.addOption('gitmirror', 'gitmirror'); 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; @@ -248,10 +242,10 @@ module.exports = class ProxyGithub extends Plugin { ape.regedit(); apc.regedit(); app.regedit(); - this.settings = {server:'mirr'} + this.settings = {server:'gitmirror'} } async loadSettings() { - this.settings = Object.assign({}, {server:'mirr'}, await this.loadData()); + this.settings = Object.assign({}, {server:'gitmirror'}, await this.loadData()); } async saveSettings() { await this.saveData(this.settings);