This commit is contained in:
wkl505997900 2023-06-02 20:05:17 +08:00
parent cf85ecf24d
commit e4cf903754
2 changed files with 94 additions and 1 deletions

View File

@ -0,0 +1,89 @@
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

View File

@ -2,7 +2,7 @@
Name: aops-hermes
Version: v1.2.1
Release: 4
Release: 5
Summary: Web for an intelligent diagnose frame
License: MulanPSL2
URL: https://gitee.com/openeuler/%{name}
@ -11,6 +11,7 @@ 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
Patch0003: 0003-add-Hot-patch-Filtering-function.patch
Patch0004: 0004-add-host-under-cve-hotpatch-Filtering-function.patch
BuildRequires: nodejs node-gyp nodejs-yarn
@ -46,6 +47,9 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
%changelog
* Fri Jun 2 2023 wangkunlong<505997900@qq.com> - v1.2.1-5
- Add host under cve hotpatch Filtering function
* Fri Jun 2 2023 wangkunlong<505997900@qq.com> - v1.2.1-4
- Add Hot patch Filtering function