210 lines
7.8 KiB
Diff
210 lines
7.8 KiB
Diff
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
|
||
|