diff --git a/src/pages/node/node-layout/source/source_list.vue b/src/pages/node/node-layout/source/source_list.vue index ac9c1b27fc4e12231603858b54440d61ff0467e3..3363fdf1a1e842db0967e424eeaf4a6d74ccb3df 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 + } + } } }