From b1df3b460b0bd08272f32bbf3ff77c21e83f21e8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 1 Mar 2017 16:59:58 +0100 Subject: [PATCH] update queue-bar after adding new tasks --- views/bootstrap/class.Indexer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.Indexer.php b/views/bootstrap/class.Indexer.php index 91e9e2784..78e6bf93a 100644 --- a/views/bootstrap/class.Indexer.php +++ b/views/bootstrap/class.Indexer.php @@ -62,6 +62,7 @@ function check_queue() { data: {command: 'indexdocument', id: docid}, beforeSend: function() { queue_count++; // Add request to the counter + $('.queue-bar').css('width', (queue_count*100/MAX_REQUESTS)+'%'); }, error: function(xhr, textstatus) { noty({ @@ -90,10 +91,10 @@ function check_queue() { } }, complete: function(xhr, textstatus) { + queue_count--; // Substract request to the counter $('.queue-bar').css('width', (queue_count*100/MAX_REQUESTS)+'%'); $('.total-bar').css('width', (100 - (funcArray.length+queue_count)*100/docstoindex)+'%'); $('.total-bar').text(Math.round(100 - (funcArray.length+queue_count)*100/docstoindex)+' %'); - queue_count--; // Substract request to the counter if(funcArray.length+queue_count == 0) $('.total-bar').addClass('bar-success'); }