Browse Source

js update for bot stats update

master
filesite 1 month ago
parent
commit
7a73005872
  1. 7
      www/js/beauty.js

7
www/js/beauty.js

@ -926,6 +926,7 @@ $('.expand-icon').click(function(evt) {
/* MainBot扫描进度展示 */ /* MainBot扫描进度展示 */
if ($('.botstats').length > 0) { if ($('.botstats').length > 0) {
var didScan = false;
var refreshBotStats = function() { var refreshBotStats = function() {
$.ajax({ $.ajax({
url: '/site/botstats', url: '/site/botstats',
@ -942,16 +943,18 @@ if ($('.botstats').length > 0) {
$('.botstats .progress-bar').text(data.percent + '%'); $('.botstats .progress-bar').text(data.percent + '%');
} }
if (data.percent < 100) { if (data.percent < 100) {
didScan = true;
$('.btnStartScan').prop('disabled', true); $('.btnStartScan').prop('disabled', true);
$('.botstats').removeClass('hide'); $('.botstats').removeClass('hide');
$('.botstats .progress-bar').removeClass('progress-bar-success'); $('.botstats .progress-bar').removeClass('progress-bar-success');
setTimeout(refreshBotStats, 10000); setTimeout(refreshBotStats, 10000);
}else { }else if (didScan) {
$('.botstats .progress-bar').addClass('progress-bar-success'); $('.botstats .progress-bar').addClass('progress-bar-success');
setTimeout(function() { setTimeout(function() {
$('.botstats').addClass('hide'); $('.botstats').addClass('hide');
$('.btnStartScan').removeAttr('disabled'); $('.btnStartScan').removeAttr('disabled');
}, 3000); location.reload();
}, 4000);
} }
} }
}).fail(function(jqXHR, textStatus, errorThrown) { }).fail(function(jqXHR, textStatus, errorThrown) {

Loading…
Cancel
Save