From 0ecb1621ce6bec8501a167c2b4f22fda8e941c4c Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Sun, 2 Aug 2020 14:49:19 -0500 Subject: [PATCH] add colorized log icon to widget bar --- web/skins/classic/includes/functions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index fb64a16a5..570eaaf50 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -354,6 +354,7 @@ function getNormalNavBarHTML($running, $user, $bandwidth_options, $view, $filter echo getDbConHTML(); echo getStorageHTML(); echo getShmHTML(); + echo getLogIconHTML(); ?> @@ -412,6 +413,7 @@ function getCollapsedNavBarHTML($running, $user, $bandwidth_options, $view, $fil echo getDbConHTML(); echo getStorageHTML(); echo getShmHTML(); + echo getLogIconHTML(); ?> @@ -643,6 +645,21 @@ function getLogHTML() { return $result; } +// Returns the html representing the log icon +function getLogIconHTML() { + $result=''; + + if ( canView('System') ) { + if ( ZM\logToDatabase() > ZM\Logger::NOLOG ) { + $logstate = logState(); + $class = ($logstate == 'ok') ? 'text-success' : ($logstate == 'alert' ? 'text-warning' : (($logstate == 'alarm' ? 'text-danger' : ''))); + $result .= ''.PHP_EOL; + } + } + + return $result; +} + // Returns the html representing the X10 Devices menu item function getDevicesHTML() { $result='';