Fixed services -> Alerts menu link + page

This commit is contained in:
laf
2015-10-17 18:13:11 +00:00
parent c653e3c0ee
commit 222191382d
2 changed files with 14 additions and 8 deletions

View File

@ -190,7 +190,7 @@ if ($config['show_services']) {
if ($service_alerts) {
echo('
<li role="presentation" class="divider"></li>
<li><a href="services/status=0/"><i class="fa fa-bell-o fa-fw fa-lg"></i> Alerts ('.$service_alerts.')</a></li>');
<li><a href="services/state=down/"><i class="fa fa-bell-o fa-fw fa-lg"></i> Alerts ('.$service_alerts.')</a></li>');
}
if ($_SESSION['userlevel'] >= '10') {

View File

@ -16,16 +16,14 @@ if (isset($vars['state'])) {
if ($vars['state'] == 'up') {
$state = '1';
}
else if ($vars['state'] == 'down') {
elseif ($vars['state'] == 'down') {
$state = '0';
}
}
if ($vars['state']) {
$where .= ' AND service_status= ?';
$where .= " AND service_status= ? AND service_disabled='0' AND `service_ignore`='0'";
$sql_param[] = $state;
$where .= " AND service_disabled='0' AND `service_ignore`='0'";
$sql_param[] = '';
}
if ($vars['disabled']) {
@ -65,8 +63,15 @@ unset($sep);
print_optionbar_end();
echo '<table class="table table-condensed">';
// echo("<tr class=interface-desc bgcolor='#e5e5e5'><td>Device</td><td>Service</td><td>Status</td><td>Changed</td><td>Checked</td><td>Message</td></tr>");
echo '<div class="table-responsive">
<table class="table table-condensed">
<tr>
<th>Device</th>
<th>Service</th>
<th>Status</th>
<th>Changed</th>
<th>Message</th>
</tr>';
if ($_SESSION['userlevel'] >= '5') {
$host_sql = 'SELECT * FROM devices AS D, services AS S WHERE D.device_id = S.device_id GROUP BY D.hostname ORDER BY D.hostname';
$host_par = array();
@ -123,4 +128,5 @@ foreach (dbFetchRows($host_sql, $host_par) as $device) {
unset($samehost);
}//end foreach
echo '</table>';
echo '</table>
</div>';