mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
discovery task status overview
Former-commit-id: 329d03c109b9e09788302212752f372647b19c56
This commit is contained in:
parent
1238f15190
commit
6cc6f6f125
@ -34,30 +34,63 @@ $showmap = (bool) get_parameter('showmap', 0);
|
|||||||
if ($progress_task_discovery) {
|
if ($progress_task_discovery) {
|
||||||
$id_task = get_parameter('id', 0);
|
$id_task = get_parameter('id', 0);
|
||||||
|
|
||||||
if ($id_task !== 0) {
|
if ($id_task <= 0) {
|
||||||
$result = '';
|
echo json_encode(['error' => true]);
|
||||||
$result .= '<ul class="progress_task_discovery">';
|
return;
|
||||||
$result .= '<li><h1>'._('Overall Progress').'</h1></li>';
|
}
|
||||||
$result .= '<li>';
|
|
||||||
$result .= d3_progress_bar(
|
$task = db_get_row('trecon_task', 'id_rt', $id_task);
|
||||||
$id_task,
|
$global_progress = $task['status'];
|
||||||
90,
|
$summary = json_decode($task['summary'], true);
|
||||||
460,
|
|
||||||
30,
|
$result = '';
|
||||||
'#EA5434',
|
$result .= '<ul class="progress_task_discovery">';
|
||||||
'%',
|
$result .= '<li><h1>'._('Overall Progress').'</h1></li>';
|
||||||
'',
|
$result .= '<li>';
|
||||||
'#FFFFFF',
|
$result .= d3_progress_bar(
|
||||||
0,
|
$id_task,
|
||||||
0
|
($global_progress < 0) ? 100 : $global_progress,
|
||||||
);
|
460,
|
||||||
|
30,
|
||||||
|
'#EA5434',
|
||||||
|
'%',
|
||||||
|
'',
|
||||||
|
'#FFFFFF',
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($global_progress > 0) {
|
||||||
|
switch ($summary['step']) {
|
||||||
|
case STEP_SCANNING:
|
||||||
|
$str = __('Scanning the 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 .= '</li>';
|
$result .= '</li>';
|
||||||
$result .= '<li><h1>'.__('Searching devices in').' red a scanear</h1></li>';
|
$result .= '<li><h1>'.$str.' ';
|
||||||
|
$result .= $summary['c_network_name'];
|
||||||
|
$result .= '</h1></li>';
|
||||||
$result .= '<li>';
|
$result .= '<li>';
|
||||||
$result .= d3_progress_bar(
|
$result .= d3_progress_bar(
|
||||||
$id_task.'_2',
|
$id_task.'_detail',
|
||||||
30,
|
$summary['c_network_percent'],
|
||||||
460,
|
460,
|
||||||
30,
|
30,
|
||||||
'#2751E1',
|
'#2751E1',
|
||||||
@ -67,22 +100,49 @@ if ($progress_task_discovery) {
|
|||||||
0,
|
0,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
$result .= '</li>';
|
$result .= '</li>';
|
||||||
$result .= '<li><h1>'.__('Summary').'</h1></li>';
|
|
||||||
$result .= '<li><span><b>'.__('Estimated').'</b>: total de host</span></li>';
|
|
||||||
$result .= '<li><span><b>'.__('Discovered').'</b>: total de agentes</span></li>';
|
|
||||||
$result .= '<li><span><b>'.__('Not alive/Not found').'</b>: total de agentes 1-2</span></li>';
|
|
||||||
$result .= '</ul>';
|
|
||||||
|
|
||||||
echo $result;
|
|
||||||
} else {
|
|
||||||
// Error.
|
|
||||||
ui_print_error_message(
|
|
||||||
__('Please, select task')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result .= '</ul>';
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
$table = new StdClasS();
|
||||||
|
$table->class = 'databox data';
|
||||||
|
$table->width = '75%';
|
||||||
|
$table->styleTable = 'margin: 2em auto;border: 1px solid #ddd;background: white;';
|
||||||
|
$table->rowid = [];
|
||||||
|
$table->data = [];
|
||||||
|
|
||||||
|
// Content.
|
||||||
|
$table->data[$i][0] = '<b>'.__('Hosts discovered').'</b>';
|
||||||
|
$table->data[$i][1] = '<span id="discovered">';
|
||||||
|
$table->data[$i][1] .= $summary['summary']['discovered'];
|
||||||
|
$table->data[$i++][1] .= '</span>';
|
||||||
|
|
||||||
|
$table->data[$i][0] = '<b>'.__('Alive').'</b>';
|
||||||
|
$table->data[$i][1] = '<span id="alive">';
|
||||||
|
$table->data[$i][1] .= $summary['summary']['alive'];
|
||||||
|
$table->data[$i++][1] .= '</span>';
|
||||||
|
|
||||||
|
$table->data[$i][0] = '<b>'.__('Not alive').'</b>';
|
||||||
|
$table->data[$i][1] = '<span id="not_alive">';
|
||||||
|
$table->data[$i][1] .= $summary['summary']['not_alive'];
|
||||||
|
$table->data[$i++][1] .= '</span>';
|
||||||
|
|
||||||
|
$table->data[$i][0] = '<b>'.__('Responding SNMP').'</b>';
|
||||||
|
$table->data[$i][1] = '<span id="SNMP">';
|
||||||
|
$table->data[$i][1] .= $summary['summary']['SNMP'];
|
||||||
|
$table->data[$i++][1] .= '</span>';
|
||||||
|
|
||||||
|
$table->data[$i][0] = '<b>'.__('Responding WMI').'</b>';
|
||||||
|
$table->data[$i][1] = '<span id="WMI">';
|
||||||
|
$table->data[$i][1] .= $summary['summary']['WMI'];
|
||||||
|
$table->data[$i++][1] .= '</span>';
|
||||||
|
|
||||||
|
$result .= html_print_table($table, true);
|
||||||
|
|
||||||
|
echo $result;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,6 +514,12 @@ define('OPTION_COLOR_PICKER', 11);
|
|||||||
define('NODE_TYPE', 0);
|
define('NODE_TYPE', 0);
|
||||||
define('ARROW_TYPE', 1);
|
define('ARROW_TYPE', 1);
|
||||||
|
|
||||||
|
// Discovery task steps.
|
||||||
|
define('STEP_SCANNING', 1);
|
||||||
|
define('STEP_AFT', 2);
|
||||||
|
define('STEP_TRACEROUTE', 3);
|
||||||
|
define('STEP_GATEWAY', 4);
|
||||||
|
|
||||||
// Networkmap node types.
|
// Networkmap node types.
|
||||||
define('NODE_AGENT', 0);
|
define('NODE_AGENT', 0);
|
||||||
define('NODE_MODULE', 1);
|
define('NODE_MODULE', 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user