diff --git a/src/components/Common/TextBox.vue b/src/components/Common/TextBox.vue index 0c56a5b0..b8089a20 100644 --- a/src/components/Common/TextBox.vue +++ b/src/components/Common/TextBox.vue @@ -70,6 +70,10 @@ export default { } }, watch: { + value(val) { + this.adaptor = val + }, + adaptor(val) { this.$emit('input', val) } diff --git a/src/i18n/cn.js b/src/i18n/cn.js index 7c56beb4..1f23e3a1 100644 --- a/src/i18n/cn.js +++ b/src/i18n/cn.js @@ -163,6 +163,7 @@ export default { agent: 'Agents', secret: '秘钥管理', config: '配置管理', + plugin: '插件', system: '系统设置' }, diff --git a/src/i18n/en.js b/src/i18n/en.js index 203aef6b..a1729187 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -160,11 +160,12 @@ export default { settings: { li: { profile: 'Profile', - users: 'Users', + users: 'User', security: 'Security', - agent: 'Agents', - secret: 'Secrets', + agent: 'Agent', + secret: 'Secret', config: 'Config', + plugin: 'Plugin', system: 'System' }, diff --git a/src/router/index.js b/src/router/index.js index 6179e45e..acdc58dc 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -34,7 +34,8 @@ import SettingsConfigHome from '@/view/Settings/Config/Index' import SettingsConfigNew from '@/view/Settings/Config/New' import SettingsConfigEdit from '@/view/Settings/Config/Edit' -import SystemSettingsHome from '@/view/Settings/System/Index' +import SettingsPluginHome from '@/view/Settings/Plugin/Index' +import SettingsSystemHome from '@/view/Settings/System/Index' Vue.use(Router) @@ -183,10 +184,15 @@ export default new Router({ props: true }, + { + path: 'plugins', + name: 'PluginSettingsHome', + component: SettingsPluginHome + }, { path: 'system', name: 'SystemSettingsHome', - component: SystemSettingsHome + component: SettingsSystemHome } ] } diff --git a/src/util/plugins.js b/src/util/plugins.js index 2fe288bb..16b6afa7 100644 --- a/src/util/plugins.js +++ b/src/util/plugins.js @@ -1,3 +1,5 @@ +import { timeFormat } from "./time" + export const TagNotification = 'notification' export class PluginWrapper { @@ -19,11 +21,11 @@ export class PluginWrapper { } get docker() { - return this.plugin.docker + return this.plugin.meta.docker } get icon() { - return this.plugin.icon + return this.plugin.meta.icon } get version() { @@ -38,16 +40,12 @@ export class PluginWrapper { return this.plugin.source } - get inputs() { - return this.plugin.inputs - } - get isDefaultIcon() { - return !this.plugin.icon + return !this.plugin.meta.icon } get isHttpLinkIcon() { - const pathOrLink = this.plugin.icon + const pathOrLink = this.plugin.meta.icon if (!pathOrLink) { return false } @@ -56,11 +54,22 @@ export class PluginWrapper { } get isRepoSrcIcon() { - const pathOrLink = this.plugin.icon + const pathOrLink = this.plugin.meta.icon if (!pathOrLink) { return false } return !this.isHttpLinkIcon } + + get syncTime() { + if (this.plugin.syncTime) { + return timeFormat(this.plugin.syncTime) + } + return '-' + } + + get synced() { + return this.plugin.synced + } } diff --git a/src/view/Settings/FunList.vue b/src/view/Settings/FunList.vue index 735df2e7..ba62e22c 100644 --- a/src/view/Settings/FunList.vue +++ b/src/view/Settings/FunList.vue @@ -47,6 +47,10 @@ i18n: 'settings.li.config', path: 'configs' }, + { + i18n: 'settings.li.plugin', + path: 'plugins' + }, { i18n: 'settings.li.system', path: 'system' diff --git a/src/view/Settings/Plugin/Index.vue b/src/view/Settings/Plugin/Index.vue new file mode 100644 index 00000000..60eae4a1 --- /dev/null +++ b/src/view/Settings/Plugin/Index.vue @@ -0,0 +1,73 @@ + + + + + {{ item.name }} + {{ item.version }} + {{ item.desc }} + + mdi-check-circle + mdi-close-circle-outline + + {{ item.syncTime }} + + + + + + + + \ No newline at end of file