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:
commit
3c6ad30d14
|
@ -54,7 +54,14 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||||
// ======= Servers List ===============================================
|
// ======= Servers List ===============================================
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
|
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
|
||||||
$servers = [];
|
$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) {
|
if ($servers['all'] != 0) {
|
||||||
$servers['up'] = (int) servers_check_status();
|
$servers['up'] = (int) servers_check_status();
|
||||||
$servers['down'] = ($servers['all'] - $servers['up']);
|
$servers['down'] = ($servers['all'] - $servers['up']);
|
||||||
|
|
Loading…
Reference in New Issue