update 20.03 SP4 code
This commit is contained in:
parent
fbd189dcb0
commit
d1d1cf858d
@ -0,0 +1,155 @@
|
||||
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
|
||||
|
||||
25
0004-Solving-the-problem-of-cve-fix-params.patch
Normal file
25
0004-Solving-the-problem-of-cve-fix-params.patch
Normal file
@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
427
0005-Add-login-key-to-asset-management-module.patch
Normal file
427
0005-Add-login-key-to-asset-management-module.patch
Normal file
@ -0,0 +1,427 @@
|
||||
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
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
From 1d3c9795889773616ef2f5216512b03d8a95593a Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Wed, 18 Oct 2023 19:14:57 +0800
|
||||
Subject: [PATCH] Temporarily hide the plugin and fingerprint waveform bar
|
||||
|
||||
---
|
||||
src/views/assests/HostDetail.vue | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/views/assests/HostDetail.vue b/src/views/assests/HostDetail.vue
|
||||
index a093972..d651318 100644
|
||||
--- a/src/views/assests/HostDetail.vue
|
||||
+++ b/src/views/assests/HostDetail.vue
|
||||
@@ -11,14 +11,14 @@
|
||||
</HostBasicInfo>
|
||||
</a-card>
|
||||
</a-tab-pane>
|
||||
- <a-tab-pane key="2" tab="插件">
|
||||
+ <!-- <a-tab-pane key="2" tab="插件">
|
||||
<a-card class="aops-theme">
|
||||
<HostPluginInfo :scene="scene" @reFetchHostInfo="reFetchHostInfo"></HostPluginInfo>
|
||||
</a-card>
|
||||
- </a-tab-pane>
|
||||
+ </a-tab-pane> -->
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
- <HostChartInfo :queryIp="basicHostInfo.host_ip" v-if="basicHostInfo.host_ip" />
|
||||
+ <!-- <HostChartInfo :queryIp="basicHostInfo.host_ip" v-if="basicHostInfo.host_ip" /> -->
|
||||
</page-header-wrapper>
|
||||
</template>
|
||||
|
||||
--
|
||||
Gitee
|
||||
|
||||
99
0007-Fix-five-issues.patch
Normal file
99
0007-Fix-five-issues.patch
Normal file
@ -0,0 +1,99 @@
|
||||
From 8719f563108c3f82edebf7f0c8b1f947f878f842 Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Fri, 20 Oct 2023 21:15:29 +0800
|
||||
Subject: [PATCH] fix bug
|
||||
|
||||
---
|
||||
src/api/assest.js | 3 ++-
|
||||
src/views/assests/HostEdition.vue | 16 ++++++++--------
|
||||
src/views/leaks/components/HostTable.vue | 2 +-
|
||||
3 files changed, 11 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/api/assest.js b/src/api/assest.js
|
||||
index 69b12e2..095a943 100644
|
||||
--- a/src/api/assest.js
|
||||
+++ b/src/api/assest.js
|
||||
@@ -142,7 +142,8 @@ export function editHost(parameter, id) {
|
||||
ssh_port: parameter.ssh_port,
|
||||
management: parameter.management,
|
||||
ssh_user: parameter.ssh_user,
|
||||
- password: parameter.password
|
||||
+ password: parameter.password,
|
||||
+ ssh_pkey: parameter.ssh_pkey
|
||||
}
|
||||
});
|
||||
}
|
||||
diff --git a/src/views/assests/HostEdition.vue b/src/views/assests/HostEdition.vue
|
||||
index de6253e..962c2d1 100644
|
||||
--- a/src/views/assests/HostEdition.vue
|
||||
+++ b/src/views/assests/HostEdition.vue
|
||||
@@ -99,7 +99,7 @@
|
||||
主机登录密码
|
||||
</a-radio>
|
||||
<a-radio :value="2">
|
||||
- 主机登录公钥
|
||||
+ 主机登录密钥
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
@@ -107,9 +107,9 @@
|
||||
<template v-slot:label>
|
||||
<span v-if="identificaWay === 1">主机登录密码</span>
|
||||
<span v-else>
|
||||
- <span>主机登录公钥</span>
|
||||
+ <span>主机登录密钥</span>
|
||||
<description-tips style="margin-left: 3px;margin-right: 1px;">
|
||||
- id_rsa.pub
|
||||
+ id_rsa
|
||||
</description-tips>
|
||||
</span>
|
||||
</template>
|
||||
@@ -119,13 +119,13 @@
|
||||
{rules: [{required: pageType === 'create' ? true : requiredRules, message: '请输入主机登录密码'}]}
|
||||
]"
|
||||
:placeholder="pageType === 'create' ? '请设置主机登录密码' : '请输入主机登录密码, 若未修改主机用户名或端口可以为空'"></a-input-password>
|
||||
- <a-input-password v-else
|
||||
+ <a-textarea :rows="4" v-else
|
||||
:maxLength="4096"
|
||||
v-decorator="[
|
||||
'ssh_pkey',
|
||||
- {rules: [{required: pageType === 'create' ? true : requiredRules, message: '请输入主机登录公钥'}]}
|
||||
+ {rules: [{required: pageType === 'create' ? true : requiredRules, message: '请输入主机登录密钥'}]}
|
||||
]"
|
||||
- :placeholder="pageType === 'create' ? '请设置主机登录公钥' : '请输入主机登录公钥, 若未修改主机用户名或端口可以为空'"></a-input-password>
|
||||
+ :placeholder="pageType === 'create' ? '请设置主机登录密钥' : '请输入主机登录密钥, 若未修改主机用户名或端口可以为空'"></a-textarea>
|
||||
</a-form-item>
|
||||
<a-form-item :wrapper-col="{span: 10, offset: 5}">
|
||||
<a-button @click="handleCancel">取消</a-button>
|
||||
@@ -271,9 +271,9 @@ export default {
|
||||
if (tableParams[key] === this.basicHostInfo[key]) {
|
||||
delete tableParams[key] // 删除未修改数据
|
||||
}
|
||||
- if (key === 'password') {
|
||||
+ if (key === 'password' || key === 'ssh_pkey') {
|
||||
if (tableParams[key].length === 0) {
|
||||
- delete tableParams[key] // password为空不传
|
||||
+ delete tableParams[key] // password或密钥为空不传
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
||||
index 63dc4f2..950097f 100644
|
||||
--- a/src/views/leaks/components/HostTable.vue
|
||||
+++ b/src/views/leaks/components/HostTable.vue
|
||||
@@ -964,11 +964,11 @@ export default {
|
||||
},
|
||||
mounted: function () {
|
||||
this.getHostGroup();
|
||||
+ this.getHostList();
|
||||
if (this.standalone) {
|
||||
// 主机列表页面中要自行获取全量主机和扫描状态
|
||||
this.getScanStatusAll([]);
|
||||
} else {
|
||||
- this.getHostList();
|
||||
// 主机详情页面中要自行获取repo列表
|
||||
this.getRepoList();
|
||||
}
|
||||
--
|
||||
Gitee
|
||||
|
||||
98
0008-Fix-issues-with-polling-and-refreshing-displays.patch
Normal file
98
0008-Fix-issues-with-polling-and-refreshing-displays.patch
Normal file
@ -0,0 +1,98 @@
|
||||
From 60cc53b9c422f7000747cd842e7ea1503fbe7f9d Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Mon, 23 Oct 2023 15:13:56 +0800
|
||||
Subject: [PATCH] fix two issue
|
||||
|
||||
---
|
||||
src/views/leaks/LeakTaskDetail.vue | 20 ++++++++++++++++----
|
||||
src/views/leaks/components/CvesTable.vue | 1 +
|
||||
2 files changed, 17 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/views/leaks/LeakTaskDetail.vue b/src/views/leaks/LeakTaskDetail.vue
|
||||
index f4c84c6..cbb3369 100644
|
||||
--- a/src/views/leaks/LeakTaskDetail.vue
|
||||
+++ b/src/views/leaks/LeakTaskDetail.vue
|
||||
@@ -286,12 +286,13 @@ export default {
|
||||
rpmrecord: {},
|
||||
propType: '',
|
||||
// 轮询计时器
|
||||
+ repoInfoTimeout: null,
|
||||
CveScanStatueTimeout: null,
|
||||
progressUpdateCaller: null,
|
||||
reportvisible: false,
|
||||
runningCveIds: [],
|
||||
timer: '',
|
||||
- taskId: this.$route.params.taskId,
|
||||
+ taskId: '',
|
||||
taskType: this.$route.params.taskType,
|
||||
detail: {statuses: {}},
|
||||
infoLoading: false,
|
||||
@@ -476,7 +477,7 @@ export default {
|
||||
const _this = this
|
||||
const Params = {
|
||||
cve_id: record.cve_id,
|
||||
- task_id: this.$route.query.task_id
|
||||
+ task_id: this.taskId
|
||||
}
|
||||
getCvefixLeakRpm(Params)
|
||||
.then(function (res) {
|
||||
@@ -688,6 +689,7 @@ export default {
|
||||
this.tableIsLoading = true;
|
||||
const pagination = this.pagination || {};
|
||||
const filters = this.filters || {};
|
||||
+ clearTimeout(this.repoInfoTimeout);
|
||||
getHostUnderRepoTask({
|
||||
taskId: this.taskId,
|
||||
tableInfo: {
|
||||
@@ -712,7 +714,7 @@ export default {
|
||||
};
|
||||
_this.reportvisible = !_this.hostRepostatusCheck(res.data.result);
|
||||
if (_this.hostRepostatusCheck(res.data.result)) {
|
||||
- setTimeout(function () {
|
||||
+ _this.repoInfoTimeout = setTimeout(function () {
|
||||
_this.getHostList();
|
||||
}, configs.taskProgressUpdateInterval);
|
||||
}
|
||||
@@ -864,16 +866,26 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
+ created() {
|
||||
+ // 防止页面刷新后query参数丢失,将任务ID存储在内存中
|
||||
+ if (localStorage.getItem('taskId')) {
|
||||
+ this.taskId = localStorage.getItem('taskId')
|
||||
+ }
|
||||
+ this.taskId = this.$route.params.taskId || this.taskId
|
||||
+ localStorage.setItem('taskId', this.taskId)
|
||||
+ },
|
||||
mounted: function () {
|
||||
this.getInitalData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 离开页面前,若当前存在轮询,清除轮询
|
||||
- if (this.progressUpdateCaller || this.CveScanStatueTimeout) {
|
||||
+ if (this.progressUpdateCaller || this.CveScanStatueTimeout || this.repoInfoTimeout) {
|
||||
clearInterval(this.progressUpdateCaller);
|
||||
clearInterval(this.CveScanStatueTimeout);
|
||||
+ clearInterval(this.repoInfoTimeout);
|
||||
this.progressUpdateCaller = null;
|
||||
this.CveScanStatueTimeout = null;
|
||||
+ this.repoInfoTimeout = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
|
||||
index d12931e..a49aaa3 100644
|
||||
--- a/src/views/leaks/components/CvesTable.vue
|
||||
+++ b/src/views/leaks/components/CvesTable.vue
|
||||
@@ -1022,6 +1022,7 @@ export default {
|
||||
this.expandedRowKeys = [];
|
||||
this.selectedRowKeys = [];
|
||||
this.selectedRowsAll = [];
|
||||
+ this.innerselectedRowKeys = [];
|
||||
this.innerCveList = [];
|
||||
this.getCves();
|
||||
},
|
||||
--
|
||||
Gitee
|
||||
|
||||
28
0009-Correction-of-copyright-information.patch
Normal file
28
0009-Correction-of-copyright-information.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 85d60738d27f7f9367d8f025c23b5847a0b9f410 Mon Sep 17 00:00:00 2001
|
||||
From: zhangdaolong <dlzhangak@isoftstone.com>
|
||||
Date: Thu, 12 Oct 2023 10:31:13 +0800
|
||||
Subject: [PATCH] Correction of copyright information
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
src/vendor/ant-design-pro/components/GlobalFooter/index.vue | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/vendor/ant-design-pro/components/GlobalFooter/index.vue b/src/vendor/ant-design-pro/components/GlobalFooter/index.vue
|
||||
index 0296066..1b86a61 100644
|
||||
--- a/src/vendor/ant-design-pro/components/GlobalFooter/index.vue
|
||||
+++ b/src/vendor/ant-design-pro/components/GlobalFooter/index.vue
|
||||
@@ -7,7 +7,7 @@
|
||||
<a href="" target="_blank">关于我们</a> -->
|
||||
</div>
|
||||
<div>
|
||||
- 版权所有 ©华为技术有限公司 1998-2023。 保留一切权利。 粤A2-20044005号
|
||||
+ 版权所有 © 2023 openEuler 保留一切权利
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:copyright>
|
||||
--
|
||||
Gitee
|
||||
|
||||
42
0010-Optimize-host-scanning-polling-logic.patch
Normal file
42
0010-Optimize-host-scanning-polling-logic.patch
Normal file
@ -0,0 +1,42 @@
|
||||
From 3f268e2aecd9e56e5328367230c38029161b9c4f Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Tue, 24 Oct 2023 16:40:52 +0800
|
||||
Subject: [PATCH] update hostable
|
||||
|
||||
---
|
||||
src/views/leaks/components/HostTable.vue | 16 ++++++++++++----
|
||||
1 file changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
||||
index 950097f..35c7882 100644
|
||||
--- a/src/views/leaks/components/HostTable.vue
|
||||
+++ b/src/views/leaks/components/HostTable.vue
|
||||
@@ -745,13 +745,21 @@ export default {
|
||||
_this.scanStatusData = res.data.result || {};
|
||||
if (_this.standalone) {
|
||||
_this.scanningHostIds = _this.getScanningHostAll(res.data.result);
|
||||
+ // 第一次判断是否有正在扫描的主机
|
||||
if (_this.scanningHostIds.length > 0) {
|
||||
- _this.scanStatueAllTimeout = setTimeout(function () {
|
||||
- _this.getScanStatusAll(_this.scanningHostIds);
|
||||
- }, configs.scanProgressInterval);
|
||||
+ if (_this.scanningHostIds.length > 0) {
|
||||
+ // 第二次判断是否进入轮询查询扫描状态
|
||||
+ _this.scanStatueAllTimeout = setTimeout(function () {
|
||||
+ _this.getScanStatusAll(_this.scanningHostIds);
|
||||
+ }, configs.scanProgressInterval);
|
||||
+ } else {
|
||||
+ // 扫描结束后刷新界面
|
||||
+ _this.handleRefresh();
|
||||
+ _this.scanStatusloading = false;
|
||||
+ }
|
||||
} else {
|
||||
+ // 第一次判断是否有正在扫描的主机,若没有则退出查询
|
||||
_this.scanStatusloading = false;
|
||||
- _this.handleRefresh();
|
||||
}
|
||||
}
|
||||
})
|
||||
--
|
||||
Gitee
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
From 02352bf00edbf61e4fbce90cef4c7ffc54588859 Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Thu, 26 Oct 2023 11:40:44 +0800
|
||||
Subject: [PATCH 1/2] add panduan
|
||||
|
||||
---
|
||||
.../leaks/components/CreateRepairTaskDrawer.vue | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/views/leaks/components/CreateRepairTaskDrawer.vue b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
||||
index 3883e1e..c68dc21 100644
|
||||
--- a/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
||||
+++ b/src/views/leaks/components/CreateRepairTaskDrawer.vue
|
||||
@@ -519,9 +519,9 @@ export default {
|
||||
|
||||
const _this = this;
|
||||
if (this.taskType === 'cve fix') {
|
||||
- // if (this.cveLiIsEmpty()) {
|
||||
- // return;
|
||||
- // }
|
||||
+ if (this.cveLiIsEmpty()) {
|
||||
+ return;
|
||||
+ }
|
||||
if (this.innerCveList.length !== 0) {
|
||||
const cveListparam = this.cveList.map((cve) => {
|
||||
return {
|
||||
@@ -627,6 +627,9 @@ export default {
|
||||
|
||||
if (this.taskType === 'cve rollback') {
|
||||
// 根据主机数据获取类型,自行或cve下的主机数据或者使用外部输入的主机数据更行talbe数据
|
||||
+ if (this.cveLiIsEmpty()) {
|
||||
+ return;
|
||||
+ }
|
||||
if (this.innerCveList.length !== 0) {
|
||||
const cveListparam = this.cveList.map((cve) => {
|
||||
return {
|
||||
@@ -663,9 +666,6 @@ export default {
|
||||
case hostListTypes[0]:
|
||||
// hostListType为byLoading
|
||||
_this.hostUnderCveLoading = true;
|
||||
- // if (this.cveLiIsEmpty()) {
|
||||
- // return;
|
||||
- // }
|
||||
getHostUnderMultipleCVE(this.fixParams)
|
||||
.then(function (res) {
|
||||
// hostlists are contained in cveMap
|
||||
--
|
||||
Gitee
|
||||
|
||||
|
||||
From 9518fc1099383331f66398b87fda20867d8c2f8f Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Thu, 26 Oct 2023 12:03:21 +0800
|
||||
Subject: [PATCH 2/2] sdsd
|
||||
|
||||
---
|
||||
src/views/leaks/components/HostTable.vue | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/views/leaks/components/HostTable.vue b/src/views/leaks/components/HostTable.vue
|
||||
index 35c7882..bd4ec4c 100644
|
||||
--- a/src/views/leaks/components/HostTable.vue
|
||||
+++ b/src/views/leaks/components/HostTable.vue
|
||||
@@ -759,6 +759,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
// 第一次判断是否有正在扫描的主机,若没有则退出查询
|
||||
+ _this.getHostListAll();
|
||||
_this.scanStatusloading = false;
|
||||
}
|
||||
}
|
||||
--
|
||||
Gitee
|
||||
|
||||
278
0012-Fix-Upload-host-logic.patch
Normal file
278
0012-Fix-Upload-host-logic.patch
Normal file
@ -0,0 +1,278 @@
|
||||
From ac81979579c4936cb5dd842dd7ea59a88977bbdd Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Thu, 26 Oct 2023 17:30:04 +0800
|
||||
Subject: [PATCH] add password and ssh_pkey judge logic
|
||||
|
||||
---
|
||||
src/views/assests/components/EditableCell.vue | 34 +++++++++++++------
|
||||
src/views/assests/components/addMoreHost.vue | 10 +++++-
|
||||
vue.config.js | 32 ++++++-----------
|
||||
3 files changed, 43 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/src/views/assests/components/EditableCell.vue b/src/views/assests/components/EditableCell.vue
|
||||
index 28f0f62..5f4b347 100644
|
||||
--- a/src/views/assests/components/EditableCell.vue
|
||||
+++ b/src/views/assests/components/EditableCell.vue
|
||||
@@ -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' || formkey === 'ssh_pkey'">{{ countStar(form[formkey]) }}</span>
|
||||
+ <span v-if="formkey === 'password' || formkey === 'ssh_pkey'">{{ countStar() }}</span>
|
||||
<span v-else>{{ value || ' ' }}</span>
|
||||
</div>
|
||||
<a-icon type="edit" class="editable-cell-icon" @click="edit" />
|
||||
@@ -40,9 +40,27 @@ export default {
|
||||
formkey: {
|
||||
default: '',
|
||||
type: String
|
||||
+ },
|
||||
+ record: {
|
||||
+ default: null,
|
||||
+ type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
+ const validatePassword = (rule, value, callback) => {
|
||||
+ if (!this.record.ssh_pkey && (value.length === 0 || value.split(' ').join('').length === 0)) {
|
||||
+ callback(new Error('password和ssh_pkey不能都为空!'));
|
||||
+ } else {
|
||||
+ callback();
|
||||
+ }
|
||||
+ };
|
||||
+ const validateSshpkey = (rule, value, callback) => {
|
||||
+ if (!this.record.password && (value.length === 0 || value.split(' ').join('').length === 0)) {
|
||||
+ callback(new Error('password和ssh_pkey不能都为空!'));
|
||||
+ } else {
|
||||
+ callback();
|
||||
+ }
|
||||
+ };
|
||||
const validateUser = (rule, value, callback) => {
|
||||
if (value.length === 0 || value.split(' ').join('').length === 0) {
|
||||
callback(new Error('ssh_user不能为空!'));
|
||||
@@ -90,14 +108,14 @@ export default {
|
||||
cb();
|
||||
};
|
||||
return {
|
||||
- value: this.text,
|
||||
+ value: this.text === 'undefined' ? '' : this.text,
|
||||
editable: false,
|
||||
rules: {
|
||||
host_ip: [{ required: true, pattern: /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$/, message: '请输入IP地址在 0.0.0.0~255.255.255.255 区间内', trigger: 'change' }],
|
||||
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' }],
|
||||
+ password: [{ validator: validatePassword, trigger: 'change' }],
|
||||
+ ssh_pkey: [{ validator: validateSshpkey, trigger: 'change' }],
|
||||
host_name: [{ validator: checkNameInput, trigger: 'change' }],
|
||||
host_group_name: [{ required: true, message: 'host_group_name不能为空', trigger: 'change' }],
|
||||
management: [{ validator: checkmanagement, trigger: 'change' }]
|
||||
@@ -106,11 +124,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
countStar(num) {
|
||||
- let str = ''
|
||||
- for (let i = 0; i < num.length; i++) {
|
||||
- str += '*'
|
||||
- }
|
||||
- return str
|
||||
+ return '**********'
|
||||
},
|
||||
handleChange(e) {
|
||||
const value = e.target.value;
|
||||
@@ -152,7 +166,7 @@ export default {
|
||||
created() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
- document.removeEventListener('mouseup', this.handleClickOutside)
|
||||
+ document.removeEventListener('mouseup', this.handleClickOutside);
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('mouseup', this.handleClickOutside)
|
||||
diff --git a/src/views/assests/components/addMoreHost.vue b/src/views/assests/components/addMoreHost.vue
|
||||
index 818ffa6..efc930b 100644
|
||||
--- a/src/views/assests/components/addMoreHost.vue
|
||||
+++ b/src/views/assests/components/addMoreHost.vue
|
||||
@@ -31,6 +31,7 @@
|
||||
<editable-cell
|
||||
ref="host_ip"
|
||||
formkey="host_ip"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -40,6 +41,7 @@
|
||||
<editable-cell
|
||||
ref="ssh_port"
|
||||
formkey="ssh_port"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -49,6 +51,7 @@
|
||||
<editable-cell
|
||||
ref="ssh_user"
|
||||
formkey="ssh_user"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -58,6 +61,7 @@
|
||||
<editable-cell
|
||||
ref="password"
|
||||
formkey="password"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -67,6 +71,7 @@
|
||||
<editable-cell
|
||||
ref="ssh_pkey"
|
||||
formkey="ssh_pkey"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -76,6 +81,7 @@
|
||||
<editable-cell
|
||||
ref="host_name"
|
||||
formkey="host_name"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -85,6 +91,7 @@
|
||||
<editable-cell
|
||||
ref="host_group_name"
|
||||
formkey="host_group_name"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -94,6 +101,7 @@
|
||||
<editable-cell
|
||||
ref="management"
|
||||
formkey="management"
|
||||
+ :record="record"
|
||||
:text="String(text)"
|
||||
@unSubmit="unSubmit()"
|
||||
@allowSub="allowSub()"
|
||||
@@ -350,7 +358,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('ssh_pkey') || !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;
|
||||
}
|
||||
diff --git a/vue.config.js b/vue.config.js
|
||||
index a93ea29..8740425 100644
|
||||
--- a/vue.config.js
|
||||
+++ b/vue.config.js
|
||||
@@ -25,10 +25,7 @@ function getGitHash() {
|
||||
}
|
||||
|
||||
const serverMap = {
|
||||
- serverIpBase: 'http://127.0.0.1',
|
||||
- serveiIp1: 'http://172.168.115.178',
|
||||
- serveiIp2: 'http://172.168.97.229',
|
||||
- serveiIp3: 'http://172.168.240.235'
|
||||
+ serverIpBase: 'http://127.0.0.1'
|
||||
}
|
||||
|
||||
// vue.config.js
|
||||
@@ -101,8 +98,7 @@ const vueConfig = {
|
||||
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
|
||||
proxy: {
|
||||
'/api/domain': {
|
||||
- // target: serverMap.serverIpBase + ':11114',
|
||||
- target: serverMap.serveiIp3 + ':11114',
|
||||
+ target: serverMap.serverIpBase + ':11114',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -110,8 +106,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/host': {
|
||||
- // target: serverMap.serverIpBase + ':11114',
|
||||
- target: serverMap.serveiIp3 + ':11114',
|
||||
+ target: serverMap.serverIpBase + ':11114',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -119,8 +114,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/confs': {
|
||||
- // target: serverMap.serverIpBase + ':11114',
|
||||
- target: serverMap.serveiIp3 + ':11114',
|
||||
+ target: serverMap.serverIpBase + ':11114',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -128,8 +122,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/management': {
|
||||
- // target: serverMap.serverIpBase + ':11114',
|
||||
- target: serverMap.serveiIp3 + ':11114',
|
||||
+ target: serverMap.serverIpBase + ':11114',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -137,8 +130,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/diag': {
|
||||
- // target: serverMap.serverIpBase + ':11113',
|
||||
- target: serverMap.serveiIp2 + ':11113',
|
||||
+ target: serverMap.serverIpBase + ':11113',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -146,8 +138,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/check': {
|
||||
- // target: serverMap.serverIpBase + ':11112',
|
||||
- target: serverMap.serveiIp2 + ':11112',
|
||||
+ target: serverMap.serverIpBase + ':11112',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -155,8 +146,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/vulnerability': {
|
||||
- // target: serverMap.serverIpBase + ':11116',
|
||||
- target: serverMap.serveiIp2 + ':11116',
|
||||
+ target: serverMap.serverIpBase + ':11116',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -164,8 +154,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api/gala-spider': {
|
||||
- // target: serverMap.serverIpBase + ':11115',
|
||||
- target: serverMap.serveiIp2 + ':11115',
|
||||
+ target: serverMap.serverIpBase + ':11115',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
@@ -173,8 +162,7 @@ const vueConfig = {
|
||||
}
|
||||
},
|
||||
'/api': {
|
||||
- // target: serverMap.serverIpBase + ':11111',
|
||||
- target: serverMap.serveiIp2 + ':11111',
|
||||
+ target: serverMap.serverIpBase + ':11111',
|
||||
ws: false,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
--
|
||||
Gitee
|
||||
|
||||
29
0013-Fix-the-issue-of-incorrect-parameter.patch
Normal file
29
0013-Fix-the-issue-of-incorrect-parameter.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From e342c417cf0c7676da5f6ba40625c7350d8cdcea Mon Sep 17 00:00:00 2001
|
||||
From: wkl505997900 <2313665567@qq.com>
|
||||
Date: Mon, 30 Oct 2023 17:15:24 +0800
|
||||
Subject: [PATCH] fix params error issue
|
||||
|
||||
---
|
||||
src/views/assests/components/addMoreHost.vue | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/views/assests/components/addMoreHost.vue b/src/views/assests/components/addMoreHost.vue
|
||||
index efc930b..5cad786 100644
|
||||
--- a/src/views/assests/components/addMoreHost.vue
|
||||
+++ b/src/views/assests/components/addMoreHost.vue
|
||||
@@ -395,6 +395,12 @@ export default {
|
||||
item.management = Boolean(item.management)
|
||||
item.password = String(item.password)
|
||||
item.ssh_pkey = String(item.ssh_pkey)
|
||||
+ if (item.password === 'undefined') {
|
||||
+ item.password = ''
|
||||
+ }
|
||||
+ if (item.ssh_pkey === 'undefined') {
|
||||
+ item.ssh_pkey = ''
|
||||
+ }
|
||||
delete item.key;
|
||||
delete item.editable;
|
||||
delete item.result;
|
||||
--
|
||||
Gitee
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Name: aops-hermes
|
||||
Version: v1.3.3
|
||||
Release: 3
|
||||
Release: 11
|
||||
Summary: Web for an intelligent diagnose frame
|
||||
License: MulanPSL2
|
||||
URL: https://gitee.com/openeuler/%{name}
|
||||
@ -10,6 +10,17 @@ Source0: %{name}-%{version}.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
|
||||
Patch0006: 0006-Temporarily-hide-the-plugin-and-fingerprint-waveform-bar.patch
|
||||
Patch0007: 0007-Fix-five-issues.patch
|
||||
Patch0008: 0008-Fix-issues-with-polling-and-refreshing-displays.patch
|
||||
Patch0009: 0009-Correction-of-copyright-information.patch
|
||||
Patch0010: 0010-Optimize-host-scanning-polling-logic.patch
|
||||
Patch0011: 0011-Add-null-judgment-for-generating-cve-and-repo-tasks.patch
|
||||
Patch0012: 0012-Fix-Upload-host-logic.patch
|
||||
Patch0013: 0013-Fix-the-issue-of-incorrect-parameter.patch
|
||||
|
||||
|
||||
BuildRequires: nodejs node-gyp nodejs-yarn
|
||||
@ -26,7 +37,6 @@ Web for an intelligent diagnose frame
|
||||
|
||||
|
||||
%build
|
||||
export NODE_OPTIONS=--openssl-legacy-provider
|
||||
yarn build
|
||||
|
||||
|
||||
@ -46,6 +56,32 @@ cp -r deploy/aops-hermes.service %{buildroot}/usr/lib/systemd/system/
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Oct 30 2023 wangkunlong<505997900@qq.com> - v1.3.3-11
|
||||
- Fix the issue of incorrect parameter transmission for batch adding hosts
|
||||
|
||||
* Thu Oct 26 2023 wangkunlong<505997900@qq.com> - v1.3.3-10
|
||||
- Add Upload host logic
|
||||
|
||||
* Thu Oct 26 2023 wangkunlong<505997900@qq.com> - v1.3.3-9
|
||||
- Add null judgment for generating cve and repo tasks
|
||||
|
||||
* Tue Oct 24 2023 wangkunlong<505997900@qq.com> - v1.3.3-8
|
||||
- Optimize host scanning polling logic
|
||||
|
||||
* Mon Oct 23 2023 wangkunlong<505997900@qq.com> - v1.3.3-7
|
||||
- Resolve issues with polling interfaces that still exist in other interfaces
|
||||
- Resolve the issue of failed expansion of the rpm list after refreshing the task details interface
|
||||
- Correction of copyright information
|
||||
|
||||
* Fri Oct 20 2023 wangkunlong<505997900@qq.com> - v1.3.3-6
|
||||
- Fix some issues
|
||||
|
||||
* Wed Oct 18 2023 wangkunlong<505997900@qq.com> - v1.3.3-5
|
||||
- Temporarily hide the plugin and fingerprint waveform bar
|
||||
|
||||
* Wed Oct 18 2023 wangkunlong<505997900@qq.com> - v1.3.3-4
|
||||
- Update 20.03 SP3 branch code to the latest version
|
||||
|
||||
* Wed Sep 20 2023 wangkunlong<505997900@qq.com> - v1.3.3-3
|
||||
- Change params in rpms under host
|
||||
- Change hotpatch rpms show way
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user