Merge branch 'ent-12946-Error-500-entorno-sin-servidores' into 'develop'

fix error when there are no servers

See merge request artica/pandorafms!6972
This commit is contained in:
Rafael Ameijeiras 2024-02-28 08:41:02 +00:00
commit 3c6ad30d14
1 changed files with 8 additions and 1 deletions

View File

@ -54,7 +54,14 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
// ======= Servers List ===============================================
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
$servers = [];
$servers['all'] = (int) count((servers_get_info() ?? []));
$servers_info = servers_get_info();
$servers['all'] = 0;
if ($servers_info !== null && $servers_info !== false) {
$servers['all'] = (int) count($servers_info);
}
if ($servers['all'] != 0) {
$servers['up'] = (int) servers_check_status();
$servers['down'] = ($servers['all'] - $servers['up']);