From 7a637a9f7135483ac1af4e60691ed13623d0e4ab Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Wed, 8 Feb 2023 09:19:58 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E8=8A=82=E7=82=B9=E8=BD=AF=E4=BB=B6?= =?UTF-8?q?=E6=BA=90=E9=85=8D=E7=BD=AE=E5=8D=95=E6=AC=A1=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E4=B8=8E=E5=91=A8=E6=9C=9F=E6=A3=80=E6=B5=8B=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 | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/pages/node/node-layout/source/source_list.vue b/src/pages/node/node-layout/source/source_list.vue index 3363fdf..c3b45f4 100644 --- a/src/pages/node/node-layout/source/source_list.vue +++ b/src/pages/node/node-layout/source/source_list.vue @@ -2,6 +2,11 @@
软件源设置 + + 检测源配置{{ nodeCheck&&nodeCheck.time?'('+nodeCheck.time+'s后可操作)':'' }} + + 定时检测源配置 + 回滚源配置
{ + if (res.code === 200) { + this.$notification.success({ message: res.msg }) + this.scanSourceListVisible = false + } + }) + }, + openScanSourceModal() { + this.scanSourceListVisible = true + getScanSource({ nodeId: this.node.id }).then(res => { + if (res.code === 200) { + this.openCycle = res.data.isFlag === '1' + if (!this.openCycle) { + this.cycle = 60 + this.cycleType = 'ss' + } else { + this.cycle = res.data.Cycle + this.cycleType = res.data.cycleType + } + } + }) + }, + scanSourceOk() { + if (this.openCycle) { + if (this.cycleType === 'ss' && (this.cycle < 60 || this.cycle > 30 * 24 * 60 * 60)) { + this.$notification.error({ message: '周期间隔请保证60~2592000秒钟之间' }) + return + } + if (this.cycleType === 'mm' && (this.cycle < 1 || this.cycle > 30 * 24 * 60)) { + this.$notification.error({ message: '周期间隔请保证1~43200分钟之间' }) + return + } + if (this.cycleType === 'hh' && (this.cycle < 1 || this.cycle > 30 * 24)) { + this.$notification.error({ message: '周期间隔请保证1~720小时之间' }) + return + } + if (this.cycleType === 'dd' && (this.cycle < 1 || this.cycle > 30)) { + this.$notification.error({ message: '周期间隔请保证1~30天之间' }) + return + } + } + const param = { nodeId: this.node.id, isFlag: this.openCycle ? 1 : 0, Cycle: this.cycle, cycleType: this.cycleType } + scanSourceListCycle(param).then(res => { + if (res.code === 200) { + this.$notification.success({ message: (this.openCycle ? '开启' : '关闭') + '周期检测软件源配置成功' }) + this.scanSourceListVisible = false + } + }) + }, getPlanSourceList() { getPlanSourceList().then(res => { if (res && res.code === 200) { -- Gitee From 601a0c215f4d4c180d43d94328b4d1d703a6e2fd Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Wed, 8 Feb 2023 09:21:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BD=AF=E4=BB=B6=E6=BA=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8E=A5=E5=8F=A3=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/api/node_source.js | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/api/node_source.js diff --git a/src/api/node_source.js b/src/api/node_source.js new file mode 100644 index 0000000..a9ba268 --- /dev/null +++ b/src/api/node_source.js @@ -0,0 +1,76 @@ +import request from '../utils/request' + +export function getSource(data) { + return request({ + url: '/node/getSourceList', + method: 'post', + data + }) +} + +export function setSource(data) { + return request({ + url: '/node/setSourceList', + method: 'post', + data, + headers: { + tip: 'no' + } + }) +} + +export function scanSourceListOnce(data) { + return request({ + url: '/node/scanSourceListOnce', + method: 'post', + data + }) +} + +export function scanSourceListCycle(data) { + return request({ + url: '/node/scanSourceListCycle', + method: 'post', + data + }) +} + +export function setSourceDataBase(data) { + return request({ + url: '/node/setSourceDatabase', + method: 'post', + data + }) +} + +export function getSourceDataBase(data) { + return request({ + url: '/node/getSourceDatabase', + method: 'post', + data + }) +} + +export function delSourceDataBase(data) { + return request({ + url: '/node/delSourceDatabaseByID', + method: 'post', + data + }) +} + +export function getScanSource(data) { + return request({ + url: '/node/getScanSource', + method: 'post', + data + }) +} + +export function rollbackSourceList(data) { + return request({ + url: '/node/rollbackSourceList', + method: 'post', + data + }) +} -- Gitee