From 38dd735f4b41983a942b9c5f17476cb7f8b60fad Mon Sep 17 00:00:00 2001 From: wkl505997900 <2313665567@qq.com> Date: Fri, 2 Jun 2023 16:04:04 +0800 Subject: [PATCH] hotpatch update --- src/api/leaks.js | 1 + src/views/assests/HostManagement.vue | 4 ++-- src/views/leaks/CVEsDetail.vue | 4 ++++ src/views/leaks/HostLeakDetail.vue | 4 ++++ .../components/CreateRepairTaskDrawer.vue | 8 ++++++- src/views/leaks/components/CvesTable.vue | 21 ++++++++++++------- src/views/leaks/components/HostTable.vue | 8 +++---- 7 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/api/leaks.js b/src/api/leaks.js index 477dae1..a6a0d63 100644 --- a/src/api/leaks.js +++ b/src/api/leaks.js @@ -297,6 +297,7 @@ export function generateTask(parameters) { task_name: parameters.task_name, description: parameters.task_desc, auto_reboot: parameters.auto_reboot, + accepted: parameters.accepted, info: parameters.info || [] } }); diff --git a/src/views/assests/HostManagement.vue b/src/views/assests/HostManagement.vue index 080c145..5e7d1f9 100644 --- a/src/views/assests/HostManagement.vue +++ b/src/views/assests/HostManagement.vue @@ -95,8 +95,8 @@ const hostStatusMap = { '0': '在线', '1': '离线', '2': '未确认', - '3': '扫描中', - '4': '已完成', + '3': '在线', + '4': '在线', '5': '未知' }; diff --git a/src/views/leaks/CVEsDetail.vue b/src/views/leaks/CVEsDetail.vue index b853cd0..6dd318e 100644 --- a/src/views/leaks/CVEsDetail.vue +++ b/src/views/leaks/CVEsDetail.vue @@ -181,6 +181,10 @@ export default { }) .then(function (res) { _this.hostList = res.data.result || []; + _this.hostList.forEach((item) => { + item.hp_status = item.hp_status ? item.hp_status : '——' + item.fixStatus = item.hotpatch ? `是(${item.hp_status})` : '否' + }) _this.paginationTotal = res.data.total_count || (res.data.total_count === 0 ? 0 : undefined); }) .catch(function (err) { diff --git a/src/views/leaks/HostLeakDetail.vue b/src/views/leaks/HostLeakDetail.vue index 39d4c25..043b1d8 100644 --- a/src/views/leaks/HostLeakDetail.vue +++ b/src/views/leaks/HostLeakDetail.vue @@ -167,6 +167,10 @@ export default { }) .then(function (res) { _this.cveList = res.data.result; + _this.cveList.forEach((item) => { + item.hp_status = item.hp_status ? item.hp_status : '——' + item.fixStatus = item.hotpatch ? `是(${item.hp_status})` : '否' + }) _this.paginationTotal = res.data.total_count || (res.data.total_count === 0 ? 0 : undefined); }) .catch(function (err) { diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue index 79d4920..84e8bac 100644 --- a/src/views/leaks/components/CreateRepairTaskDrawer.vue +++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue @@ -41,7 +41,7 @@ --> - + @@ -274,6 +274,7 @@ export default { submitAndExecuteLoading: false, // 是否重启按钮数据 isResetChecked: false, + accepted: false, // 自动生成的任务名称和描述,初始化为空 taskNameDefault: '', taskDescDefault: '', @@ -433,6 +434,7 @@ export default { this.visible = true; this.cveList = this.cveListProps; this.isResetChecked = false; + this.accepted = false; this.selectedRowKeyMaps = {}; this.selectedRowsAllMaps = {}; this.setDefaultInfo(); @@ -551,6 +553,7 @@ export default { const params = { ...values, auto_reboot: this.isResetChecked, + accepted: this.accepted, info: this.cveList .map((cveInfo) => { return { @@ -719,6 +722,9 @@ export default { handleResetChanage(checked) { this.isResetChecked = checked; }, + handleAcceptedChanage(checked) { + this.accepted = checked; + }, onSelectChange(selectedRowKeys, selectedRows, cid) { this.selectedRowKeyMaps[cid] = selectedRowKeys; this.selectedRowsAllMaps[cid] = selectedRows; diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue index bca7fcd..97c4326 100644 --- a/src/views/leaks/components/CvesTable.vue +++ b/src/views/leaks/components/CvesTable.vue @@ -116,7 +116,7 @@

Description:

{{ record.description }}

-
+

{{ hotpatch ? '是' : '否' }}

@@ -308,11 +308,11 @@ export default { sorter: true }, { - dataIndex: 'hotpatch', - key: 'hotpatch', - title: '热补丁支持', - filteredValue: filters.hotpatch || null, - filters: [ + dataIndex: this.hotpatchContent === '热补丁支持' ? 'hotpatch' : 'fixStatus', + key: this.hotpatchContent === '热补丁支持' ? 'hotpatch' : 'fixStatus', + title: this.hotpatchContent, + filteredValue: this.hotpatchContent === '热补丁支持' ? filters.hotpatch || null : filters.fixStatus || null, + filters: this.hotpatchContent === '热补丁支持' ? [ { text: '是', value: 1 @@ -321,8 +321,8 @@ export default { text: '否', value: 0 } - ], - scopedSlots: {customRender: 'hotpatch'} + ] : null, + scopedSlots: {customRender: this.hotpatchContent === '热补丁支持' ? 'hotpatch' : 'fixStatus'} } ]; }, @@ -340,6 +340,7 @@ export default { }, data() { return { + hotpatchContent: '热补丁支持', cveSearch: '', scanloading: false, size: 'small', @@ -378,14 +379,17 @@ export default { handleAffectChange(e) { if (!this.standalone) { if (e.target.value === 'a') { + this.hotpatchContent = '热补丁支持' this.fixed = undefined this.affected = true; this.rollback = false; } else if (e.target.value === 'b') { + this.hotpatchContent = '热补丁支持' this.fixed = undefined this.affected = false; this.rollback = false; } else { + this.hotpatchContent = '热补丁修复' this.fixed = true; this.affected = true; this.rollback = true; @@ -578,6 +582,7 @@ export default { } }, mounted() { + console.log(this.inputList) setTimeout(() => { this.getCvesAll(); }, 500); diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue index 079f786..225c701 100644 --- a/src/views/leaks/components/HostTable.vue +++ b/src/views/leaks/components/HostTable.vue @@ -279,10 +279,10 @@ export default { scopedSlots: {customRender: 'repo'} }, { - dataIndex: 'hotpatch', - key: 'hotpatch', - title: '热补丁修复/状态', - scopedSlots: {customRender: 'hotpatch'} + dataIndex: 'fixStatus', + key: 'fixStatus', + title: '热补丁修复', + scopedSlots: {customRender: 'fixStatus'} }, { dataIndex: 'last_scan', -- Gitee