aops-hermes/0010-Optimize-host-scanning-polling-logic.patch
2023-11-06 15:36:56 +08:00

43 lines
1.7 KiB
Diff

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