mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
remove group cache in tree view
This commit is contained in:
parent
4781809e14
commit
f3a2bda1a5
@ -135,8 +135,6 @@ class TreeGroup extends Tree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getGroupCounters() {
|
protected function getGroupCounters() {
|
||||||
//FIXME PLEASE
|
|
||||||
if (true) {
|
|
||||||
$fields = $this->getFirstLevelFields();
|
$fields = $this->getFirstLevelFields();
|
||||||
$inside_fields = $this->getFirstLevelFieldsInside();
|
$inside_fields = $this->getFirstLevelFieldsInside();
|
||||||
|
|
||||||
@ -210,23 +208,8 @@ class TreeGroup extends Tree {
|
|||||||
ON x2.g = tg.id_grupo
|
ON x2.g = tg.id_grupo
|
||||||
GROUP BY tg.id_grupo";
|
GROUP BY tg.id_grupo";
|
||||||
$stats = db_get_all_rows_sql($sql);
|
$stats = db_get_all_rows_sql($sql);
|
||||||
}
|
|
||||||
else{
|
|
||||||
$stats = db_get_all_rows_sql(
|
|
||||||
'SELECT tgs.agents AS total_count, tgs.critical AS total_critical_count,
|
|
||||||
tgs.unknown AS total_unknown_count, tgs.warning AS total_warning_count,
|
|
||||||
`non-init` AS total_not_init_count, tgs.normal AS total_normal_count,
|
|
||||||
tgs.alerts_fired AS total_alerts_count,
|
|
||||||
tg.nombre AS name, tg.parent, tg.icon, tg.id_grupo AS gid
|
|
||||||
FROM tgroup_stat tgs
|
|
||||||
INNER JOIN tgrupo tg
|
|
||||||
ON tg.id_grupo = tgs.id_group
|
|
||||||
');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Update the group cache (from db or calculated).
|
|
||||||
$group_stats = array();
|
$group_stats = array();
|
||||||
|
|
||||||
foreach ($stats as $group) {
|
foreach ($stats as $group) {
|
||||||
$group_stats[$group['gid']]['total_count'] = (int)$group['total_count'];
|
$group_stats[$group['gid']]['total_count'] = (int)$group['total_count'];
|
||||||
$group_stats[$group['gid']]['total_critical_count'] = (int)$group['total_critical_count'];
|
$group_stats[$group['gid']]['total_critical_count'] = (int)$group['total_critical_count'];
|
||||||
@ -242,10 +225,6 @@ class TreeGroup extends Tree {
|
|||||||
$group_stats[$group['gid']] = $this->getProcessedItem($group_stats[$group['gid']]);
|
$group_stats[$group['gid']] = $this->getProcessedItem($group_stats[$group['gid']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($group_stats[$group_id])) {
|
|
||||||
return $group_stats[$group_id];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $group_stats;
|
return $group_stats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user