diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php index 1a47489081..e717167697 100644 --- a/html/includes/print-menubar.php +++ b/html/includes/print-menubar.php @@ -67,11 +67,14 @@ if ($_SESSION['userlevel'] >= '10') { } ?> + + - Network Map'); -} ?>
  • Eventlog
  • Syslog'); diff --git a/html/pages/availability-map.inc.php b/html/pages/availability-map.inc.php new file mode 100644 index 0000000000..dc63bf16b8 --- /dev/null +++ b/html/pages/availability-map.inc.php @@ -0,0 +1,40 @@ + +* This program is free software: you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation, either version 3 of the License, or (at your +* option) any later version. Please see LICENSE.txt at the top level of +* the source code distribution for details. +*/ + +if ($_SESSION['userlevel'] >= '10') { + $sql = "SELECT `hostname`,`device_id`,`status`,`uptime` FROM `devices` WHERE `ignore` = '0' AND `disabled` = '0' ORDER BY `hostname`"; + $sqlcount = "SELECT COUNT(*) FROM `devices` WHERE `ignore` = '0' AND `disabled` = '0' ORDER BY `hostname`"; + $rows = dbFetchCell($sqlcount); + echo "

    All Devices(" . $rows . ")

    "; +} +else { + $sql = "SELECT D.`hostname`,D.`device_id`,D.`status`,D.`uptime` FROM `devices` AS D, `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = '" . $_SESSION['user_id'] . "' AND D.`ignore` = '0' AND D.`disabled` = '0' ORDER BY D.`hostname`"; + $sqlcount = "SELECT COUNT(*) FROM `devices` AS D, `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = '" . $_SESSION['user_id'] . "' AND D.`ignore` = '0' AND D.`disabled` = '0' ORDER BY D.`hostname`"; + $rows = dbFetchCell($sqlcount); + echo "

    All Devices(" . $rows . ")

    "; +} + +foreach(dbFetchRows($sql) as $device) { + if ($device['status'] == '1') { + $btn_type = 'btn-success'; + if ($device['uptime'] < $config['uptime_warning']) { + $btn_type = 'btn-warning'; + } + } + else { + $btn_type = 'btn-danger'; + } + + echo ""; +} + +echo "
    ";