Merge branch 'ent-8723-13221-giss-optimizacion-en-el-despliegue-del-tree-view-de-servicios' into 'develop'

allow disable counters on mc environments

See merge request artica/pandorafms!4814
This commit is contained in:
Daniel Rodriguez 2022-06-02 09:08:08 +00:00
commit 1aefe527c4
2 changed files with 61 additions and 47 deletions

View File

@ -530,6 +530,20 @@ class TreeService extends Tree
$tmp['elementDescription'] = $item->description();
$tmp['disabled'] = $item->service()->disabled();
$counters = [
'total_modules' => 0,
'total_agents' => 0,
'total_services' => 0,
'total_dynamic' => 0,
'total' => 0,
];
if (is_metaconsole() === false
|| (isset($config['realtimestats']) === true
&& $config['realtimestats'] === true
&& $tmp['metaID'] > 0)
) {
// Look for counters.
if ($this->connectedToNode === false
&& is_metaconsole() === true
&& $tmp['metaID'] > 0
@ -557,14 +571,6 @@ class TreeService extends Tree
\enterprise_hook('metaconsole_restore_db');
}
$counters = [
'total_modules' => 0,
'total_agents' => 0,
'total_services' => 0,
'total_dynamic' => 0,
'total' => 0,
];
if (is_array($grandchildren) === true) {
$counters = array_reduce(
$grandchildren,
@ -590,6 +596,10 @@ class TreeService extends Tree
if ($counters['total'] > 0) {
$tmp['searchChildren'] = 1;
}
} else {
// Always search for.
$tmp['searchChildren'] = 1;
}
$tmp['type'] = 'services';
$tmp['rootType'] = 'services';

View File

@ -2096,6 +2096,10 @@ function config_process_config()
config_update_value('metaconsole_events_history', 0);
}
if (!isset($config['realtimestats'])) {
config_update_value('realtimestats', 1);
}
if (!isset($config['trap_purge'])) {
config_update_value('trap_purge', 7);
}