From 5d2e826baefe912714c2711494538a9e5fb96674 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com>
Date: Fri, 11 Nov 2022 18:18:40 +0800
Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?=
=?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=97=B6=EF=BC=8C=E5=88=87=E6=8D=A2=E6=96=B9?=
=?UTF-8?q?=E5=BC=8F=E9=BB=98=E8=AE=A4=E5=80=BC=E6=98=BE=E7=A4=BA=E4=B8=8D?=
=?UTF-8?q?=E5=87=86=E7=A1=AE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/assets/Platform/PlatformCreateUpdate.vue | 4 ++++
src/views/assets/Platform/const.js | 1 +
2 files changed, 5 insertions(+)
diff --git a/src/views/assets/Platform/PlatformCreateUpdate.vue b/src/views/assets/Platform/PlatformCreateUpdate.vue
index a73429202..7b046dd07 100644
--- a/src/views/assets/Platform/PlatformCreateUpdate.vue
+++ b/src/views/assets/Platform/PlatformCreateUpdate.vue
@@ -7,6 +7,7 @@
:fields-meta="fieldsMeta"
:clean-form-value="cleanFormValue"
:after-get-form-value="afterGetFormValue"
+ :after-get-remote-meta="handleAfterGetRemoteMeta"
/>
@@ -74,6 +75,9 @@ export default {
}
},
methods: {
+ handleAfterGetRemoteMeta(meta) {
+ this.fieldsMeta.su_method.options = meta?.su_method?.choices || []
+ },
async setCategories() {
const category = this.$route.query.category
const type = this.$route.query.type
diff --git a/src/views/assets/Platform/const.js b/src/views/assets/Platform/const.js
index 163ca1a01..87f6a7768 100644
--- a/src/views/assets/Platform/const.js
+++ b/src/views/assets/Platform/const.js
@@ -72,6 +72,7 @@ export const platformFieldsMeta = (vm) => {
},
su_method: {
type: 'select',
+ options: [],
hidden: (form) => !form['su_enabled']
}
}
From 057bb734050526105f9c582b88d10ba683820b0c Mon Sep 17 00:00:00 2001
From: feng <1304903146@qq.com>
Date: Fri, 11 Nov 2022 19:06:27 +0800
Subject: [PATCH 2/3] perf: change secret
---
.../ChangeAuthPlanAsset/index.vue | 10 ++---
.../ChangeAuthPlanExecutionInfo.vue | 14 ++----
.../ChangeAuthPlanExecutionTaskList.vue | 45 ++++++++-----------
.../ChangeAuthPlanExecutionDetail/index.vue | 5 ++-
.../ChangeAuthPlanExecutionList.vue | 41 +++++++----------
.../ChangeAuthPlanInfo.vue | 12 ++---
.../ChangeAuthPlanDetail/index.vue | 7 +--
.../ChangeAuthPlanList.vue | 5 ++-
src/views/accounts/ChangeAuthPlan/fields.js | 3 +-
9 files changed, 61 insertions(+), 81 deletions(-)
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue
index 62fba49c3..878195f5a 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue
@@ -31,7 +31,7 @@ export default {
data() {
return {
tableConfig: {
- url: `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/assets/`,
+ url: `/api/v1/assets/automation/${this.object.id}/assets/`,
columns: [
'name', 'ip', 'delete_action'
],
@@ -51,7 +51,7 @@ export default {
formatter: DeleteActionFormatter,
onDelete: function(col, row, cellValue, reload) {
this.$axios.patch(
- `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/asset/remove/`,
+ `/api/v1/assets/automation/${this.object.id}/asset/remove/`,
{ assets: [row.id] }
).then(res => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
@@ -84,7 +84,7 @@ export default {
return this.object.assets.indexOf(row.id) === -1
},
performAdd: (items, that) => {
- const relationUrl = `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/asset/add/`
+ const relationUrl = `/api/v1/assets/automation/${this.object.id}/asset/add/`
const data = {
assets: items
}
@@ -108,7 +108,7 @@ export default {
disabled: this.$store.getters.currentOrgIsRoot,
hasObjectsId: this.object.nodes,
performAdd: (items, that) => {
- const relationUrl = `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/nodes/?action=add`
+ const relationUrl = `/api/v1/assets/automation/${this.object.id}/nodes/?action=add`
const nodes = items.map(v => v.value)
const iHasObjects = that.iHasObjects.map(v => v.value)
const data = {
@@ -126,7 +126,7 @@ export default {
const data = {
nodes: [item.value]
}
- const relationUrl = `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/nodes/?action=remove`
+ const relationUrl = `/api/v1/assets/automation/${this.object.id}/nodes/?action=remove`
return this.$axios.patch(relationUrl, data)
},
onDeleteSuccess: (obj, that) => {
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue
index f20a9df4d..ca62be784 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue
@@ -28,25 +28,17 @@ export default {
computed: {
detailItems() {
return [
- {
- key: this.$t('xpack.ChangeAuthPlan.Username'),
- value: this.object.username
- },
{
key: this.$t('xpack.ChangeAuthPlan.AssetAmount'),
- value: this.object.assets_amount
+ value: this.object.snapshot.asset_amount
},
{
key: this.$t('xpack.ChangeAuthPlan.NodeAmount'),
- value: this.object.nodes_amount
+ value: this.object.snapshot.node_amount
},
{
key: this.$t('xpack.ChangeAuthPlan.PasswordStrategy'),
- value: this.object.password_strategy_display
- },
- {
- key: this.$t('xpack.ChangeAuthPlan.TimeDelta'),
- value: this.object.timedelta.toFixed(2) + 's'
+ value: this.object.trigger_display
},
{
key: this.$t('xpack.ChangeAuthPlan.DateStart'),
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue
index 16ca7b249..cf14d9b50 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue
@@ -19,12 +19,11 @@ export default {
}
},
data() {
- const vm = this
return {
tableConfig: {
url: `/api/v1/assets/change-secret-records/?execution_id=${this.object.id}`,
columns: [
- 'username', 'asset', 'is_success', 'timedelta', 'date_start', 'reason_display', 'actions'
+ 'asset', 'account', 'date_started', 'date_finished', 'status', 'error'
],
columnsMeta: {
asset: {
@@ -33,12 +32,28 @@ export default {
formatterArgs: {
can: this.$hasPerm('assets.view_asset'),
getTitle({ row }) {
- return row.asset_info.name
+ return row.asset.name
},
getRoute({ row }) {
return {
name: 'AssetDetail',
- params: { id: row.asset }
+ params: { id: row.asset.id }
+ }
+ }
+ }
+ },
+ account: {
+ label: this.$t('users.Username'),
+ formatter: DetailFormatter,
+ formatterArgs: {
+ can: this.$hasPerm('assets.view_account'),
+ getTitle({ row }) {
+ return row.account.name
+ },
+ getRoute({ row }) {
+ return {
+ name: 'AssetDetail',
+ params: { id: row.account.id }
}
}
}
@@ -55,28 +70,6 @@ export default {
},
reason_display: {
label: this.$t('xpack.AccountBackupPlan.Reason')
- },
- actions: {
- formatterArgs: {
- hasDelete: false,
- hasUpdate: false,
- hasClone: false,
- extraActions: [
- {
- name: 'retry',
- type: 'info',
- title: this.$t('xpack.ChangeAuthPlan.Retry'),
- can: vm.$hasPerm('xpack.change_changeauthplantask'),
- callback: function({ row, tableData }) {
- this.$axios.put(
- `/api/v1/assets/change-secret-records/${row.id}/`,
- ).then(res => {
- window.open(`/#/ops/celery/task/${res.task}/log/`, '_blank', 'toolbar=yes, width=900, height=600')
- })
- }.bind(this)
- }
- ]
- }
}
}
},
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue
index 2e6437d8c..4e7a5cc9d 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue
@@ -21,6 +21,7 @@ export default {
return {
execution: { id: '' },
config: {
+ url: '/api/v1/assets/automation-executions/',
activeMenu: 'ChangeAuthPlanExecutionInfo',
actions: {
hasUpdate: false,
@@ -30,12 +31,12 @@ export default {
{
title: this.$t('common.BasicInfo'),
name: 'ChangeAuthPlanExecutionInfo',
- hidden: () => !this.$hasPerm('xpack.view_changeauthplanexecution')
+ hidden: () => !this.$hasPerm('assets.view_automationexecution')
},
{
title: this.$t('xpack.ChangeAuthPlan.TaskList'),
name: 'ChangeAuthPlanExecutionTaskList',
- hidden: () => !this.$hasPerm('xpack.view_changeauthplantask')
+ hidden: () => !this.$hasPerm('assets.view_changesecretrecord')
}
],
getTitle: this.getExecutionTitle
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue
index 336cee49e..a42c52f63 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue
@@ -18,41 +18,32 @@ export default {
}
},
data() {
+ console.log('this', this)
return {
tableConfig: {
- url: `/api/v1/xpack/change-auth-plan/plan-execution/?plan_id=${this.object.id}`,
+ url: `/api/v1/assets/automation-executions/?automation_id=${this.object.id}`,
columns: [
- 'username', 'assets_amount', 'nodes_amount', 'result_summary', 'password_strategy_display',
- 'timedelta', 'trigger_display', 'date_start', 'actions'
+ 'asset_amount', 'node_amount', 'status',
+ 'trigger_display', 'date_start', 'actions'
],
columnsMeta: {
- username: {
- label: this.$t('xpack.ChangeAuthPlan.Username')
- },
- assets_amount: {
+ asset_amount: {
label: this.$t('xpack.ChangeAuthPlan.AssetAmount'),
- width: '80px'
- },
- nodes_amount: {
- label: this.$t('xpack.ChangeAuthPlan.NodeAmount'),
- width: '80px'
- },
- result_summary: {
- label: this.$t('xpack.ChangeAuthPlan.Result'),
width: '80px',
- showOverflowTooltip: true,
formatter: function(row) {
- const summary =
- {row.result_summary.succeed}/
- {row.result_summary.failed}/
- {row.result_summary.total}
-
- return summary
+ return { row.snapshot.asset_amount }
}
},
- password_strategy_display: {
- label: this.$t('xpack.ChangeAuthPlan.PasswordStrategy'),
- width: '220px',
+ node_amount: {
+ label: this.$t('xpack.ChangeAuthPlan.NodeAmount'),
+ width: '80px',
+ formatter: function(row) {
+ return { row.snapshot.node_amount }
+ }
+ },
+ status: {
+ label: this.$t('xpack.ChangeAuthPlan.Result'),
+ width: '80px',
showOverflowTooltip: true
},
timedelta: {
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue
index 176ef3c94..bcd1ccfae 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue
@@ -34,12 +34,12 @@ export default {
attrs: {
type: 'primary',
label: this.$t('xpack.ChangeAuthPlan.Execute'),
- disabled: !this.$hasPerm('xpack.add_changeauthplanexecution')
+ disabled: !this.$hasPerm('assets.add_automationexecution')
},
callbacks: {
click: function() {
this.$axios.post(
- `/api/v1/xpack/change-auth-plan/plan-execution/`,
+ `/api/v1/assets/automation-executions/`,
{ plan: this.object.id }
).then(res => {
window.open(`/#/ops/celery/task/${res.task}/log/`, '_blank', 'toolbar=yes, width=900, height=600')
@@ -59,19 +59,19 @@ export default {
},
{
key: this.$t('xpack.ChangeAuthPlan.Username'),
- value: this.object.username
+ value: this.object.accounts.join(', ')
},
{
key: this.$t('xpack.ChangeAuthPlan.AssetAmount'),
- value: this.object.assets_amount
+ value: this.object.assets.length
},
{
key: this.$t('xpack.ChangeAuthPlan.NodeAmount'),
- value: this.object.nodes_amount
+ value: this.object.nodes.length
},
{
key: this.$t('xpack.ChangeAuthPlan.PasswordStrategy'),
- value: this.object.password_strategy_display
+ value: this.object.secret_strategy.label
},
{
key: this.$t('xpack.ChangeAuthPlan.RegularlyPerform'),
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/index.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/index.vue
index 5278301c4..4ccfc7fae 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/index.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanDetail/index.vue
@@ -24,21 +24,22 @@ export default {
plan: { name: '', username: '', comment: '' },
config: {
activeMenu: 'ChangeAuthPlanInfo',
+ url: '/api/v1/assets/change-secret-automations/',
submenu: [
{
title: this.$t('common.BasicInfo'),
name: 'ChangeAuthPlanInfo',
- hidden: () => !this.$hasPerm('xpack.view_changeauthplan')
+ hidden: () => !this.$hasPerm('assets.view_changesecretautomation')
},
{
title: this.$t('xpack.ChangeAuthPlan.AssetAndNode'),
name: 'ChangeAuthPlanAsset',
- hidden: () => !this.$hasPerm('xpack.change_changeauthplan')
+ hidden: () => !this.$hasPerm('assets.change_changesecretautomation')
},
{
title: this.$t('xpack.ChangeAuthPlan.ExecutionList'),
name: 'ChangeAuthPlanExecutionList',
- hidden: () => !this.$hasPerm('xpack.view_changeauthplanexecution')
+ hidden: () => !this.$hasPerm('assets.view_automationexecution')
}
]
}
diff --git a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanList.vue b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanList.vue
index 6fe6d6419..98e2af6ca 100644
--- a/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanList.vue
+++ b/src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanList.vue
@@ -92,7 +92,10 @@ export default {
callback: function({ row }) {
this.$axios.post(
`/api/v1/assets/automation-executions/`,
- { plan: row.id }
+ {
+ automation: row.id,
+ type: row.type
+ }
).then(res => {
openTaskPage(res['task'])
})
diff --git a/src/views/accounts/ChangeAuthPlan/fields.js b/src/views/accounts/ChangeAuthPlan/fields.js
index a28c3ba77..76d4a2ccc 100644
--- a/src/views/accounts/ChangeAuthPlan/fields.js
+++ b/src/views/accounts/ChangeAuthPlan/fields.js
@@ -126,8 +126,7 @@ export const getFields = () => {
},
accounts: {
label: i18n.t('common.Username'),
- component: TagInput,
- helpText: i18n.t('xpack.ChangeAuthPlan.HelpText.UsernameOfCreateUpdatePage')
+ component: TagInput
},
secret: {
hidden: ({ secret_strategy, secret_type }) => (secret_strategy !== 'specific' || secret_type !== 'password')
From 9636cbace0cee7ce303815316101eec76286538c Mon Sep 17 00:00:00 2001
From: Aaron3S
Date: Fri, 11 Nov 2022 19:27:07 +0800
Subject: [PATCH 3/3] =?UTF-8?q?feat:=20ops=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 2 +-
src/components/FormFields/CodeEditor.vue | 76 +++++
src/i18n/langs/zh.json | 15 +-
src/router/workbench/index.js | 112 ++++++-
src/views/ops/Adhoc/InstantAdhoc.vue | 278 ++++++++++++++++++
src/views/ops/Adhoc/MyAdhoc.vue | 66 +++++
src/views/ops/Adhoc/index.vue | 51 ++++
.../ops/Adhoc/my/AdhocDetail/AdhocDetail.vue | 52 ++++
src/views/ops/Adhoc/my/AdhocDetail/index.vue | 42 +++
src/views/ops/Adhoc/my/AdhocUpdateCreate.vue | 49 +++
src/views/ops/Job/JobDetail/JobDetail.vue | 44 +++
src/views/ops/Job/JobDetail/JobHistory.vue | 113 +++++++
src/views/ops/Job/JobDetail/index.vue | 48 +++
src/views/ops/Job/JobUpdateCreate.vue | 124 ++++++++
src/views/ops/Job/index.vue | 75 +++++
.../ops/{Command.vue => Playbook/HIstory.vue} | 1 -
src/views/ops/Playbook/PlaybookList.vue | 74 +++++
.../ops/Playbook/PlaybookUpdateCreate.vue | 49 +++
src/views/ops/Playbook/UploadDialog.vue | 101 +++++++
src/views/ops/Playbook/index.vue | 45 +++
src/views/tasks/TaskList.vue | 8 +-
21 files changed, 1413 insertions(+), 12 deletions(-)
create mode 100644 src/components/FormFields/CodeEditor.vue
create mode 100644 src/views/ops/Adhoc/InstantAdhoc.vue
create mode 100644 src/views/ops/Adhoc/MyAdhoc.vue
create mode 100644 src/views/ops/Adhoc/index.vue
create mode 100644 src/views/ops/Adhoc/my/AdhocDetail/AdhocDetail.vue
create mode 100644 src/views/ops/Adhoc/my/AdhocDetail/index.vue
create mode 100644 src/views/ops/Adhoc/my/AdhocUpdateCreate.vue
create mode 100644 src/views/ops/Job/JobDetail/JobDetail.vue
create mode 100644 src/views/ops/Job/JobDetail/JobHistory.vue
create mode 100644 src/views/ops/Job/JobDetail/index.vue
create mode 100644 src/views/ops/Job/JobUpdateCreate.vue
create mode 100644 src/views/ops/Job/index.vue
rename src/views/ops/{Command.vue => Playbook/HIstory.vue} (84%)
create mode 100644 src/views/ops/Playbook/PlaybookList.vue
create mode 100644 src/views/ops/Playbook/PlaybookUpdateCreate.vue
create mode 100644 src/views/ops/Playbook/UploadDialog.vue
create mode 100644 src/views/ops/Playbook/index.vue
diff --git a/package.json b/package.json
index 556a72671..732fe710f 100644
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"vue": "2.6.10",
- "vue-codemirror-lite": "^1.0.4",
+ "vue-codemirror": "4.0.6",
"vue-cookie": "^1.1.4",
"vue-echarts": "^5.0.0-beta.0",
"vue-i18n": "^8.15.5",
diff --git a/src/components/FormFields/CodeEditor.vue b/src/components/FormFields/CodeEditor.vue
new file mode 100644
index 000000000..63b1a6b41
--- /dev/null
+++ b/src/components/FormFields/CodeEditor.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json
index 2b0aacbc6..928959bbb 100644
--- a/src/i18n/langs/zh.json
+++ b/src/i18n/langs/zh.json
@@ -361,6 +361,7 @@
"TableColSettingInfo": "请选择您想显示的列表详细信息。",
"Add": "添加",
"TemplateAdd": "模版添加",
+ "Task": "任务",
"UpdateAssetDetail": "配置更多信息",
"AddSuccessMsg": "添加成功",
"Auth": "认证",
@@ -682,7 +683,16 @@
"PENDING": "等待中",
"RUNNING": "运行中",
"SUCCESS": "成功",
- "FAILURE": "失败"
+ "FAILURE": "失败",
+ "script": "脚本列表",
+ "privilegeOnly": "仅选择特权账号",
+ "privilegeFirst": "优先选择特权账号",
+ "skip": "忽略当前资产",
+ "instantAdhoc": "即时命令",
+ "myAdhoc": "我的命令",
+ "history": "历史记录",
+ "createAdhoc": "创建命令",
+ "AdhocDetail": "命令详情"
},
"perms": {
"": "",
@@ -862,6 +872,9 @@
"GatewayUpdate": "更新网关",
"TaskCenter": "任务中心",
"JobCenter": "作业中心",
+ "JobList": "作业列表",
+ "JobCreate": "创建作业",
+ "JobUpdate": "更新作业",
"LabelCreate": "创建标签",
"LabelList": "标签管理",
"LabelUpdate": "更新标签",
diff --git a/src/router/workbench/index.js b/src/router/workbench/index.js
index a7f0741aa..5b0d284f3 100644
--- a/src/router/workbench/index.js
+++ b/src/router/workbench/index.js
@@ -90,24 +90,120 @@ export default {
},
children: [
{
- path: 'a',
- name: 'CommandExecutions2',
- component: () => import('@/views/ops/Command'),
+ path: 'adhoc',
+ name: 'Adhoc',
+ component: () => import('@/views/ops/Adhoc'),
meta: {
title: i18n.t('route.BatchCommand'),
- icon: 'terminal',
permissions: []
}
},
{
- path: '',
- name: 'CommandExecutions',
- component: () => import('@/views/ops/Command'),
+ path: 'command/:id',
+ component: () => import('@/views/ops/Adhoc/my/AdhocDetail'),
+ name: 'AdhocDetail',
+ hidden: true,
+ meta: {
+ title: i18n.t('route.AdhocDetail'),
+ permissions: [],
+ activeMenu: '/workbench/ops/adhoc'
+ }
+ },
+ {
+ path: 'command/:id/update',
+ name: 'AdhocUpdate',
+ component: () => import('@/views/ops/Adhoc/my/AdhocUpdateCreate'),
+ hidden: true,
+ meta: {
+ title: i18n.t('route.updateAdhoc'),
+ permissions: [],
+ activeMenu: '/workbench/ops/adhoc'
+ }
+ },
+ {
+ path: 'command/create',
+ name: 'AdhocCreate',
+ hidden: true,
+ component: () => import('@/views/ops/Adhoc/my/AdhocUpdateCreate'),
+ meta: {
+ title: i18n.t('ops.createAdhoc'),
+ permissions: [],
+ activeMenu: '/workbench/ops/adhoc'
+ }
+ },
+ {
+ path: 'playbook',
+ name: 'Playbook',
+ component: () => import('@/views/ops/Playbook'),
meta: {
title: i18n.t('route.BatchScript'),
- icon: 'book',
permissions: []
}
+ },
+ {
+ path: 'flow/create',
+ name: 'PlaybookCreate',
+ hidden: true,
+ component: () => import('@/views/ops/Playbook/PlaybookUpdateCreate'),
+ meta: {
+ title: i18n.t('route.PlaybookCreate'),
+ permissions: [],
+ activeMenu: '/workbench/ops/playbook'
+ }
+ },
+ {
+ path: 'job',
+ name: 'Job',
+ component: empty,
+ redirect: '',
+ meta: {
+ title: i18n.t('route.JobList'),
+ permissions: []
+ },
+ children: [
+ {
+ path: '',
+ name: 'JobList',
+ component: () => import('@/views/ops/Job'),
+ meta: {
+ title: i18n.t('route.JobList'),
+ permissions: []
+ }
+ },
+ {
+ path: 'create',
+ component: () => import('@/views/ops/Job/JobUpdateCreate'),
+ name: 'JobCreate',
+ hidden: true,
+ meta: {
+ title: i18n.t('route.JobCreate'),
+ permissions: [],
+ activeMenu: '/workbench/ops/job'
+ }
+ },
+ {
+ path: 'update',
+ component: () => import('@/views/ops/Job/JobUpdateCreate'),
+ name: 'JobUpdate',
+ hidden: true,
+ meta: {
+ title: i18n.t('route.JobUpdate'),
+ permissions: [],
+ activeMenu: '/workbench/ops/job'
+ }
+ },
+ {
+ path: ':id',
+ component: () => import('@/views/ops/Job/JobDetail'),
+ name: 'JobDetail',
+ hidden: true,
+ meta: {
+ title: i18n.t('route.JobDetail'),
+ permissions: [],
+ activeMenu: '/workbench/ops/job'
+ }
+ }
+ ]
}
]
}
diff --git a/src/views/ops/Adhoc/InstantAdhoc.vue b/src/views/ops/Adhoc/InstantAdhoc.vue
new file mode 100644
index 000000000..c162616f0
--- /dev/null
+++ b/src/views/ops/Adhoc/InstantAdhoc.vue
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Adhoc/MyAdhoc.vue b/src/views/ops/Adhoc/MyAdhoc.vue
new file mode 100644
index 000000000..f18f399b1
--- /dev/null
+++ b/src/views/ops/Adhoc/MyAdhoc.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
diff --git a/src/views/ops/Adhoc/index.vue b/src/views/ops/Adhoc/index.vue
new file mode 100644
index 000000000..265cf0c2c
--- /dev/null
+++ b/src/views/ops/Adhoc/index.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Adhoc/my/AdhocDetail/AdhocDetail.vue b/src/views/ops/Adhoc/my/AdhocDetail/AdhocDetail.vue
new file mode 100644
index 000000000..9481886e9
--- /dev/null
+++ b/src/views/ops/Adhoc/my/AdhocDetail/AdhocDetail.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Adhoc/my/AdhocDetail/index.vue b/src/views/ops/Adhoc/my/AdhocDetail/index.vue
new file mode 100644
index 000000000..aa59d027f
--- /dev/null
+++ b/src/views/ops/Adhoc/my/AdhocDetail/index.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Adhoc/my/AdhocUpdateCreate.vue b/src/views/ops/Adhoc/my/AdhocUpdateCreate.vue
new file mode 100644
index 000000000..327b2e3ca
--- /dev/null
+++ b/src/views/ops/Adhoc/my/AdhocUpdateCreate.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
diff --git a/src/views/ops/Job/JobDetail/JobDetail.vue b/src/views/ops/Job/JobDetail/JobDetail.vue
new file mode 100644
index 000000000..0bf2ac4c1
--- /dev/null
+++ b/src/views/ops/Job/JobDetail/JobDetail.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Job/JobDetail/JobHistory.vue b/src/views/ops/Job/JobDetail/JobHistory.vue
new file mode 100644
index 000000000..db9079a93
--- /dev/null
+++ b/src/views/ops/Job/JobDetail/JobHistory.vue
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Job/JobDetail/index.vue b/src/views/ops/Job/JobDetail/index.vue
new file mode 100644
index 000000000..d187d1977
--- /dev/null
+++ b/src/views/ops/Job/JobDetail/index.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Job/JobUpdateCreate.vue b/src/views/ops/Job/JobUpdateCreate.vue
new file mode 100644
index 000000000..f83b27294
--- /dev/null
+++ b/src/views/ops/Job/JobUpdateCreate.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Job/index.vue b/src/views/ops/Job/index.vue
new file mode 100644
index 000000000..871e10508
--- /dev/null
+++ b/src/views/ops/Job/index.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
diff --git a/src/views/ops/Command.vue b/src/views/ops/Playbook/HIstory.vue
similarity index 84%
rename from src/views/ops/Command.vue
rename to src/views/ops/Playbook/HIstory.vue
index 617b48826..6cf6d3869 100644
--- a/src/views/ops/Command.vue
+++ b/src/views/ops/Playbook/HIstory.vue
@@ -4,7 +4,6 @@
diff --git a/src/views/ops/Playbook/PlaybookList.vue b/src/views/ops/Playbook/PlaybookList.vue
new file mode 100644
index 000000000..cd86ecc22
--- /dev/null
+++ b/src/views/ops/Playbook/PlaybookList.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/ops/Playbook/PlaybookUpdateCreate.vue b/src/views/ops/Playbook/PlaybookUpdateCreate.vue
new file mode 100644
index 000000000..327b2e3ca
--- /dev/null
+++ b/src/views/ops/Playbook/PlaybookUpdateCreate.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
diff --git a/src/views/ops/Playbook/UploadDialog.vue b/src/views/ops/Playbook/UploadDialog.vue
new file mode 100644
index 000000000..70871ca82
--- /dev/null
+++ b/src/views/ops/Playbook/UploadDialog.vue
@@ -0,0 +1,101 @@
+
+
+
+
+
+
+
diff --git a/src/views/ops/Playbook/index.vue b/src/views/ops/Playbook/index.vue
new file mode 100644
index 000000000..1db91f2d9
--- /dev/null
+++ b/src/views/ops/Playbook/index.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/tasks/TaskList.vue b/src/views/tasks/TaskList.vue
index d29af0f7f..e3f20a15d 100644
--- a/src/views/tasks/TaskList.vue
+++ b/src/views/tasks/TaskList.vue
@@ -14,7 +14,7 @@ export default {
tableConfig: {
url: '/api/v1/ops/tasks/',
columns: [
- 'name', 'queue', 'comment', 'count', 'state', 'last_published_time'
+ 'name', 'display_name', 'queue', 'comment', 'count', 'state', 'last_published_time'
],
columnsMeta: {
name: {
@@ -22,6 +22,12 @@ export default {
can: true
}
},
+ display_name: {
+ label: 'display_name',
+ formatter: row => {
+ return row.meta.display_name ? row.meta.display_name : '-'
+ }
+ },
comment: {
label: 'comment',
formatter: (row) => {