Skip to content

Commit c512952

Browse files
committed
fix: Fix toolbox log output when following a running task
1 parent c6e4c5a commit c512952

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ netdiscovery/netinventory:
5757
injector:
5858
* Add support for --ca-cert-file and --ssl-fingerprint options
5959

60+
toolbox:
61+
* fix log output when following a running task
62+
6063
packaging:
6164
* Update Windows packaging to use:
6265
- Perl 5.42.0 built using Perl::Dist::StrawBerry perl library processing

share/html/toolbox/inventory-list.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,10 @@ if (@jobs_order) {
437437
index = this.getResponseHeader('X-Inventory-Index');
438438
checked = document.getElementById('show-log-'+task).checked;
439439
last_run_date = this.getResponseHeader('X-Inventory-LastRunDate');
440+
running = this.getResponseHeader('X-Inventory-Status') === 'running' ? true : false;
440441
if (!freezed_log[task]) \{
441-
if (this.getResponseHeader('X-Inventory-Output') === 'full' || (output_index[task] > 0 && index < output_index[task])) \{
442+
// Reset content when receiving full inventory or when an active task just started
443+
if (this.getResponseHeader('X-Inventory-Output') === 'full' || (running && index === null)) \{
442444
output.innerHTML = this.responseText;
443445
output.scrollTop = 0;
444446
\} else \{
@@ -447,7 +449,6 @@ if (@jobs_order) {
447449
\}
448450
if (index >= 0) output_index[task] = index;
449451
\}
450-
running = this.getResponseHeader('X-Inventory-Status') === 'running' ? true : false;
451452
aborted = this.getResponseHeader('X-Inventory-Status') === 'aborted' ? true : false;
452453
failed = this.getResponseHeader('X-Inventory-Status') === 'failed' ? true : false;
453454
inventory_count = this.getResponseHeader('X-Inventory-Count');

0 commit comments

Comments
 (0)