aops-hermes/0008-Fix-issues-with-polling-and-refreshing-displays.patch
2023-11-06 15:36:56 +08:00

99 lines
3.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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