90 lines
3.1 KiB
Diff
90 lines
3.1 KiB
Diff
From 05a989789e7e024a6f6342c43791194deb7886ce Mon Sep 17 00:00:00 2001
|
|
From: wkl505997900 <2313665567@qq.com>
|
|
Date: Fri, 2 Jun 2023 19:46:25 +0800
|
|
Subject: [PATCH] wanshan
|
|
|
|
---
|
|
src/api/leaks.js | 4 ++-
|
|
src/views/leaks/components/HostTable.vue | 39 ++++++++++++++++++++++++
|
|
2 files changed, 42 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/api/leaks.js b/src/api/leaks.js
|
|
index b98cb49..770a3bc 100644
|
|
--- a/src/api/leaks.js
|
|
+++ b/src/api/leaks.js
|
|
@@ -152,7 +152,9 @@ export function getHostUnderCVE({ tableInfo, ...parameter }) {
|
|
host_name: tableInfo.filters.host_name === null ? undefined : tableInfo.filters.host_name,
|
|
host_group: tableInfo.filters.host_group === null ? undefined : tableInfo.filters.host_group,
|
|
repo: tableInfo.filters.repo === null ? undefined : tableInfo.filters.repo,
|
|
- last_scan: tableInfo.filters.last_scan
|
|
+ last_scan: tableInfo.filters.last_scan,
|
|
+ hotpatch: tableInfo.filters.hotpatch || [],
|
|
+ hp_status: tableInfo.filters.hp_status || []
|
|
},
|
|
page: tableInfo.pagination.current,
|
|
per_page: tableInfo.pagination.pageSize
|
|
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
|
index 225c701..96a7737 100644
|
|
--- a/src/views/leaks/components/HostTable.vue
|
|
+++ b/src/views/leaks/components/HostTable.vue
|
|
@@ -282,6 +282,21 @@ export default {
|
|
dataIndex: 'fixStatus',
|
|
key: 'fixStatus',
|
|
title: '热补丁修复',
|
|
+ filteredValue: filters.fixStatus || null,
|
|
+ filters: [
|
|
+ {
|
|
+ text: '是(ACCEPTED)',
|
|
+ value: 1
|
|
+ },
|
|
+ {
|
|
+ text: '是(ACTIVED)',
|
|
+ value: 2
|
|
+ },
|
|
+ {
|
|
+ text: '否',
|
|
+ value: 0
|
|
+ }
|
|
+ ],
|
|
scopedSlots: {customRender: 'fixStatus'}
|
|
},
|
|
{
|
|
@@ -396,10 +411,34 @@ export default {
|
|
this.$message.info('请至少选择一组主机!');
|
|
}
|
|
},
|
|
+ assignFiltersFixStatus(fixStatus) {
|
|
+ this.filters.hotpatch = []
|
|
+ this.filters.hp_status = []
|
|
+ fixStatus.forEach(value => {
|
|
+ if (value === 1) {
|
|
+ if (!this.filters.hotpatch.includes(1)) {
|
|
+ this.filters.hotpatch.push(1)
|
|
+ }
|
|
+ this.filters.hp_status.push('ACCEPTED')
|
|
+ }
|
|
+ if (value === 2) {
|
|
+ if (!this.filters.hotpatch.includes(1)) {
|
|
+ this.filters.hotpatch.push(1)
|
|
+ }
|
|
+ this.filters.hp_status.push('ACTIVED')
|
|
+ }
|
|
+ if (value === 0) {
|
|
+ this.filters.hotpatch.push(0)
|
|
+ }
|
|
+ })
|
|
+ },
|
|
handleTableChange(pagination, filters, sorter) {
|
|
// 存储翻页状态
|
|
this.pagination = pagination;
|
|
this.filters = Object.assign({}, this.filters, filters);
|
|
+ if (this.filters['fixStatus'] != null) {
|
|
+ this.assignFiltersFixStatus(this.filters['fixStatus'])
|
|
+ }
|
|
this.sorter = sorter;
|
|
// 排序、筛选、分页时,重新请求主机列表
|
|
this.getHostList();
|
|
--
|
|
Gitee
|
|
|