mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Order alerts by state so that we can indicate rules which have triggered
This commit is contained in:
@@ -155,7 +155,7 @@ $start = (($page_number - 1) * $results);
|
|||||||
$full_query = $full_query.$query." LIMIT $start,$results";
|
$full_query = $full_query.$query." LIMIT $start,$results";
|
||||||
|
|
||||||
foreach (dbFetchRows($full_query, $param) as $rule) {
|
foreach (dbFetchRows($full_query, $param) as $rule) {
|
||||||
$sub = dbFetchRows('SELECT * FROM alerts WHERE rule_id = ? ORDER BY id DESC LIMIT 1', array($rule['id']));
|
$sub = dbFetchRows('SELECT * FROM alerts WHERE rule_id = ? ORDER BY `state` DESC, `id` DESC LIMIT 1', array($rule['id']));
|
||||||
$ico = 'ok';
|
$ico = 'ok';
|
||||||
$col = 'success';
|
$col = 'success';
|
||||||
$extra = '';
|
$extra = '';
|
||||||
@@ -165,16 +165,11 @@ foreach (dbFetchRows($full_query, $param) as $rule) {
|
|||||||
$ico = 'ok';
|
$ico = 'ok';
|
||||||
$col = 'success';
|
$col = 'success';
|
||||||
}
|
}
|
||||||
else if ((int) $sub['state'] === 1) {
|
elseif ((int) $sub['state'] === 1 || (int) $sub['state'] === 2) {
|
||||||
$ico = 'remove';
|
$ico = 'remove';
|
||||||
$col = 'danger';
|
$col = 'danger';
|
||||||
$extra = 'danger';
|
$extra = 'danger';
|
||||||
}
|
}
|
||||||
else if ((int) $sub['state'] === 2) {
|
|
||||||
$ico = 'time';
|
|
||||||
$col = 'default';
|
|
||||||
$extra = 'warning';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$alert_checked = '';
|
$alert_checked = '';
|
||||||
|
Reference in New Issue
Block a user