diff --git a/0002-Host-management-field-changes-and-hot-patch-repair.patch b/0002-Host-management-field-changes-and-hot-patch-repair.patch new file mode 100644 index 0000000..021e4bb --- /dev/null +++ b/0002-Host-management-field-changes-and-hot-patch-repair.patch @@ -0,0 +1,216 @@ +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 + diff --git a/aops-hermes.spec b/aops-hermes.spec index aa88a56..ebd9d32 100644 --- a/aops-hermes.spec +++ b/aops-hermes.spec @@ -2,13 +2,14 @@ Name: aops-hermes Version: v1.2.1 -Release: 2 +Release: 3 Summary: Web for an intelligent diagnose frame License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} Source0: %{name}-%{version}.tar.gz Source1: node-modules.tar.gz Patch0001: 0001-Resolve-issues-such-as-abnormal-display.patch +Patch0002: 0002-Host-management-field-changes-and-hot-patch-repair.patch BuildRequires: nodejs node-gyp nodejs-yarn @@ -44,6 +45,11 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/ %changelog +* Fri Jun 2 2023 wangkunlong<505997900@qq.com> - v1.2.1-3 +- Add the 'accepted' parameter to the interface for creating cve repair tasks +- Modify the cve list under the host and the hot patch support in the affected host list under cve to display two fields: hot patch repair and status +- Modify the display of host status in the host management interface + * Thu Jun 1 2023 wangkunlong<505997900@qq.com> - v1.2.1-2 - Resolve the issue of abnormal page display when switching host details - Resolve the issue of host details and hot patch support column filtering failure