add colorized log icon to widget bar

This commit is contained in:
Andrew Bauer 2020-08-02 14:49:19 -05:00
parent a937e14899
commit 0ecb1621ce
1 changed files with 17 additions and 0 deletions

View File

@ -354,6 +354,7 @@ function getNormalNavBarHTML($running, $user, $bandwidth_options, $view, $filter
echo getDbConHTML(); echo getDbConHTML();
echo getStorageHTML(); echo getStorageHTML();
echo getShmHTML(); echo getShmHTML();
echo getLogIconHTML();
?> ?>
</ul> </ul>
@ -412,6 +413,7 @@ function getCollapsedNavBarHTML($running, $user, $bandwidth_options, $view, $fil
echo getDbConHTML(); echo getDbConHTML();
echo getStorageHTML(); echo getStorageHTML();
echo getShmHTML(); echo getShmHTML();
echo getLogIconHTML();
?> ?>
</div> </div>
@ -643,6 +645,21 @@ function getLogHTML() {
return $result; 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 .= '<li id="getLogIconHTML" class="nav-item dropdown">'.makePopupLink('?view=log', 'zmLog', 'log', '<span class="mx-1 ' .$class. '"><i class="material-icons md-18">report</i>'.translate('Log').'</span>').'</li>'.PHP_EOL;
}
}
return $result;
}
// Returns the html representing the X10 Devices menu item // Returns the html representing the X10 Devices menu item
function getDevicesHTML() { function getDevicesHTML() {
$result=''; $result='';