From 7a6e79ea62316ba95f757bd74f2f9ca6a983ad3c Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Wed, 8 Feb 2023 09:15:01 +0000 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E8=BD=AF=E4=BB=B6=E6=BA=90?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E9=80=89=E6=8B=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- .../node/node-layout/source/source_list.vue | 76 ++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/src/pages/node/node-layout/source/source_list.vue b/src/pages/node/node-layout/source/source_list.vue index ac9c1b2..3363fdf 100644 --- a/src/pages/node/node-layout/source/source_list.vue +++ b/src/pages/node/node-layout/source/source_list.vue @@ -1,11 +1,9 @@ @@ -156,6 +168,66 @@ export default { } }) }, + getPlanSourceList() { + getPlanSourceList().then(res => { + if (res && res.code === 200) { + this.planList = res.data + } + }) + }, + handleSetSourcePlan() { + this.$refs.planForm.validate(valid => { + if (valid) { + const params = { + nodeId: this.node.id, + mode: 'cover', + file: this.planForm.planName.split('--')[1] + } + this.confirmLoading = true + setSource(params).then(res => { + if (res.code === 200) { + this.$notification.success({ message: '配置软件源成功' }) + this.sourcePlanVisible = false + this.getSource() + } else { + if (res.code === 400) { + this.sourcePlanVisible = false + this.getSource() + } + this.$notification.error({ message: res.msg || '配置软件源失败' }) + } + }).finally(() => { + this.confirmLoading = false + }) + } + }) + }, + rollbackSource() { + this.$confirm({ + title: '系统提示', + content: '确定对该节点的软件源配置进行回滚?', + onOk: () => { + this.rollbackLoading = true + rollbackSourceList({ nodeId: this.node.id }).then(res => { + if (res.code === 200) { + this.$notification.success({ message: '回滚节点软件源配置成功' }) + this.getSource() + } else { + this.$notification.error({ message: res.msg || '回滚节点软件源配置失败' }) + } + }).finally(() => { + this.rollbackLoading = false + }) + } + }) + }, + selectTimeType(val) { + if (val === 'ss') { + this.cycle = 60 + } else { + this.cycle = 1 + } + } } } -- Gitee