diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index 68b888c89..f56004447 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -713,6 +713,8 @@ "instantAdhoc": "即时命令", "AdhocManage": "命令管理", "PlaybookManage": "Playbook管理", + "PlaybookUpdate": "更新Playbook", + "PlaybookDetail": "Playbook详情", "history": "历史记录", "createAdhoc": "创建命令", "AdhocDetail": "命令详情", diff --git a/src/router/workbench/index.js b/src/router/workbench/index.js index 4d9408cee..be232bc4f 100644 --- a/src/router/workbench/index.js +++ b/src/router/workbench/index.js @@ -181,7 +181,7 @@ export default { meta: { title: i18n.t('route.updateAdhoc'), permissions: [], - activeMenu: '/workbench/ops/adhoc' + activeMenu: '/workbench/ops/scripts' } }, { @@ -192,7 +192,7 @@ export default { meta: { title: i18n.t('ops.createAdhoc'), permissions: [], - activeMenu: '/workbench/ops/adhoc' + activeMenu: '/workbench/ops/scripts' } }, { @@ -203,18 +203,29 @@ export default { meta: { title: i18n.t('route.AdhocDetail'), permissions: [], - activeMenu: '/workbench/ops/adhoc' + activeMenu: '/workbench/ops/scripts' } }, { - path: 'playbook/create', - name: 'PlaybookCreate', + path: 'playbook/:id/update', + name: 'PlaybookUpdate', hidden: true, - component: () => import('@/views/ops/ScriptManage/Playbook/PlaybookUpdateCreate'), + component: () => import('@/views/ops/ScriptManage/Playbook/PlaybookUpdate'), meta: { - title: i18n.t('route.PlaybookCreate'), + title: i18n.t('ops.PlaybookUpdate'), permissions: [], - activeMenu: '/workbench/ops/playbook' + activeMenu: '/workbench/ops/scripts' + } + }, + { + path: 'playbook/:id', + component: () => import('@/views/ops/ScriptManage/Playbook/PlaybookDetail'), + name: 'PlaybookDetail', + hidden: true, + meta: { + title: i18n.t('ops.PlaybookDetail'), + permissions: [], + activeMenu: '/workbench/ops/scripts' } } ] diff --git a/src/views/ops/ScriptManage/Adhoc.vue b/src/views/ops/ScriptManage/Adhoc.vue index f18f399b1..3a47db677 100644 --- a/src/views/ops/ScriptManage/Adhoc.vue +++ b/src/views/ops/ScriptManage/Adhoc.vue @@ -15,8 +15,12 @@ export default { tableConfig: { url: '/api/v1/ops/adhocs/', columns: [ - 'name', 'module', 'date_updated', 'date_created', 'actions' + 'name', 'module', 'args', 'comment', 'date_updated', 'date_created', 'actions' ], + columnsShow: { + min: ['name', 'actions'], + default: ['name', 'module', 'comment', 'args', 'comment', 'date_created', 'actions'] + }, columnsMeta: { name: { formatterArgs: { diff --git a/src/views/ops/ScriptManage/Adhoc/AdhocUpdateCreate.vue b/src/views/ops/ScriptManage/Adhoc/AdhocUpdateCreate.vue index 040167d70..fe9149155 100644 --- a/src/views/ops/ScriptManage/Adhoc/AdhocUpdateCreate.vue +++ b/src/views/ops/ScriptManage/Adhoc/AdhocUpdateCreate.vue @@ -14,7 +14,7 @@ export default { return { url: '/api/v1/ops/adhocs/', fields: [ - [this.$t('common.Basic'), ['name', 'module', 'args']] + [this.$t('common.Basic'), ['name', 'comment', 'module', 'args']] ], initial: { module: 'shell', @@ -22,15 +22,14 @@ export default { }, fieldsMeta: { args: { - label: 'content', component: CodeEditor } }, createSuccessNextRoute: { - name: 'Adhoc' + name: 'ScriptManage' }, updateSuccessNextRoute: { - name: 'Adhoc' + name: 'ScriptManage' } } } diff --git a/src/views/ops/ScriptManage/Playbook.vue b/src/views/ops/ScriptManage/Playbook.vue index 6db9bca94..8b14e8a19 100644 --- a/src/views/ops/ScriptManage/Playbook.vue +++ b/src/views/ops/ScriptManage/Playbook.vue @@ -21,13 +21,17 @@ export default { tableConfig: { url: '/api/v1/ops/playbooks/', columns: [ - 'name', 'path', 'date_updated', 'date_created', 'actions' + 'name', 'comment', 'date_created', 'date_updated', 'creator', 'actions' ], + columnsShow: { + min: ['name', 'actions'], + default: ['name', 'comment', 'date_created', 'actions'] + }, columnsMeta: { name: { formatterArgs: { can: true, - route: 'AdhocDetail' + route: 'PlaybookDetail' } }, actions: { @@ -35,7 +39,7 @@ export default { formatterArgs: { hasUpdate: true, canUpdate: true, - updateRoute: 'AdhocUpdate', + updateRoute: 'PlaybookUpdate', hasDelete: true, canDelete: true, hasClone: false, diff --git a/src/views/ops/ScriptManage/Playbook/PlaybookDetail/PlaybookDetail.vue b/src/views/ops/ScriptManage/Playbook/PlaybookDetail/PlaybookDetail.vue new file mode 100644 index 000000000..a7cb81c19 --- /dev/null +++ b/src/views/ops/ScriptManage/Playbook/PlaybookDetail/PlaybookDetail.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/views/ops/ScriptManage/Playbook/PlaybookDetail/index.vue b/src/views/ops/ScriptManage/Playbook/PlaybookDetail/index.vue new file mode 100644 index 000000000..cbc1206d9 --- /dev/null +++ b/src/views/ops/ScriptManage/Playbook/PlaybookDetail/index.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/src/views/ops/ScriptManage/Playbook/PlaybookUpdate.vue b/src/views/ops/ScriptManage/Playbook/PlaybookUpdate.vue new file mode 100644 index 000000000..8df2ab061 --- /dev/null +++ b/src/views/ops/ScriptManage/Playbook/PlaybookUpdate.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/views/ops/ScriptManage/Playbook/PlaybookUpdateCreate.vue b/src/views/ops/ScriptManage/Playbook/PlaybookUpdateCreate.vue deleted file mode 100644 index 327b2e3ca..000000000 --- a/src/views/ops/ScriptManage/Playbook/PlaybookUpdateCreate.vue +++ /dev/null @@ -1,49 +0,0 @@ - - - - -