mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
New networkmaps in progress... (Fixed agents count)
This commit is contained in:
parent
35d7989dab
commit
16ff172bc3
@ -75,7 +75,7 @@ function networkmap_process_networkmap($id = 0) {
|
||||
$show_snmp_modules = false;
|
||||
$dont_show_subgroups = false;
|
||||
|
||||
$id_group = $networkmap['id_group'];;
|
||||
$id_group = $networkmap['id_group'];
|
||||
$ip_mask = "";
|
||||
switch ($networkmap['source']) {
|
||||
case 1:
|
||||
@ -158,8 +158,6 @@ function networkmap_process_networkmap($id = 0) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$nodes_and_relations['nodes'] = array();
|
||||
$index = 0;
|
||||
foreach ($nodes as $key => $node) {
|
||||
|
@ -376,10 +376,25 @@ switch ($tab) {
|
||||
$network_map['name'] . '</a>';
|
||||
}
|
||||
|
||||
$count = db_get_value_sql(
|
||||
'SELECT COUNT(*)
|
||||
FROM titem
|
||||
WHERE id_map = ' . $network_map['id'] . ' AND deleted = 0');
|
||||
|
||||
if ($network_map['id_group'] > 0) {
|
||||
$nodes = db_get_all_rows_sql("SELECT style FROM titem WHERE id_map = " . $network_map['id'] . " AND deleted = 0");
|
||||
$count = 0;
|
||||
foreach ($nodes as $node) {
|
||||
$node_style = json_decode($node['style'], true);
|
||||
if ($node_style['id_group'] == $network_map['id_group']) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$count = db_get_value_sql(
|
||||
'SELECT COUNT(*)
|
||||
FROM titem
|
||||
WHERE id_map = ' . $network_map['id'] . ' AND deleted = 0');
|
||||
}
|
||||
|
||||
|
||||
if (empty($count))
|
||||
$count = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user