diff --git a/src/router/settings/index.js b/src/router/settings/index.js index 2ec65e62a..69d2638e1 100644 --- a/src/router/settings/index.js +++ b/src/router/settings/index.js @@ -238,7 +238,7 @@ export default { hidden: true, meta: { title: i18n.t('route.AppletHostCreate'), - permissions: ['settings.change_terminal'], + permissions: ['terminal.add_applethost'], activeMenu: '/settings/applets' } }, @@ -249,7 +249,7 @@ export default { hidden: true, meta: { title: i18n.t('route.AppletHostDetail'), - permissions: ['settings.change_terminal'], + permissions: ['terminal.view_applethost'], activeMenu: '/settings/applets' } }, @@ -260,7 +260,7 @@ export default { hidden: true, meta: { title: i18n.t('route.AppletHostUpdate'), - permissions: ['settings.change_terminal'], + permissions: ['terminal.change_applethost'], activeMenu: '/settings/applets' } } diff --git a/src/views/assets/Platform/const.js b/src/views/assets/Platform/const.js index fba31a0a7..ab69d3223 100644 --- a/src/views/assets/Platform/const.js +++ b/src/views/assets/Platform/const.js @@ -83,6 +83,10 @@ export const setAutomations = (vm) => { initial['ansible_enabled'] = automation['ansible_enabled'] initial['ansible_config'] = JSON.stringify(automation['ansible_config']) + if (initial['ansible_enabled'] === false) { + _.set(autoFieldsMeta, `ansible_enabled.el.disabled`, true) + } + for (const item of autoFields) { const itemEnabledKey = item + '_enabled' const itemMethodKey = item + '_method' diff --git a/src/views/settings/Applet/Applet/AppletList.vue b/src/views/settings/Applet/Applet/AppletList.vue index ca5bb406f..f2dda3170 100644 --- a/src/views/settings/Applet/Applet/AppletList.vue +++ b/src/views/settings/Applet/Applet/AppletList.vue @@ -57,6 +57,11 @@ export default { } - diff --git a/src/views/settings/Applet/AppletHost/AppletHostDetail/Detail.vue b/src/views/settings/Applet/AppletHost/AppletHostDetail/Detail.vue index 0ca453ce3..cfe50fd36 100644 --- a/src/views/settings/Applet/AppletHost/AppletHostDetail/Detail.vue +++ b/src/views/settings/Applet/AppletHost/AppletHostDetail/Detail.vue @@ -96,10 +96,6 @@ export default { value: this.object.protocols.map(i => i.name).join(',') }, 'public_ip', 'admin_user_display', - { - key: this.$t('assets.Domain'), - value: this.object.domain?.name || '' - }, 'vendor', 'model', 'cpu_model', 'memory', 'disk_info', { key: this.$t('assets.Platform'), diff --git a/src/views/settings/Applet/AppletHost/AppletHostDetail/index.vue b/src/views/settings/Applet/AppletHost/AppletHostDetail/index.vue index 750c225e7..83ed9c655 100644 --- a/src/views/settings/Applet/AppletHost/AppletHostDetail/index.vue +++ b/src/views/settings/Applet/AppletHost/AppletHostDetail/index.vue @@ -54,11 +54,12 @@ export default { ], hasRightSide: true, actions: { + canDelete: this.$hasPerm('terminal.delete_applethost'), + canUpdate: this.$hasPerm('terminal.change_applethost'), + deleteSuccessRoute: 'Applets', updateCallback: () => { - const category = this.host.category.value || 'host' - const routerName = _.capitalize(category) + 'Update' this.$router.push({ - name: routerName, + name: 'Applets', params: { id: this.$route.params.id }, query: { platform: this.host.platform.id } })