update leaks scode

(cherry picked from commit ff8641a5e77914add098d44eccb162d03aa4bc1c)
This commit is contained in:
wkl505997900 2023-06-14 15:49:28 +08:00 committed by openeuler-sync-bot
parent 61fe113184
commit 23ac8cebcf
2 changed files with 216 additions and 1 deletions

View File

@ -0,0 +1,209 @@
From 41d1c1b28482e6ad4c0153c06cba620ce49bd1d8 Mon Sep 17 00:00:00 2001
From: wkl505997900 <2313665567@qq.com>
Date: Tue, 13 Jun 2023 17:37:11 +0800
Subject: [PATCH] update leaks code
---
.../components/CreateRepairTaskDrawer.vue | 21 +++++++++---
src/views/leaks/components/CvesTable.vue | 16 +++++-----
src/views/leaks/components/HostTable.vue | 32 +++++++++++++------
3 files changed, 47 insertions(+), 22 deletions(-)
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
index 84e8bac..b723f14 100644
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
@@ -41,6 +41,9 @@
</a-switch>
</a-form-item> -->
<a-form-item label="是否accept" v-if="taskType === 'cve fix'">
+ <description-tips v-if="taskType === 'cve fix'" style="margin-right: 6px;">
+ 如使用热补丁修复accept后会在重启时自动应用热补丁不勾选则重启时失效
+ </description-tips>
<a-switch :checked="accepted" @click="handleAcceptedChanage">
<a-icon slot="checkedChildren" type="check" />
<a-icon slot="unCheckedChildren" type="close" />
@@ -62,6 +65,12 @@
:columns="tableColumns"
:data-source="cveList"
:pagination="false">
+ <span slot="customTitle">{{ taskType === 'cve rollback' ? '热补丁修复' : '支持热补丁' }}
+ <description-tips v-if="taskType === 'cve fix'">
+ 若支持热补丁,默认使用热补丁修复;
+ 注意由于一个软件包只能应用一个热补丁热补丁修复时可能导致部分已修复cve重新生成
+ </description-tips>
+ </span>
<div slot="hostsList" slot-scope="hostsList">
<a-spin v-if="hostUnderCveLoading" />
<span v-else>
@@ -192,6 +201,7 @@ import {
generateRepoTask,
generateRollbackTask
} from '@/api/leaks';
+import DescriptionTips from '@/components/DescriptionTips';
const taskTypes = ['cve fix', 'repo set', 'cve rollback'];
const dataTypes = ['selected', 'all'];
@@ -213,6 +223,9 @@ const hostListTypes = ['byLoading', 'bySelection', 'byOneHost'];
export default {
name: 'CreateRepairTaskDrawer',
+ components: {
+ DescriptionTips
+ },
props: {
// 基本控制信息
fixed: {
@@ -300,20 +313,20 @@ export default {
key: 'cve_id',
title: 'CVE_ID',
scopedSlots: {customRender: 'cve_id'},
- width: 180
+ width: 150
},
{
dataIndex: 'hostsList',
key: 'hostsList',
title: '主机',
- width: 60,
+ width: 100,
scopedSlots: {customRender: 'hostsList'}
},
{
dataIndex: 'package',
key: 'package',
title: '修复软件包',
- width: 100,
+ width: 140,
scopedSlots: {customRender: 'packages'}
},
// {
@@ -326,7 +339,7 @@ export default {
{
dataIndex: 'hotpatch',
key: 'hotpatch',
- title: this.taskType === 'cve rollback' ? '热补丁修复' : '支持热补丁',
+ slots: { title: 'customTitle' },
scopedSlots: {customRender: 'hotpatch'}
}
];
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
index 42c9a70..b29b03f 100644
--- a/src/views/leaks/components/CvesTable.vue
+++ b/src/views/leaks/components/CvesTable.vue
@@ -308,11 +308,11 @@ export default {
sorter: true
},
{
- dataIndex: this.hotpatchContent === '热补丁支持' ? 'hotpatch' : 'fixStatus',
- key: this.hotpatchContent === '热补丁支持' ? 'hotpatch' : 'fixStatus',
+ 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 === '热补丁支持' ? [
+ filteredValue: this.hotpatchContent === '支持热补丁' ? filters.hotpatch || null : filters.fixStatus || null,
+ filters: this.hotpatchContent === '支持热补丁' ? [
{
text: '是',
value: 1
@@ -335,7 +335,7 @@ export default {
value: 0
}
],
- scopedSlots: {customRender: this.hotpatchContent === '热补丁支持' ? 'hotpatch' : 'fixStatus'}
+ scopedSlots: {customRender: this.hotpatchContent === '支持热补丁' ? 'hotpatch' : 'fixStatus'}
}
];
},
@@ -353,7 +353,7 @@ export default {
},
data() {
return {
- hotpatchContent: '热补丁支持',
+ hotpatchContent: '支持热补丁',
cveSearch: '',
scanloading: false,
size: 'small',
@@ -392,12 +392,12 @@ export default {
handleAffectChange(e) {
if (!this.standalone) {
if (e.target.value === 'a') {
- this.hotpatchContent = '热补丁支持'
+ this.hotpatchContent = '支持热补丁'
this.fixed = undefined
this.affected = true;
this.rollback = false;
} else if (e.target.value === 'b') {
- this.hotpatchContent = '热补丁支持'
+ this.hotpatchContent = '支持热补丁'
this.fixed = undefined
this.affected = false;
this.rollback = false;
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
index 4f9e431..0a2b875 100644
--- a/src/views/leaks/components/HostTable.vue
+++ b/src/views/leaks/components/HostTable.vue
@@ -280,11 +280,20 @@ export default {
scopedSlots: {customRender: 'repo'}
},
{
- dataIndex: 'fixStatus',
- key: 'fixStatus',
- title: '热补丁修复',
- filteredValue: filters.fixStatus || 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
+ },
+ {
+ text: '否',
+ value: 0
+ }
+ ] : [
{
text: '是(ACCEPTED)',
value: 1
@@ -298,7 +307,7 @@ export default {
value: 0
}
],
- scopedSlots: {customRender: 'fixStatus'}
+ scopedSlots: {customRender: this.hotpatchContent === '支持热补丁' ? 'hotpatch' : 'fixStatus'}
},
{
dataIndex: 'last_scan',
@@ -337,6 +346,7 @@ export default {
},
data() {
return {
+ hotpatchContent: '支持热补丁',
hostSearch: '',
hostTableData: [],
hostTableIsLoading: false,
@@ -386,10 +396,12 @@ export default {
},
handleFixChange(e) {
if (e.target.value === 'a') {
- this.fixed = false;
- } else {
- this.fixed = true;
- }
+ this.hotpatchContent = '支持热补丁'
+ this.fixed = false;
+ } else {
+ this.hotpatchContent = '热补丁修复'
+ this.fixed = true;
+ }
this.selectedRowKeys = []
// 切换修复状态后重新请求受影响主机列表
this.handleReset();
--
Gitee

View File

@ -2,7 +2,7 @@
Name: aops-hermes Name: aops-hermes
Version: v1.2.1 Version: v1.2.1
Release: 6 Release: 7
Summary: Web for an intelligent diagnose frame Summary: Web for an intelligent diagnose frame
License: MulanPSL2 License: MulanPSL2
URL: https://gitee.com/openeuler/%{name} URL: https://gitee.com/openeuler/%{name}
@ -13,6 +13,7 @@ Patch0002: 0002-Host-management-field-changes-and-hot-patch-repair.patch
Patch0003: 0003-add-Hot-patch-Filtering-function.patch Patch0003: 0003-add-Hot-patch-Filtering-function.patch
Patch0004: 0004-add-host-under-cve-hotpatch-Filtering-function.patch Patch0004: 0004-add-host-under-cve-hotpatch-Filtering-function.patch
Patch0005: 0005-fix-token-refresh-issue.patch Patch0005: 0005-fix-token-refresh-issue.patch
Patch0006: 0006-Change-of-vulnerability-management-page-application-issues.patch
BuildRequires: nodejs node-gyp nodejs-yarn BuildRequires: nodejs node-gyp nodejs-yarn
@ -48,6 +49,11 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
%changelog %changelog
* Wed Jun 14 2023 wangkunlong<505997900@qq.com> - v1.2.1-7
- The host list under cve has been fixed and the hot patch repair column has been changed to support hot patches
- The CVE list under the host list has-not been fixed and the hot patch support has been changed-to support hot patches
- Generate support for hot patches in the CVE repair task and add tooltip help text after accepting or not
* Fri Jun 9 2023 wangkunlong<505997900@qq.com> - v1.2.1-6 * Fri Jun 9 2023 wangkunlong<505997900@qq.com> - v1.2.1-6
- Fix-token-refresh-issue - Fix-token-refresh-issue
- Solve-the-issue-of-unreasonable-layout-in-the-CVE-detail-interface - Solve-the-issue-of-unreasonable-layout-in-the-CVE-detail-interface