!101 更新版本到v1.3.4
From: @wkl505997900 Reviewed-by: @zhu-yuncheng Signed-off-by: @zhu-yuncheng
This commit is contained in:
commit
c2dd562c24
@ -1,51 +0,0 @@
|
|||||||
From 05b4972808e22c2a9c2c36aa639e521e1a6d5809 Mon Sep 17 00:00:00 2001
|
|
||||||
From: wkl505997900 <2313665567@qq.com>
|
|
||||||
Date: Wed, 20 Sep 2023 14:43:57 +0800
|
|
||||||
Subject: [PATCH] solve some bug
|
|
||||||
|
|
||||||
---
|
|
||||||
src/vendor/ant-design-pro/utils/request.js | 6 +++++-
|
|
||||||
src/views/leaks/components/CvesTable.vue | 3 ++-
|
|
||||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/vendor/ant-design-pro/utils/request.js b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
index 1f0fe84..c3307ce 100644
|
|
||||||
--- a/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
+++ b/src/vendor/ant-design-pro/utils/request.js
|
|
||||||
@@ -83,7 +83,11 @@ request.interceptors.request.use(config => {
|
|
||||||
const userName = localStorage.getItem('user_name')
|
|
||||||
userName && localStorage.setItem('user_name', userName);
|
|
||||||
}
|
|
||||||
- config.headers['Content-Type'] = 'application/json'
|
|
||||||
+ if (config.url === '/vulnerability/cve/advisory/upload' || config.url === '/vulnerability/cve/unaffected/upload') {
|
|
||||||
+ config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
||||||
+ } else {
|
|
||||||
+ config.headers['Content-Type'] = 'application/json'
|
|
||||||
+ }
|
|
||||||
return config;
|
|
||||||
}, errorHandler);
|
|
||||||
|
|
||||||
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
|
|
||||||
index eae6a6b..72b4703 100644
|
|
||||||
--- a/src/views/leaks/components/CvesTable.vue
|
|
||||||
+++ b/src/views/leaks/components/CvesTable.vue
|
|
||||||
@@ -705,7 +705,6 @@ export default {
|
|
||||||
this.pagination = pagination;
|
|
||||||
// 翻页时清楚展开状态
|
|
||||||
this.expandedRowKeys = []
|
|
||||||
-
|
|
||||||
this.filters = Object.assign({}, this.filters, filters);
|
|
||||||
if (this.filters['fixStatus'] != null) {
|
|
||||||
this.assignFiltersFixStatus(this.filters['fixStatus'])
|
|
||||||
@@ -1072,6 +1071,8 @@ export default {
|
|
||||||
pageSize: pagination.pageSize,
|
|
||||||
total: res.data.total_count || (res.data.total_count === 0 ? 0 : pagination.total)
|
|
||||||
};
|
|
||||||
+ // 获取cve列表后清楚展开状态
|
|
||||||
+ _this.expandedRowKeys = [];
|
|
||||||
})
|
|
||||||
.catch(function (err) {
|
|
||||||
_this.$message.error(err.response.message);
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
|
|
||||||
@ -1,127 +0,0 @@
|
|||||||
From f67fbff8a0b1df63d220b9ec0864cdd276c42612 Mon Sep 17 00:00:00 2001
|
|
||||||
From: wkl505997900 <2313665567@qq.com>
|
|
||||||
Date: Wed, 20 Sep 2023 19:23:01 +0800
|
|
||||||
Subject: [PATCH] change rpm params
|
|
||||||
|
|
||||||
---
|
|
||||||
src/api/leaks.js | 2 ++
|
|
||||||
src/views/leaks/components/CvesTable.vue | 18 ++++++++++++++++--
|
|
||||||
src/views/leaks/components/HostInCveRpm.vue | 10 ++++++++++
|
|
||||||
3 files changed, 28 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/api/leaks.js b/src/api/leaks.js
|
|
||||||
index 99f29c6..cd59dda 100644
|
|
||||||
--- a/src/api/leaks.js
|
|
||||||
+++ b/src/api/leaks.js
|
|
||||||
@@ -86,6 +86,8 @@ export function getRpmUnderCve(parameters) {
|
|
||||||
page: parameters.page,
|
|
||||||
per_page: parameters.per_page,
|
|
||||||
cve_id: parameters.cve_id,
|
|
||||||
+ hp_status: parameters.hp_status,
|
|
||||||
+ fixed: parameters.fixed,
|
|
||||||
available_rpm: parameters.available_rpm === null ? undefined : parameters.available_rpm,
|
|
||||||
installed_rpm: parameters.installed_rpm === null ? undefined : parameters.installed_rpm,
|
|
||||||
direction: parameters.direction
|
|
||||||
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
|
|
||||||
index 72b4703..47eed62 100644
|
|
||||||
--- a/src/views/leaks/components/CvesTable.vue
|
|
||||||
+++ b/src/views/leaks/components/CvesTable.vue
|
|
||||||
@@ -149,6 +149,7 @@
|
|
||||||
:locale="tablenodata"
|
|
||||||
:rowSelection="innerRowSelection"
|
|
||||||
:pagination="false">
|
|
||||||
+ <div slot="fixed_way" slot-scope="fixed_way, innerrecord">{{ getFixedWay(fixed_way, innerrecord) }}</div>
|
|
||||||
<a
|
|
||||||
slot="hosts"
|
|
||||||
slot-scope="hosts, innerrecord"
|
|
||||||
@@ -162,8 +163,10 @@
|
|
||||||
<host-in-cve-rpm
|
|
||||||
:visible="hostListUnderCveVisible"
|
|
||||||
@close="closeHostListUnderCve"
|
|
||||||
+ :fixed="fixed"
|
|
||||||
:propAvailablerpm="propAvailablerpm"
|
|
||||||
:propInstalledrpm="propInstalledrpm"
|
|
||||||
+ :hpStatus="hpStatus"
|
|
||||||
:cveId="hostListOfCveId" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -401,7 +404,8 @@ export default {
|
|
||||||
{
|
|
||||||
dataIndex: 'fixed_way',
|
|
||||||
key: 'fixed_way',
|
|
||||||
- title: '修复方式'
|
|
||||||
+ title: '修复方式',
|
|
||||||
+ scopedSlots: {customRender: 'fixed_way'}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
dataIndex: 'host_num',
|
|
||||||
@@ -421,7 +425,8 @@ export default {
|
|
||||||
{
|
|
||||||
dataIndex: 'fixed_way',
|
|
||||||
key: 'fixed_way',
|
|
||||||
- title: '修复方式'
|
|
||||||
+ title: '修复方式',
|
|
||||||
+ scopedSlots: {customRender: 'fixed_way'}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
},
|
|
||||||
@@ -495,6 +500,7 @@ export default {
|
|
||||||
searchKey: '',
|
|
||||||
innerCveList: [],
|
|
||||||
// 勾选二级列表rpm参数时传入的数据流
|
|
||||||
+ hpStatus: null,
|
|
||||||
propAvailablerpm: null,
|
|
||||||
propInstalledrpm: null,
|
|
||||||
propData: this.inputList,
|
|
||||||
@@ -531,12 +537,20 @@ export default {
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
+ getFixedWay(fixedWay, innerrecord) {
|
|
||||||
+ if (fixedWay === 'hotpatch') {
|
|
||||||
+ return fixedWay + ' (' + innerrecord.hp_status + ')'
|
|
||||||
+ } else {
|
|
||||||
+ return fixedWay
|
|
||||||
+ }
|
|
||||||
+ },
|
|
||||||
closeHostListUnderCve() {
|
|
||||||
this.hostListUnderCveVisible = false;
|
|
||||||
},
|
|
||||||
showHostListUnderCve(params, innerparams) {
|
|
||||||
this.hostListUnderCveVisible = true;
|
|
||||||
this.hostListOfCveId = params.cve_id;
|
|
||||||
+ this.hpStatus = innerparams.hp_status;
|
|
||||||
this.propAvailablerpm = innerparams.available_rpm
|
|
||||||
this.propInstalledrpm = innerparams.installed_rpm
|
|
||||||
},
|
|
||||||
diff --git a/src/views/leaks/components/HostInCveRpm.vue b/src/views/leaks/components/HostInCveRpm.vue
|
|
||||||
index 789e09f..d7c172d 100644
|
|
||||||
--- a/src/views/leaks/components/HostInCveRpm.vue
|
|
||||||
+++ b/src/views/leaks/components/HostInCveRpm.vue
|
|
||||||
@@ -29,6 +29,14 @@ export default {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
+ fixed: {
|
|
||||||
+ type: Boolean,
|
|
||||||
+ default: false
|
|
||||||
+ },
|
|
||||||
+ hpStatus: {
|
|
||||||
+ type: String,
|
|
||||||
+ default: null
|
|
||||||
+ },
|
|
||||||
propAvailablerpm: {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
@@ -71,6 +79,8 @@ export default {
|
|
||||||
page: 1,
|
|
||||||
per_page: 10,
|
|
||||||
cve_id: this.cveId,
|
|
||||||
+ fixed: this.fixed,
|
|
||||||
+ hp_status: this.hpStatus ? this.hpStatus : undefined,
|
|
||||||
available_rpm: this.propAvailablerpm,
|
|
||||||
installed_rpm: this.propInstalledrpm,
|
|
||||||
direction: 'asc'
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
|
|
||||||
@ -1,155 +0,0 @@
|
|||||||
From c8f6d03755791bea887cc915099344df1c16d19b Mon Sep 17 00:00:00 2001
|
|
||||||
From: wkl505997900 <2313665567@qq.com>
|
|
||||||
Date: Thu, 21 Sep 2023 14:33:45 +0800
|
|
||||||
Subject: [PATCH] fix an polling issue
|
|
||||||
|
|
||||||
---
|
|
||||||
src/views/leaks/HostLeakDetail.vue | 7 +++++++
|
|
||||||
src/views/leaks/LeakTaskDetail.vue | 21 +++++++++++++--------
|
|
||||||
src/views/leaks/LeakTaskList.vue | 7 +++++++
|
|
||||||
src/views/leaks/components/CvesTable.vue | 6 ------
|
|
||||||
src/views/leaks/components/HostTable.vue | 5 ++---
|
|
||||||
5 files changed, 29 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/views/leaks/HostLeakDetail.vue b/src/views/leaks/HostLeakDetail.vue
|
|
||||||
index 477df57..3327f80 100644
|
|
||||||
--- a/src/views/leaks/HostLeakDetail.vue
|
|
||||||
+++ b/src/views/leaks/HostLeakDetail.vue
|
|
||||||
@@ -257,6 +257,13 @@ export default {
|
|
||||||
mounted: function () {
|
|
||||||
this.getDetail();
|
|
||||||
this.getScanStatue();
|
|
||||||
+ },
|
|
||||||
+ beforeDestroy() {
|
|
||||||
+ // 离开页面前,若当前存在轮询,清除轮询
|
|
||||||
+ if (this.getScanStatusTimeout) {
|
|
||||||
+ clearInterval(this.getScanStatusTimeout);
|
|
||||||
+ this.getScanStatusTimeout = null;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
index 28b7272..f4c84c6 100644
|
|
||||||
--- a/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
+++ b/src/views/leaks/LeakTaskDetail.vue
|
|
||||||
@@ -285,6 +285,8 @@ export default {
|
|
||||||
expandedRowKeys: [],
|
|
||||||
rpmrecord: {},
|
|
||||||
propType: '',
|
|
||||||
+ // 轮询计时器
|
|
||||||
+ CveScanStatueTimeout: null,
|
|
||||||
progressUpdateCaller: null,
|
|
||||||
reportvisible: false,
|
|
||||||
runningCveIds: [],
|
|
||||||
@@ -544,6 +546,7 @@ export default {
|
|
||||||
updateProgress(taskList) {
|
|
||||||
const _this = this;
|
|
||||||
this.progressLoading = true;
|
|
||||||
+ clearTimeout(this.progressUpdateCaller);
|
|
||||||
getTaskProgress({taskList})
|
|
||||||
.then(function (res) {
|
|
||||||
_this.detail.statuses = res.data.result && res.data.result[_this.taskId];
|
|
||||||
@@ -628,6 +631,7 @@ export default {
|
|
||||||
updateCveProgress(taskId, cveList) {
|
|
||||||
const _this = this;
|
|
||||||
this.cveProgressIsLoading = true;
|
|
||||||
+ clearTimeout(this.CveScanStatueTimeout);
|
|
||||||
getCveProgressUnderCveTask({
|
|
||||||
taskId,
|
|
||||||
cveList
|
|
||||||
@@ -637,7 +641,7 @@ export default {
|
|
||||||
_this.runningCveIds = _this.getRunningCve(res.data.result);
|
|
||||||
_this.reportvisible = _this.getReportVisible(res.data.result);
|
|
||||||
if (_this.runningCveIds.length > 0) {
|
|
||||||
- setTimeout(function () {
|
|
||||||
+ _this.CveScanStatueTimeout = setTimeout(function () {
|
|
||||||
_this.updateCveProgress(taskId, cveList);
|
|
||||||
}, configs.taskProgressUpdateInterval);
|
|
||||||
} else {
|
|
||||||
@@ -860,16 +864,17 @@ export default {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
- beforeRouteLeave(to, from, next) {
|
|
||||||
- // 路由跳转前,清除轮询
|
|
||||||
- if (this.progressUpdateCaller) {
|
|
||||||
+ mounted: function () {
|
|
||||||
+ this.getInitalData();
|
|
||||||
+ },
|
|
||||||
+ beforeDestroy() {
|
|
||||||
+ // 离开页面前,若当前存在轮询,清除轮询
|
|
||||||
+ if (this.progressUpdateCaller || this.CveScanStatueTimeout) {
|
|
||||||
clearInterval(this.progressUpdateCaller);
|
|
||||||
+ clearInterval(this.CveScanStatueTimeout);
|
|
||||||
this.progressUpdateCaller = null;
|
|
||||||
+ this.CveScanStatueTimeout = null;
|
|
||||||
}
|
|
||||||
- next();
|
|
||||||
- },
|
|
||||||
- mounted: function () {
|
|
||||||
- this.getInitalData();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
diff --git a/src/views/leaks/LeakTaskList.vue b/src/views/leaks/LeakTaskList.vue
|
|
||||||
index 262fa42..df8869a 100644
|
|
||||||
--- a/src/views/leaks/LeakTaskList.vue
|
|
||||||
+++ b/src/views/leaks/LeakTaskList.vue
|
|
||||||
@@ -419,6 +419,13 @@ export default {
|
|
||||||
},
|
|
||||||
mounted: function () {
|
|
||||||
this.getTaskList();
|
|
||||||
+ },
|
|
||||||
+ beforeDestroy() {
|
|
||||||
+ // 离开页面前,若当前存在轮询,清除轮询
|
|
||||||
+ if (this.progressUpdateCaller) {
|
|
||||||
+ clearInterval(this.progressUpdateCaller);
|
|
||||||
+ this.progressUpdateCaller = null;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
|
|
||||||
index 47eed62..84e23fb 100644
|
|
||||||
--- a/src/views/leaks/components/CvesTable.vue
|
|
||||||
+++ b/src/views/leaks/components/CvesTable.vue
|
|
||||||
@@ -146,7 +146,6 @@
|
|
||||||
:row-key="innerrecord => fixed ? record.cve_id + innerrecord.installed_rpm : record.cve_id + innerrecord.available_rpm + innerrecord.installed_rpm"
|
|
||||||
:columns="fixed ? (standalone ? ainnerColumns : binnerColumns) : (standalone ? aloneinnerColumns : innerColumns)"
|
|
||||||
:data-source="record.rpms || []"
|
|
||||||
- :locale="tablenodata"
|
|
||||||
:rowSelection="innerRowSelection"
|
|
||||||
:pagination="false">
|
|
||||||
<div slot="fixed_way" slot-scope="fixed_way, innerrecord">{{ getFixedWay(fixed_way, innerrecord) }}</div>
|
|
||||||
@@ -491,11 +490,6 @@ export default {
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
- tablenodata: {emptyText: () => (
|
|
||||||
- <div><div>暂无可修复的rpm包, 可能原因为:</div>
|
|
||||||
- <div>1. 界面未刷新</div>
|
|
||||||
- <div>2. 冷补丁修复kernel后界面未重启</div></div>
|
|
||||||
- )},
|
|
||||||
selectedRows: [], // 选中行的row
|
|
||||||
searchKey: '',
|
|
||||||
innerCveList: [],
|
|
||||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
|
||||||
index 0302e0f..327a4a9 100644
|
|
||||||
--- a/src/views/leaks/components/HostTable.vue
|
|
||||||
+++ b/src/views/leaks/components/HostTable.vue
|
|
||||||
@@ -974,9 +974,8 @@ export default {
|
|
||||||
this.getRepoList();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
- beforeRouteLeave(to, from, next) {
|
|
||||||
- next();
|
|
||||||
- // 路由跳转前,清除轮询
|
|
||||||
+ beforeDestroy() {
|
|
||||||
+ // 离开页面前,若当前存在轮询,清除轮询
|
|
||||||
if (this.scanStatueAllTimeout) {
|
|
||||||
clearInterval(this.scanStatueAllTimeout);
|
|
||||||
this.scanStatueAllTimeout = null;
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
From e85c02c4300dcea0b0546c1a18b83a1c99f617d9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: wkl505997900 <2313665567@qq.com>
|
|
||||||
Date: Tue, 26 Sep 2023 10:27:14 +0800
|
|
||||||
Subject: [PATCH] fix issue
|
|
||||||
|
|
||||||
---
|
|
||||||
src/views/leaks/components/CvesTable.vue | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
|
|
||||||
index 84e23fb..24245d9 100644
|
|
||||||
--- a/src/views/leaks/components/CvesTable.vue
|
|
||||||
+++ b/src/views/leaks/components/CvesTable.vue
|
|
||||||
@@ -864,7 +864,7 @@ export default {
|
|
||||||
}
|
|
||||||
this.selectedRowsAll = getSelectedRow(this.selectedRowKeys, this.selectedRowsAll, this.standalone ? this.tableData : this.propData, 'cve_id');
|
|
||||||
} else {
|
|
||||||
- const index = target.rpms.findIndex(item => item.installed_rpm === record.installed_rpm)
|
|
||||||
+ const index = target.rpms.findIndex(item => item.installed_rpm === record.installed_rpm && item.available_rpm === record.available_rpm)
|
|
||||||
target.rpms.splice(index, 1)
|
|
||||||
if (target.rpms.length === 0) {
|
|
||||||
const dindex = this.innerCveList.findIndex(it => it.cve_id === record.cve_id)
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
|
|
||||||
@ -1,427 +0,0 @@
|
|||||||
From c5a59c0e103a711ce5377a24554ac7c79e2fae54 Mon Sep 17 00:00:00 2001
|
|
||||||
From: wkl505997900 <2313665567@qq.com>
|
|
||||||
Date: Tue, 17 Oct 2023 16:59:32 +0800
|
|
||||||
Subject: [PATCH] update code
|
|
||||||
|
|
||||||
---
|
|
||||||
src/api/assest.js | 3 +-
|
|
||||||
src/api/leaks.js | 1 -
|
|
||||||
src/views/assests/HostEdition.vue | 41 ++++++++++++++--
|
|
||||||
src/views/assests/components/EditableCell.vue | 5 +-
|
|
||||||
src/views/assests/components/addMoreHost.vue | 25 ++++++++--
|
|
||||||
.../components/CreateRepairTaskDrawer.vue | 3 --
|
|
||||||
src/views/leaks/components/CvesTable.vue | 48 ++++---------------
|
|
||||||
src/views/leaks/components/HostTable.vue | 5 +-
|
|
||||||
vue.config.js | 14 +++---
|
|
||||||
9 files changed, 81 insertions(+), 64 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/api/assest.js b/src/api/assest.js
|
|
||||||
index af1b125..69b12e2 100644
|
|
||||||
--- a/src/api/assest.js
|
|
||||||
+++ b/src/api/assest.js
|
|
||||||
@@ -124,7 +124,8 @@ export function addHost(parameter) {
|
|
||||||
ssh_port: parameter.ssh_port,
|
|
||||||
management: parameter.management,
|
|
||||||
ssh_user: parameter.ssh_user,
|
|
||||||
- password: parameter.password
|
|
||||||
+ password: parameter.password === undefined ? '' : parameter.password,
|
|
||||||
+ ssh_pkey: parameter.ssh_pkey === undefined ? '' : parameter.ssh_pkey
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
diff --git a/src/api/leaks.js b/src/api/leaks.js
|
|
||||||
index cd59dda..097d790 100644
|
|
||||||
--- a/src/api/leaks.js
|
|
||||||
+++ b/src/api/leaks.js
|
|
||||||
@@ -4,7 +4,6 @@
|
|
||||||
|
|
||||||
import request from '@/vendor/ant-design-pro/utils/request';
|
|
||||||
// import { getNotEmptyObjectOrNull } from '@/vendor/ant-design-pro/utils/util';
|
|
||||||
-
|
|
||||||
const api = {
|
|
||||||
getCveOverview: '/vulnerability/cve/overview',
|
|
||||||
getCveList: '/vulnerability/cve/list/get',
|
|
||||||
diff --git a/src/views/assests/HostEdition.vue b/src/views/assests/HostEdition.vue
|
|
||||||
index db6a7ee..de6253e 100644
|
|
||||||
--- a/src/views/assests/HostEdition.vue
|
|
||||||
+++ b/src/views/assests/HostEdition.vue
|
|
||||||
@@ -93,13 +93,39 @@
|
|
||||||
</a-tooltip>
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
- <a-form-item label="主机登录密码">
|
|
||||||
- <a-input-password
|
|
||||||
+ <a-form-item label="认证方式">
|
|
||||||
+ <a-radio-group name="identificationGroup" v-model="identificaWay" :default-value="1" @change="onChange">
|
|
||||||
+ <a-radio :value="1">
|
|
||||||
+ 主机登录密码
|
|
||||||
+ </a-radio>
|
|
||||||
+ <a-radio :value="2">
|
|
||||||
+ 主机登录公钥
|
|
||||||
+ </a-radio>
|
|
||||||
+ </a-radio-group>
|
|
||||||
+ </a-form-item>
|
|
||||||
+ <a-form-item>
|
|
||||||
+ <template v-slot:label>
|
|
||||||
+ <span v-if="identificaWay === 1">主机登录密码</span>
|
|
||||||
+ <span v-else>
|
|
||||||
+ <span>主机登录公钥</span>
|
|
||||||
+ <description-tips style="margin-left: 3px;margin-right: 1px;">
|
|
||||||
+ id_rsa.pub
|
|
||||||
+ </description-tips>
|
|
||||||
+ </span>
|
|
||||||
+ </template>
|
|
||||||
+ <a-input-password v-if="identificaWay === 1"
|
|
||||||
v-decorator="[
|
|
||||||
'password',
|
|
||||||
{rules: [{required: pageType === 'create' ? true : requiredRules, message: '请输入主机登录密码'}]}
|
|
||||||
]"
|
|
||||||
:placeholder="pageType === 'create' ? '请设置主机登录密码' : '请输入主机登录密码, 若未修改主机用户名或端口可以为空'"></a-input-password>
|
|
||||||
+ <a-input-password v-else
|
|
||||||
+ :maxLength="4096"
|
|
||||||
+ v-decorator="[
|
|
||||||
+ 'ssh_pkey',
|
|
||||||
+ {rules: [{required: pageType === 'create' ? true : requiredRules, message: '请输入主机登录公钥'}]}
|
|
||||||
+ ]"
|
|
||||||
+ :placeholder="pageType === 'create' ? '请设置主机登录公钥' : '请输入主机登录公钥, 若未修改主机用户名或端口可以为空'"></a-input-password>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item :wrapper-col="{span: 10, offset: 5}">
|
|
||||||
<a-button @click="handleCancel">取消</a-button>
|
|
||||||
@@ -133,10 +159,13 @@ import {PageHeaderWrapper} from '@ant-design-vue/pro-layout';
|
|
||||||
import AddHostGroupModal from './components/AddHostGroupModal';
|
|
||||||
|
|
||||||
import {hostGroupList, addHost, getHostDetail, editHost} from '@/api/assest';
|
|
||||||
+import DescriptionTips from '@/components/DescriptionTips';
|
|
||||||
+
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
PageHeaderWrapper,
|
|
||||||
- AddHostGroupModal
|
|
||||||
+ AddHostGroupModal,
|
|
||||||
+ DescriptionTips
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
@@ -148,7 +177,8 @@ export default {
|
|
||||||
form: this.$form.createForm(this),
|
|
||||||
submitLoading: false,
|
|
||||||
PortRequired: false,
|
|
||||||
- UserRequired: false
|
|
||||||
+ UserRequired: false,
|
|
||||||
+ identificaWay: 1 // 认证方式,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
@@ -194,6 +224,9 @@ export default {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
+ onChange(e) {
|
|
||||||
+ this.identificaWay = e.target.value;
|
|
||||||
+ },
|
|
||||||
handleUserChange(value) {
|
|
||||||
if (this.pageType === 'edit') {
|
|
||||||
value.target.value === this.basicHostInfo.ssh_user ? this.UserRequired = false : this.UserRequired = true
|
|
||||||
diff --git a/src/views/assests/components/EditableCell.vue b/src/views/assests/components/EditableCell.vue
|
|
||||||
index 282ba8c..28f0f62 100644
|
|
||||||
--- a/src/views/assests/components/EditableCell.vue
|
|
||||||
+++ b/src/views/assests/components/EditableCell.vue
|
|
||||||
@@ -8,7 +8,7 @@
|
|
||||||
<div v-if="editable" class="editable-cell-input-wrapper">
|
|
||||||
<a-form-model-item :prop="formkey">
|
|
||||||
<!-- 当formkey为密码时,使用密码框组件 -->
|
|
||||||
- <a-input-password v-if="formkey === 'password'" @change="handleChange" @pressEnter="check" v-model="form[formkey]" />
|
|
||||||
+ <a-input-password v-if="formkey === 'password' || formkey === 'ssh_pkey'" @change="handleChange" @pressEnter="check" v-model="form[formkey]" />
|
|
||||||
<a-input v-else @change="handleChange" @pressEnter="check" v-model="form[formkey]" />
|
|
||||||
<a-icon
|
|
||||||
style="top: -7px;"
|
|
||||||
@@ -21,7 +21,7 @@
|
|
||||||
<div v-else class="editable-cell-text-wrapper">
|
|
||||||
<div class="editable-content">
|
|
||||||
<!-- <a-input :type="formkey === 'password' ? 'password' : 'text'" v-model="value" /> -->
|
|
||||||
- <span v-if="formkey === 'password'">{{ countStar(form[formkey]) }}</span>
|
|
||||||
+ <span v-if="formkey === 'password' || formkey === 'ssh_pkey'">{{ countStar(form[formkey]) }}</span>
|
|
||||||
<span v-else>{{ value || ' ' }}</span>
|
|
||||||
</div>
|
|
||||||
<a-icon type="edit" class="editable-cell-icon" @click="edit" />
|
|
||||||
@@ -97,6 +97,7 @@ export default {
|
|
||||||
ssh_port: [{required: true, message: '请输入端口'}, {validator: checkSSHPort}],
|
|
||||||
ssh_user: [{ validator: validateUser, trigger: 'change' }],
|
|
||||||
password: [{ required: true, message: 'password不能为空', trigger: 'change' }],
|
|
||||||
+ ssh_pkey: [{ required: true, message: 'ssh_pkey不能为空', trigger: 'change' }],
|
|
||||||
host_name: [{ validator: checkNameInput, trigger: 'change' }],
|
|
||||||
host_group_name: [{ required: true, message: 'host_group_name不能为空', trigger: 'change' }],
|
|
||||||
management: [{ validator: checkmanagement, trigger: 'change' }]
|
|
||||||
diff --git a/src/views/assests/components/addMoreHost.vue b/src/views/assests/components/addMoreHost.vue
|
|
||||||
index 055f1b9..818ffa6 100644
|
|
||||||
--- a/src/views/assests/components/addMoreHost.vue
|
|
||||||
+++ b/src/views/assests/components/addMoreHost.vue
|
|
||||||
@@ -1,7 +1,7 @@
|
|
||||||
<template>
|
|
||||||
<div @click="showModal">
|
|
||||||
<a-button type="primary">批量添加主机</a-button>
|
|
||||||
- <a-modal title="添加主机" :visible="visible" :footer="null" @cancel="closeModal" width="1468px">
|
|
||||||
+ <a-modal title="添加主机" :visible="visible" :footer="null" @cancel="closeModal" width="1668px">
|
|
||||||
<div class="upload_head">
|
|
||||||
<a-upload :file-list="fileDataList" :remove="removeFile" :before-upload="preUpload">
|
|
||||||
<div style="display:flex;">
|
|
||||||
@@ -63,6 +63,15 @@
|
|
||||||
@allowSub="allowSub()"
|
|
||||||
@change="onCellChange(record.key, 'password', $event)" />
|
|
||||||
</template>
|
|
||||||
+ <template slot="ssh_pkey" slot-scope="text, record">
|
|
||||||
+ <editable-cell
|
|
||||||
+ ref="ssh_pkey"
|
|
||||||
+ formkey="ssh_pkey"
|
|
||||||
+ :text="String(text)"
|
|
||||||
+ @unSubmit="unSubmit()"
|
|
||||||
+ @allowSub="allowSub()"
|
|
||||||
+ @change="onCellChange(record.key, 'ssh_pkey', $event)" />
|
|
||||||
+ </template>
|
|
||||||
<template slot="host_name" slot-scope="text, record">
|
|
||||||
<editable-cell
|
|
||||||
ref="host_name"
|
|
||||||
@@ -144,7 +153,7 @@ export default {
|
|
||||||
dataAllow: true,
|
|
||||||
count: '',
|
|
||||||
rowKey: 'ip',
|
|
||||||
- colList: ['host_ip', 'ssh_port', 'ssh_user', 'password', 'host_name', 'host_group_name', 'management'],
|
|
||||||
+ colList: ['host_ip', 'ssh_port', 'ssh_user', 'password', 'ssh_pkey', 'host_name', 'host_group_name', 'management'],
|
|
||||||
tableVis: false,
|
|
||||||
fileDataList: [],
|
|
||||||
visible: false,
|
|
||||||
@@ -157,6 +166,7 @@ export default {
|
|
||||||
ssh_port: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}],
|
|
||||||
ssh_user: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}],
|
|
||||||
password: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}],
|
|
||||||
+ ssh_pkey: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}],
|
|
||||||
host_name: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}],
|
|
||||||
host_group_name: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}],
|
|
||||||
management: [{required: true, message: 'Please select Activity zone', trigger: 'blur'}]
|
|
||||||
@@ -201,6 +211,13 @@ export default {
|
|
||||||
title: '登录密码',
|
|
||||||
scopedSlots: {customRender: 'password'}
|
|
||||||
},
|
|
||||||
+ {
|
|
||||||
+ dataIndex: 'ssh_pkey',
|
|
||||||
+ width: 200,
|
|
||||||
+ key: 'ssh_pkey',
|
|
||||||
+ title: '登录密钥',
|
|
||||||
+ scopedSlots: {customRender: 'ssh_pkey'}
|
|
||||||
+ },
|
|
||||||
{
|
|
||||||
dataIndex: 'host_name',
|
|
||||||
width: 150,
|
|
||||||
@@ -260,6 +277,7 @@ export default {
|
|
||||||
ssh_port: '',
|
|
||||||
ssh_user: '',
|
|
||||||
password: '',
|
|
||||||
+ ssh_pkey: '',
|
|
||||||
host_name: '',
|
|
||||||
host_group_name: '',
|
|
||||||
management: '',
|
|
||||||
@@ -332,7 +350,7 @@ export default {
|
|
||||||
const result = XLSX.utils.sheet_to_json(worksheet); // 将数据json数据格式
|
|
||||||
result.forEach((item) => {
|
|
||||||
const arr = Object.keys(item)
|
|
||||||
- if (!arr.includes('host_ip') || !arr.includes('ssh_port') || !arr.includes('ssh_user') || !arr.includes('password') || !arr.includes('host_name') || !arr.includes('host_group_name') || !arr.includes('management')) {
|
|
||||||
+ if (!arr.includes('host_ip') || !arr.includes('ssh_port') || !arr.includes('ssh_user') || !arr.includes('password') || !arr.includes('ssh_pkey') || !arr.includes('host_name') || !arr.includes('host_group_name') || !arr.includes('management')) {
|
|
||||||
this.removeFile(file);
|
|
||||||
this.dataAllow = false;
|
|
||||||
}
|
|
||||||
@@ -368,6 +386,7 @@ export default {
|
|
||||||
this.$set(item, 'host_name', String(item.host_name))
|
|
||||||
item.management = Boolean(item.management)
|
|
||||||
item.password = String(item.password)
|
|
||||||
+ item.ssh_pkey = String(item.ssh_pkey)
|
|
||||||
delete item.key;
|
|
||||||
delete item.editable;
|
|
||||||
delete item.result;
|
|
||||||
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
index 746edaa..3883e1e 100644
|
|
||||||
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
|
||||||
@@ -440,9 +440,6 @@ export default {
|
|
||||||
watch: {},
|
|
||||||
created() {
|
|
||||||
},
|
|
||||||
- beforeDestroy() {
|
|
||||||
- this.$emit('createSuccess');
|
|
||||||
- },
|
|
||||||
methods: {
|
|
||||||
jumpToPage() {
|
|
||||||
clearTimeout(this.jumpModalInterval);
|
|
||||||
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
|
|
||||||
index 24245d9..d12931e 100644
|
|
||||||
--- a/src/views/leaks/components/CvesTable.vue
|
|
||||||
+++ b/src/views/leaks/components/CvesTable.vue
|
|
||||||
@@ -38,11 +38,6 @@
|
|
||||||
</a-col>
|
|
||||||
<a-col>
|
|
||||||
<a-row type="flex" :gutter="6">
|
|
||||||
- <!-- <a-col>
|
|
||||||
- <status-change-modal
|
|
||||||
- :selectedRowsAll="selectedRowsAll"
|
|
||||||
- @statusUpdated="handleStatusUpdated" />
|
|
||||||
- </a-col> -->
|
|
||||||
<a-col>
|
|
||||||
<upload-file v-if="standalone ? true : false" @addSuccess="handleUploadSuccess" />
|
|
||||||
</a-col>
|
|
||||||
@@ -794,7 +789,7 @@ export default {
|
|
||||||
const result = this.innerCveList.some(item => item.cve_id === id)
|
|
||||||
if (result) {
|
|
||||||
const target = this.innerCveList.find(item => item.cve_id === id)
|
|
||||||
- const index = target.rpms.findIndex(item => item.installed_rpm === val.installed_rpm)
|
|
||||||
+ const index = target.rpms.findIndex(item => item.installed_rpm === val.installed_rpm && item.available_rpm === val.available_rpm)
|
|
||||||
target.rpms.splice(index, 1)
|
|
||||||
if (target.rpms.length === 0) {
|
|
||||||
const dindex = this.innerCveList.findIndex(it => it.cve_id === id)
|
|
||||||
@@ -1056,7 +1051,7 @@ export default {
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
- getCveList({
|
|
||||||
+ return getCveList({
|
|
||||||
tableInfo: {
|
|
||||||
pagination: {
|
|
||||||
current: pagination.current,
|
|
||||||
@@ -1142,32 +1137,6 @@ export default {
|
|
||||||
handleTaskCreateSuccess() {
|
|
||||||
this.handleRefresh();
|
|
||||||
},
|
|
||||||
- handleScanAll() {},
|
|
||||||
- handleStatusUpdated() {
|
|
||||||
- this.selectedRowKeys = [];
|
|
||||||
- this.selectedRowsAll = [];
|
|
||||||
- if (this.standalone) {
|
|
||||||
- this.handleRefresh();
|
|
||||||
- } else {
|
|
||||||
- const pagination = this.pagination || {};
|
|
||||||
- const filters = this.filters || {};
|
|
||||||
- const sorter = this.sorter || {};
|
|
||||||
- this.$emit('statusUpdated', {
|
|
||||||
- tableInfo: {
|
|
||||||
- pagination: {
|
|
||||||
- current: pagination.current,
|
|
||||||
- pageSize: pagination.pageSize
|
|
||||||
- },
|
|
||||||
- filters: filters,
|
|
||||||
- sorter: {
|
|
||||||
- field: sorter.field,
|
|
||||||
- order: sorter.order
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- });
|
|
||||||
- }
|
|
||||||
- },
|
|
||||||
- uploadfile() {},
|
|
||||||
handleUploadSuccess() {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.getCvesAll();
|
|
||||||
@@ -1175,16 +1144,15 @@ export default {
|
|
||||||
this.getCves();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
- beforeRouteLeave(to, from, next) {
|
|
||||||
- // 路由跳转前,清除轮询
|
|
||||||
- next();
|
|
||||||
+ beforeDestroy() {
|
|
||||||
this.innerCveList = []
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
- setTimeout(() => {
|
|
||||||
- this.getCvesAll();
|
|
||||||
- }, 500);
|
|
||||||
- this.getCves();
|
|
||||||
+ this.getCves().then(
|
|
||||||
+ () => {
|
|
||||||
+ this.getCvesAll();
|
|
||||||
+ }
|
|
||||||
+ );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
|
||||||
index 327a4a9..63dc4f2 100644
|
|
||||||
--- a/src/views/leaks/components/HostTable.vue
|
|
||||||
+++ b/src/views/leaks/components/HostTable.vue
|
|
||||||
@@ -962,14 +962,13 @@ export default {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
- mounted() {
|
|
||||||
- this.getHostList();
|
|
||||||
+ mounted: function () {
|
|
||||||
this.getHostGroup();
|
|
||||||
if (this.standalone) {
|
|
||||||
// 主机列表页面中要自行获取全量主机和扫描状态
|
|
||||||
this.getScanStatusAll([]);
|
|
||||||
- this.getHostListAll();
|
|
||||||
} else {
|
|
||||||
+ this.getHostList();
|
|
||||||
// 主机详情页面中要自行获取repo列表
|
|
||||||
this.getRepoList();
|
|
||||||
}
|
|
||||||
diff --git a/vue.config.js b/vue.config.js
|
|
||||||
index 3fdb052..a93ea29 100644
|
|
||||||
--- a/vue.config.js
|
|
||||||
+++ b/vue.config.js
|
|
||||||
@@ -27,8 +27,8 @@ function getGitHash() {
|
|
||||||
const serverMap = {
|
|
||||||
serverIpBase: 'http://127.0.0.1',
|
|
||||||
serveiIp1: 'http://172.168.115.178',
|
|
||||||
- serveiIp2: 'http://172.168.235.132',
|
|
||||||
- serveiIp3: 'http://172.168.121.194'
|
|
||||||
+ serveiIp2: 'http://172.168.97.229',
|
|
||||||
+ serveiIp3: 'http://172.168.240.235'
|
|
||||||
}
|
|
||||||
|
|
||||||
// vue.config.js
|
|
||||||
@@ -138,7 +138,7 @@ const vueConfig = {
|
|
||||||
},
|
|
||||||
'/api/diag': {
|
|
||||||
// target: serverMap.serverIpBase + ':11113',
|
|
||||||
- target: serverMap.serveiIp3 + ':11113',
|
|
||||||
+ target: serverMap.serveiIp2 + ':11113',
|
|
||||||
ws: false,
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
@@ -147,7 +147,7 @@ const vueConfig = {
|
|
||||||
},
|
|
||||||
'/api/check': {
|
|
||||||
// target: serverMap.serverIpBase + ':11112',
|
|
||||||
- target: serverMap.serveiIp3 + ':11112',
|
|
||||||
+ target: serverMap.serveiIp2 + ':11112',
|
|
||||||
ws: false,
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
@@ -156,7 +156,7 @@ const vueConfig = {
|
|
||||||
},
|
|
||||||
'/api/vulnerability': {
|
|
||||||
// target: serverMap.serverIpBase + ':11116',
|
|
||||||
- target: serverMap.serveiIp3 + ':11116',
|
|
||||||
+ target: serverMap.serveiIp2 + ':11116',
|
|
||||||
ws: false,
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
@@ -165,7 +165,7 @@ const vueConfig = {
|
|
||||||
},
|
|
||||||
'/api/gala-spider': {
|
|
||||||
// target: serverMap.serverIpBase + ':11115',
|
|
||||||
- target: serverMap.serveiIp3 + ':11115',
|
|
||||||
+ target: serverMap.serveiIp2 + ':11115',
|
|
||||||
ws: false,
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
@@ -174,7 +174,7 @@ const vueConfig = {
|
|
||||||
},
|
|
||||||
'/api': {
|
|
||||||
// target: serverMap.serverIpBase + ':11111',
|
|
||||||
- target: serverMap.serveiIp3 + ':11111',
|
|
||||||
+ target: serverMap.serveiIp2 + ':11111',
|
|
||||||
ws: false,
|
|
||||||
changeOrigin: true,
|
|
||||||
pathRewrite: {
|
|
||||||
--
|
|
||||||
Gitee
|
|
||||||
|
|
||||||
Binary file not shown.
BIN
aops-hermes-v1.3.4.tar.gz
Normal file
BIN
aops-hermes-v1.3.4.tar.gz
Normal file
Binary file not shown.
@ -1,18 +1,13 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
|
|
||||||
Name: aops-hermes
|
Name: aops-hermes
|
||||||
Version: v1.3.3
|
Version: v1.3.4
|
||||||
Release: 4
|
Release: 1
|
||||||
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}
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
Source1: node_modules.tar.gz
|
Source1: node_modules.tar.gz
|
||||||
Patch0001: 0001-Resolve-upload-and-pagination-issues.patch
|
|
||||||
Patch0002: 0002-Change-params-under-rpms-host.patch
|
|
||||||
Patch0003: 0003-Solving-the-query-problem-of-leaving-the-page-polling-interface.patch
|
|
||||||
Patch0004: 0004-Solving-the-problem-of-cve-fix-params.patch
|
|
||||||
Patch0005: 0005-Add-login-key-to-asset-management-module.patch
|
|
||||||
|
|
||||||
|
|
||||||
BuildRequires: nodejs node-gyp nodejs-yarn
|
BuildRequires: nodejs node-gyp nodejs-yarn
|
||||||
@ -24,7 +19,7 @@ Web for an intelligent diagnose frame
|
|||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{name}-%{version} -p1
|
%autosetup -n %{name}-%{version}
|
||||||
%setup -T -D -a 1
|
%setup -T -D -a 1
|
||||||
|
|
||||||
|
|
||||||
@ -49,6 +44,9 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 14 2023 wangkunlong<505997900@qq.com> - v1.3.4-1
|
||||||
|
- Update the master branch code to the 1.3.4
|
||||||
|
|
||||||
* Wed Oct 18 2023 wangkunlong<505997900@qq.com> - v1.3.3-4
|
* Wed Oct 18 2023 wangkunlong<505997900@qq.com> - v1.3.3-4
|
||||||
- Update the master branch code to the latest version
|
- Update the master branch code to the latest version
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user