fix cve_list sort order
(cherry picked from commit 1ce33f72486fc1d5fa47332ed09c9791bd7a6213)
This commit is contained in:
parent
39573b24f5
commit
2705a3a70f
30
0001-fix-cve-list-sort.patch
Normal file
30
0001-fix-cve-list-sort.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From b87c51761b3143aabd39a3e9c91596e540325172 Mon Sep 17 00:00:00 2001
|
||||
From: rearcher <123781007@qq.com>
|
||||
Date: Mon, 18 Dec 2023 22:24:51 +0800
|
||||
Subject: [PATCH] fix cve_list sort
|
||||
|
||||
---
|
||||
apollo/database/proxy/cve.py | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/apollo/database/proxy/cve.py b/apollo/database/proxy/cve.py
|
||||
index e92cb14..6210156 100644
|
||||
--- a/apollo/database/proxy/cve.py
|
||||
+++ b/apollo/database/proxy/cve.py
|
||||
@@ -669,10 +669,11 @@ class CveProxy(CveMysqlProxy, CveEsProxy):
|
||||
sort_page['limt_size'] = int(per_page)
|
||||
|
||||
# sort by host num by default
|
||||
+ sort_page["order_by"] = data.get("direction", "asc")
|
||||
sort_page["order_by_filed"] = data.get('sort', "cve_id")
|
||||
if sort_page["order_by_filed"] == "host_num":
|
||||
- sort_page["order_by_filed"] = "cve_id, host_num"
|
||||
- sort_page["order_by"] = data.get("direction", "asc")
|
||||
+ sort_page["order_by_filed"] = f"host_num {sort_page['order_by']},cve_id "
|
||||
+
|
||||
return sort_page
|
||||
|
||||
def _query_cve_list(self, data):
|
||||
--
|
||||
Gitee
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
Name: aops-apollo
|
||||
Version: v1.4.1
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: Cve management service, monitor machine vulnerabilities and provide fix functions.
|
||||
License: MulanPSL2
|
||||
URL: https://gitee.com/openeuler/%{name}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Patch0001: 0001-fix-cve-list-sort.patch
|
||||
|
||||
BuildRequires: python3-setuptools
|
||||
Requires: aops-vulcanus >= v1.3.0
|
||||
@ -27,7 +28,7 @@ Requires: python3-rpm
|
||||
smalltools for aops-apollo, e.g.updateinfo.xml generater
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
|
||||
# build for aops-apollo
|
||||
@ -67,6 +68,9 @@ popd
|
||||
%{python3_sitelib}/aops_apollo_tool/*
|
||||
|
||||
%changelog
|
||||
* Mon Dec 18 2023 luxuexian<luxuexian@huawei.com> - v1.4.1-2
|
||||
- fix cve_list sort order
|
||||
|
||||
* Mon Dec 18 2023 wenxin<wenxin32@foxmail.com> - v1.4.1-1
|
||||
- Add support for CVE rollback tasks
|
||||
- Optimize the code and adjust the project structure
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user