From 7a73005872e2e8e503104fb168eea547ea232412 Mon Sep 17 00:00:00 2001 From: filesite Date: Thu, 19 Dec 2024 00:17:10 +0800 Subject: [PATCH] js update for bot stats update --- www/js/beauty.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/js/beauty.js b/www/js/beauty.js index 01227f2..5942917 100644 --- a/www/js/beauty.js +++ b/www/js/beauty.js @@ -926,6 +926,7 @@ $('.expand-icon').click(function(evt) { /* MainBot扫描进度展示 */ if ($('.botstats').length > 0) { + var didScan = false; var refreshBotStats = function() { $.ajax({ url: '/site/botstats', @@ -942,16 +943,18 @@ if ($('.botstats').length > 0) { $('.botstats .progress-bar').text(data.percent + '%'); } if (data.percent < 100) { + didScan = true; $('.btnStartScan').prop('disabled', true); $('.botstats').removeClass('hide'); $('.botstats .progress-bar').removeClass('progress-bar-success'); setTimeout(refreshBotStats, 10000); - }else { + }else if (didScan) { $('.botstats .progress-bar').addClass('progress-bar-success'); setTimeout(function() { $('.botstats').addClass('hide'); $('.btnStartScan').removeAttr('disabled'); - }, 3000); + location.reload(); + }, 4000); } } }).fail(function(jqXHR, textStatus, errorThrown) {