From 68c1eff81de025a5645c1f56819b4e4dfc3c5f5d Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 7 Feb 2021 13:53:30 +0800 Subject: [PATCH] refactor: fix --- packages/api/src/registry/registry.js | 10 +++++----- packages/executor/src/index.js | 2 +- ui/certd-ui/src/views/detail/components/task-form.vue | 4 ++-- ui/certd-ui/src/views/detail/index.vue | 3 +++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/api/src/registry/registry.js b/packages/api/src/registry/registry.js index d13ce04a..7795e6b1 100644 --- a/packages/api/src/registry/registry.js +++ b/packages/api/src/registry/registry.js @@ -1,6 +1,6 @@ export class Registry { constructor () { - this.collection = new Map() + this.collection = {} } install (target) { @@ -8,7 +8,7 @@ export class Registry { return } if (this.collection == null) { - this.collection = new Map() + this.collection = {} } let defineName = target.define ? target.define().name : null if (defineName == null) { @@ -22,15 +22,15 @@ export class Registry { if (!key || value == null) { return } - this.collection.set(key, value) + this.collection[key] = value } get (name) { if (name) { - return this.collection.get(name) + return this.collection[name] } - throw new Error(`${name} not found`) + throw new Error(`${name} cant blank`) } getCollection () { diff --git a/packages/executor/src/index.js b/packages/executor/src/index.js index 85dcf461..8fd953b9 100644 --- a/packages/executor/src/index.js +++ b/packages/executor/src/index.js @@ -123,7 +123,7 @@ export class Executor { } deployTrace.set({ value: { status: 'success', remark: '执行成功' } }) - trace.set({ type: 'result', value: { status: 'success', remark: '部署成功' } }) + trace.set({ type: 'result', value: { status: 'success', remark: '执行成功' } }) } catch (e) { deployTrace.set({ value: { status: 'error', remark: '执行失败:' + e.message } }) trace.set({ type: 'result', value: { status: 'error', remark: deployName + '执行失败:' + e.message } }) diff --git a/ui/certd-ui/src/views/detail/components/task-form.vue b/ui/certd-ui/src/views/detail/components/task-form.vue index d897b570..b839e767 100644 --- a/ui/certd-ui/src/views/detail/components/task-form.vue +++ b/ui/certd-ui/src/views/detail/components/task-form.vue @@ -45,7 +45,7 @@ - + @@ -101,7 +101,7 @@ function useTaskForm (context) { }] }) const taskAdd = (deploy) => { - const task = { taskName: '新任务', type: undefined, _isAdd: true } + const task = { taskName: '新任务', type: undefined, _isAdd: true, props: {} } currentDeploy.value = deploy currentDeploy.value.tasks.push(task) currentTask.value = deploy.tasks[deploy.tasks.length - 1] diff --git a/ui/certd-ui/src/views/detail/index.vue b/ui/certd-ui/src/views/detail/index.vue index c4596305..94fab5af 100644 --- a/ui/certd-ui/src/views/detail/index.vue +++ b/ui/certd-ui/src/views/detail/index.vue @@ -226,6 +226,9 @@ function useExports (options) { return { async exportsToZip () { await exportsApi.exportsToZip(options) + }, + async exportsToJson () { + } } }