From cb1c1a75a964e186c06110687d5a2289ca449f6c Mon Sep 17 00:00:00 2001 From: monkeyWie Date: Fri, 2 Nov 2018 17:56:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=89=A9=E5=B1=95=E5=90=8E=E8=AE=BE=E7=BD=AE=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=B2=A1=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/i18n/en-US.js | 3 ++- front/src/i18n/zh-TW.js | 3 ++- front/src/views/Extension.vue | 22 ++++++++++++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/front/src/i18n/en-US.js b/front/src/i18n/en-US.js index d133bab4..15f25516 100644 --- a/front/src/i18n/en-US.js +++ b/front/src/i18n/en-US.js @@ -83,7 +83,8 @@ export default { extCenter: 'Extension center', installLocalExt: 'Install local extension', installOk: 'Installed successfully', - installErr: 'Installation failed, please check the manifest.json file' + installErr: 'Installation failed, please check the manifest.json file', + setting: 'Setting' }, setting: { downSetting: 'Download settings', diff --git a/front/src/i18n/zh-TW.js b/front/src/i18n/zh-TW.js index 930700c6..3f64ccef 100644 --- a/front/src/i18n/zh-TW.js +++ b/front/src/i18n/zh-TW.js @@ -83,7 +83,8 @@ export default { extCenter: '擴充中心', installLocalExt: '加載本地擴充', installOk: '加載成功', - installErr: '加載失敗,請檢查manifest.json文件' + installErr: '加載失敗,請檢查manifest.json文件', + setting: '預設' }, setting: { downSetting: '下載設定', diff --git a/front/src/views/Extension.vue b/front/src/views/Extension.vue index ddf04595..1a07b91d 100644 --- a/front/src/views/Extension.vue +++ b/front/src/views/Extension.vue @@ -61,7 +61,7 @@
+ :title="$t('extension.setting')"> @@ -303,7 +303,9 @@ export default { row.meta = { path: row.meta.path, enabled: true } this.localAllList.push(row) } - this.refreshExtensions() + this.getLocalExtensions(() => { + this.refreshExtensions() + }) this.spinShow = false this.$Message.success({ content: this.$t('extension.downloadOk'), @@ -386,16 +388,23 @@ export default { } }) }, - loadExtensions() { - // Loading proxy mode - getProxyMode().then(mode => (this.proxySwitch = mode === 1)) - // Get local installed extension + getLocalExtensions(callback) { getExtensions().then(localAllList => { this.localAllList = localAllList this.localAllList.forEach(localExt => { localExt.installed = true localExt.currVersion = localExt.version }) + if (callback) { + callback() + } + }) + }, + loadExtensions() { + // Loading proxy mode + getProxyMode().then(mode => (this.proxySwitch = mode === 1)) + // Get local installed extension + this.getLocalExtensions(() => { this.searchExtensions() }) }, @@ -417,6 +426,7 @@ export default { this.$set(onlineExt, 'installed', true) this.$set(onlineExt, 'currVersion', localExt.version) this.$set(onlineExt, 'meta', localExt.meta) + this.$set(onlineExt, 'settings', localExt.settings) } else { onlineExt.installed = false onlineExt.meta = { path: onlineExt.path, enabled: false }