diff --git a/package.json b/package.json
index 103c6344..473e9288 100644
--- a/package.json
+++ b/package.json
@@ -81,7 +81,7 @@
"lowdb": "^1.0.0",
"md5": "^2.2.1",
"melody.css": "^1.0.2",
- "picgo": "^1.1.12",
+ "picgo": "^1.1.13",
"qiniu": "^7.1.1",
"request": "^2.83.0",
"request-promise": "^4.2.2",
diff --git a/src/main/utils/picgoCoreIPC.js b/src/main/utils/picgoCoreIPC.js
index c6b1037f..841a3bbe 100644
--- a/src/main/utils/picgoCoreIPC.js
+++ b/src/main/utils/picgoCoreIPC.js
@@ -82,7 +82,7 @@ const handlePluginInstall = (ipcMain, STORE_PATH, CONFIG_PATH) => {
picgo.on('installSuccess', notice => {
event.sender.send('installSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
})
- pluginHandler.install([`picgo-plugin-${msg}`])
+ pluginHandler.install([msg])
picgo.cmd.program.removeAllListeners()
})
}
@@ -94,7 +94,19 @@ const handlePluginUninstall = (ipcMain, STORE_PATH, CONFIG_PATH) => {
picgo.on('uninstallSuccess', notice => {
event.sender.send('uninstallSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
})
- pluginHandler.uninstall([`picgo-plugin-${msg}`])
+ pluginHandler.uninstall([msg])
+ picgo.cmd.program.removeAllListeners()
+ })
+}
+
+const handlePluginUpdate = (ipcMain, STORE_PATH, CONFIG_PATH) => {
+ ipcMain.on('updatePlugin', (event, msg) => {
+ const picgo = new PicGo(CONFIG_PATH)
+ const pluginHandler = new PluginHandler(picgo)
+ picgo.on('updateSuccess', notice => {
+ event.sender.send('updateSuccess', notice.body[0].replace(/picgo-plugin-/, ''))
+ })
+ pluginHandler.update([msg])
picgo.cmd.program.removeAllListeners()
})
}
@@ -105,4 +117,5 @@ export default (app, ipcMain) => {
handleGetPluginList(ipcMain, STORE_PATH, CONFIG_PATH)
handlePluginInstall(ipcMain, STORE_PATH, CONFIG_PATH)
handlePluginUninstall(ipcMain, STORE_PATH, CONFIG_PATH)
+ handlePluginUpdate(ipcMain, STORE_PATH, CONFIG_PATH)
}
diff --git a/src/renderer/pages/PicGoSetting.vue b/src/renderer/pages/PicGoSetting.vue
index 968545fa..ef10a65b 100644
--- a/src/renderer/pages/PicGoSetting.vue
+++ b/src/renderer/pages/PicGoSetting.vue
@@ -26,6 +26,11 @@
>
点击设置
+
+ 点击设置
+
@@ -163,6 +168,33 @@
确定
+
+
+
+
+
+
+
+ 取消
+ 确定
+
+
- 取消
- 确定
+ 取消
+ 确定
@@ -223,12 +255,14 @@ export default {
keyBindingVisible: false,
customLinkVisible: false,
checkUpdateVisible: false,
+ proxyVisible: false,
customLink: {
value: this.$db.read().get('settings.customLink').value() || '$url'
},
shortKey: {
upload: this.$db.read().get('settings.shortKey.upload').value()
},
+ proxy: this.$db.read().get('picBed.proxy').value() || undefined,
rules: {
value: [
{ validator: customLinkRule, trigger: 'blur' }
@@ -280,6 +314,20 @@ export default {
}
})
},
+ cancelProxy () {
+ this.proxyVisible = false
+ this.proxy = this.$db.read().get('picBed.proxy').value() || undefined
+ },
+ confirmProxy () {
+ this.proxyVisible = false
+ this.$db.read().set('picBed.proxy', this.proxy).write()
+ const successNotification = new window.Notification('设置代理', {
+ body: '设置成功'
+ })
+ successNotification.onclick = () => {
+ return true
+ }
+ },
updateHelperChange (val) {
this.$db.read().set('settings.showUpdateTip', val).write()
},
diff --git a/src/renderer/pages/Plugin.vue b/src/renderer/pages/Plugin.vue
index 546bd21f..e89df999 100644
--- a/src/renderer/pages/Plugin.vue
+++ b/src/renderer/pages/Plugin.vue
@@ -48,7 +48,7 @@
- 卸载中
+ 进行中
{
+ this.loading = false
+ this.pluginList.forEach(item => {
+ if (item.name === plugin) {
+ item.ing = false
+ item.hasInstall = true
+ }
+ })
+ this.getPluginList()
+ })
this.$electron.ipcRenderer.on('uninstallSuccess', (evt, plugin) => {
this.loading = false
this.pluginList = this.pluginList.filter(item => {
@@ -185,6 +195,11 @@ export default {
click () {
_this.uninstallPlugin(plugin.name)
}
+ }, {
+ label: '更新插件',
+ click () {
+ _this.updatePlugin(plugin.name)
+ }
}]
for (let i in plugin.config) {
if (plugin.config[i].config.length > 0) {
@@ -218,6 +233,14 @@ export default {
})
this.$electron.ipcRenderer.send('uninstallPlugin', val)
},
+ updatePlugin (val) {
+ this.pluginList.forEach(item => {
+ if (item.name === val) {
+ item.ing = true
+ }
+ })
+ this.$electron.ipcRenderer.send('updatePlugin', val)
+ },
reloadApp () {
this.$electron.remote.app.relaunch()
this.$electron.remote.app.exit(0)
@@ -296,6 +319,7 @@ export default {
this.$electron.ipcRenderer.removeAllListeners('pluginList')
this.$electron.ipcRenderer.removeAllListeners('installSuccess')
this.$electron.ipcRenderer.removeAllListeners('uninstallSuccess')
+ this.$electron.ipcRenderer.removeAllListeners('updateSuccess')
}
}
diff --git a/yarn.lock b/yarn.lock
index db9b802f..61154953 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6196,9 +6196,10 @@ performance-now@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
-picgo@^1.1.12:
- version "1.1.12"
- resolved "http://registry.npm.taobao.org/picgo/download/picgo-1.1.12.tgz#264f54f3b8d5712d912fc64c051421da8dad2390"
+picgo@^1.1.13:
+ version "1.1.13"
+ resolved "https://registry.yarnpkg.com/picgo/-/picgo-1.1.13.tgz#77b6c8ac74a49edc3932c9de9d441e34e31adfd1"
+ integrity sha512-gLRCGeeeTEdRN+gXMOtIsr3Y0sdOKsyU6HRLwEWAgPCAEulXTNr5mTi8eBOp3RNxfwxnmh4jz+0N2jeZ4XPeyA==
dependencies:
chalk "^2.4.1"
commander "^2.17.0"