diff --git a/pandora_console/include/ajax/task_list.ajax.php b/pandora_console/include/ajax/task_list.ajax.php
index 353083390a..33dc3e6b5f 100644
--- a/pandora_console/include/ajax/task_list.ajax.php
+++ b/pandora_console/include/ajax/task_list.ajax.php
@@ -44,57 +44,16 @@ if ($progress_task_discovery) {
$summary = json_decode($task['summary'], true);
$result = '
';
- $result .= '
';
- $result .= ''._('Overall Progress').'
';
- $result .= '- ';
- $result .= d3_progress_bar(
- $id_task,
- ($global_progress < 0) ? 100 : $global_progress,
- 460,
- 30,
- '#EA5434',
- '%',
- '',
- '#FFFFFF',
- 0,
- 0,
- 0
- );
-
- if ($global_progress > 0) {
- switch ($summary['step']) {
- case STEP_SCANNING:
- $str = __('Scanning network');
- break;
-
- case STEP_AFT:
- $str = __('Finding AFT connectivity');
- break;
-
- case STEP_TRACEROUTE:
- $str = __('Finding traceroute connectivity');
- break;
-
- case STEP_GATEWAY:
- $str = __('Finding gateway connectivity');
- break;
-
- default:
- $str = __('Searching for devices...');
- break;
- }
-
- $result .= '
';
- $result .= ''.$str.' ';
- $result .= $summary['c_network_name'];
- $result .= '
';
+ if ($task['utimestamp']) {
+ $result .= '';
+ $result .= ''._('Overall Progress').'
';
$result .= '- ';
$result .= d3_progress_bar(
- $id_task.'_detail',
- $summary['c_network_percent'],
+ $id_task,
+ ($global_progress < 0) ? 100 : $global_progress,
460,
30,
- '#2751E1',
+ '#EA5434',
'%',
'',
'#FFFFFF',
@@ -102,47 +61,97 @@ if ($progress_task_discovery) {
0,
0
);
- $result .= '
';
+
+ if ($global_progress > 0) {
+ switch ($summary['step']) {
+ case STEP_SCANNING:
+ $str = __('Scanning network');
+ break;
+
+ case STEP_AFT:
+ $str = __('Finding AFT connectivity');
+ break;
+
+ case STEP_TRACEROUTE:
+ $str = __('Finding traceroute connectivity');
+ break;
+
+ case STEP_GATEWAY:
+ $str = __('Finding gateway connectivity');
+ break;
+
+ default:
+ $str = __('Searching for devices...');
+ break;
+ }
+
+ $result .= '';
+ $result .= ''.$str.' ';
+ $result .= $summary['c_network_name'];
+ $result .= '
';
+ $result .= '- ';
+ $result .= d3_progress_bar(
+ $id_task.'_detail',
+ $summary['c_network_percent'],
+ 460,
+ 30,
+ '#2751E1',
+ '%',
+ '',
+ '#FFFFFF',
+ 0,
+ 0,
+ 0
+ );
+ $result .= '
';
+ }
+
+ $result .= '
';
+
+ $i = 0;
+ $table = new StdClasS();
+ $table->class = 'databox data';
+ $table->width = '75%';
+ $table->styleTable = 'margin: 2em auto 0;border: 1px solid #ddd;background: white;';
+ $table->rowid = [];
+ $table->data = [];
+
+ // Content.
+ $table->data[$i][0] = ''.__('Hosts discovered').'';
+ $table->data[$i][1] = '';
+ $table->data[$i][1] .= $summary['summary']['discovered'];
+ $table->data[$i++][1] .= '';
+
+ $table->data[$i][0] = ''.__('Alive').'';
+ $table->data[$i][1] = '';
+ $table->data[$i][1] .= $summary['summary']['alive'];
+ $table->data[$i++][1] .= '';
+
+ $table->data[$i][0] = ''.__('Not alive').'';
+ $table->data[$i][1] = '';
+ $table->data[$i][1] .= $summary['summary']['not_alive'];
+ $table->data[$i++][1] .= '';
+
+ $table->data[$i][0] = ''.__('Responding SNMP').'';
+ $table->data[$i][1] = '';
+ $table->data[$i][1] .= $summary['summary']['SNMP'];
+ $table->data[$i++][1] .= '';
+
+ $table->data[$i][0] = ''.__('Responding WMI').'';
+ $table->data[$i][1] = '';
+ $table->data[$i][1] .= $summary['summary']['WMI'];
+ $table->data[$i++][1] .= '';
+
+ $result .= html_print_table($table, true).'
';
+ } else {
+ $global_progress = -1;
+ $result .= ui_print_error_message(
+ __('No data to show'),
+ '',
+ true
+ ).'';
}
- $result .= '';
-
- $i = 0;
- $table = new StdClasS();
- $table->class = 'databox data';
- $table->width = '75%';
- $table->styleTable = 'margin: 2em auto 0;border: 1px solid #ddd;background: white;';
- $table->rowid = [];
- $table->data = [];
-
- // Content.
- $table->data[$i][0] = ''.__('Hosts discovered').'';
- $table->data[$i][1] = '';
- $table->data[$i][1] .= $summary['summary']['discovered'];
- $table->data[$i++][1] .= '';
-
- $table->data[$i][0] = ''.__('Alive').'';
- $table->data[$i][1] = '';
- $table->data[$i][1] .= $summary['summary']['alive'];
- $table->data[$i++][1] .= '';
-
- $table->data[$i][0] = ''.__('Not alive').'';
- $table->data[$i][1] = '';
- $table->data[$i][1] .= $summary['summary']['not_alive'];
- $table->data[$i++][1] .= '';
-
- $table->data[$i][0] = ''.__('Responding SNMP').'';
- $table->data[$i][1] = '';
- $table->data[$i][1] .= $summary['summary']['SNMP'];
- $table->data[$i++][1] .= '';
-
- $table->data[$i][0] = ''.__('Responding WMI').'';
- $table->data[$i][1] = '';
- $table->data[$i][1] .= $summary['summary']['WMI'];
- $table->data[$i++][1] .= '';
-
- $result .= html_print_table($table, true).'';
-
$result_array['status'] = $global_progress;
$result_array['html'] = $result;
diff --git a/pandora_console/include/javascript/pandora_taskList.js b/pandora_console/include/javascript/pandora_taskList.js
index 270fec67a0..f151c9003a 100644
--- a/pandora_console/include/javascript/pandora_taskList.js
+++ b/pandora_console/include/javascript/pandora_taskList.js
@@ -35,10 +35,8 @@ function progress_task_list(id, title) {
// TODO: Show info about the problem.
}
- if (data.status > 0) {
- $elem.html(data.html);
- if (!$elem.dialog("isOpen")) $elem.dialog("open");
- }
+ $elem.html(data.html);
+ if (!$elem.dialog("isOpen")) $elem.dialog("open");
if (data.status != -1) {
timeoutRef = setTimeout(function() {