mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Enhance AlertLog Table View (#11936)
This commit is contained in:
@ -77,11 +77,12 @@ $common_output[] = '
|
|||||||
<table id="alertlog" class="table table-hover table-condensed table-striped">
|
<table id="alertlog" class="table table-hover table-condensed table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-column-id="status" data-sortable="false"></th>
|
<th data-column-id="status" data-sortable="false">State</th>
|
||||||
<th data-column-id="time_logged" data-order="desc">Timestamp</th>
|
<th data-column-id="time_logged" data-order="desc">Timestamp</th>
|
||||||
<th data-column-id="details" data-sortable="false"> </th>
|
<th data-column-id="details" data-sortable="false"> </th>
|
||||||
<th data-column-id="hostname">Device</th>
|
<th data-column-id="hostname">Device</th>
|
||||||
<th data-column-id="alert">Alert</th>
|
<th data-column-id="alert">Alert</th>
|
||||||
|
<th data-column-id="severity">Severity</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
|
@ -78,7 +78,7 @@ if ($rowCount != -1) {
|
|||||||
$sql .= " LIMIT $limit_low,$limit_high";
|
$sql .= " LIMIT $limit_low,$limit_high";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT D.device_id,name AS alert,rule_id, state,time_logged,DATE_FORMAT(time_logged, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') as humandate,details $sql";
|
$sql = "SELECT R.severity, D.device_id,name AS alert,rule_id, state,time_logged,DATE_FORMAT(time_logged, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') as humandate,details $sql";
|
||||||
|
|
||||||
$rulei = 0;
|
$rulei = 0;
|
||||||
foreach (dbFetchRows($sql, $param) as $alertlog) {
|
foreach (dbFetchRows($sql, $param) as $alertlog) {
|
||||||
@ -102,14 +102,14 @@ foreach (dbFetchRows($sql, $param) as $alertlog) {
|
|||||||
$status = 'label-primary';
|
$status = 'label-primary';
|
||||||
}//end if
|
}//end if
|
||||||
|
|
||||||
|
|
||||||
$response[] = array(
|
$response[] = array(
|
||||||
'id' => $rulei++,
|
'id' => $rulei++,
|
||||||
'time_logged' => $alertlog['humandate'],
|
'time_logged' => $alertlog['humandate'],
|
||||||
'details' => '<a class="fa fa-plus incident-toggle" style="display:none" data-toggle="collapse" data-target="#incident' . ($rulei) . '" data-parent="#alerts"></a>',
|
'details' => '<a class="fa fa-plus incident-toggle" style="display:none" data-toggle="collapse" data-target="#incident' . ($rulei) . '" data-parent="#alerts"></a>',
|
||||||
'hostname' => '<div class="incident">' . generate_device_link($dev, shorthost($dev['hostname'])) . '<div id="incident' . ($rulei) . '" class="collapse">' . $fault_detail . '</div></div>',
|
'hostname' => '<div class="incident">' . generate_device_link($dev, shorthost($dev['hostname'])) . '<div id="incident' . ($rulei) . '" class="collapse">' . $fault_detail . '</div></div>',
|
||||||
'alert' => htmlspecialchars($alertlog['alert']),
|
'alert' => htmlspecialchars($alertlog['alert']),
|
||||||
'status' => "<i class='alert-status " . $status . "'></i>"
|
'status' => "<i class='alert-status " . $status . "' title='". ($alert_state ? 'active':'recovered')."'></i>",
|
||||||
|
'severity' => $alertlog['severity']
|
||||||
);
|
);
|
||||||
}//end foreach
|
}//end foreach
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user