mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Implemented in Laravel Doesn't use legacy PHP session Several widgets have new features and settings, for example: - Multiple ports in one graph - Maps settings are configurable and override system settings but default to system settings - Graylog stream and/or device selection - Much improved graph widget selection - Many more DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926` After you are done testing, you can remove the changes with `./scripts/github-remove`. If there are schema changes, you can ask on discord how to revert.
74 lines
2.8 KiB
PHP
74 lines
2.8 KiB
PHP
<div class="row">
|
|
<div class="col-sm-12">
|
|
<span id="message"></span>
|
|
</div>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table id="alerts_{{ $id }}" class="table table-hover table-condensed alerts">
|
|
<thead>
|
|
<tr>
|
|
<th data-column-id="severity"></th>
|
|
<th data-column-id="timestamp">Timestamp</th>
|
|
<th data-column-id="rule">Rule</th>
|
|
<th data-column-id="details" data-sortable="false"></th>
|
|
<th data-column-id="hostname">Hostname</th>
|
|
<th data-column-id="ack_ico" data-sortable="false">ACK</th>
|
|
<th data-column-id="notes" data-sortable="false">Notes</th>
|
|
<th data-column-id="proc" data-sortable="false" data-visible="{{ $proc ? 'true' : 'false' }}">URL</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<script>
|
|
var alerts_grid = $("#alerts_{{ $id }}").bootgrid({
|
|
ajax: true,
|
|
post: function ()
|
|
{
|
|
return {
|
|
id: "alerts",
|
|
acknowledged: '{{ $acknowledged }}',
|
|
fired: '{{ $fired }}',
|
|
min_severity: '{{ $min_severity }}',
|
|
group: '{{ $group }}',
|
|
proc: '{{ $proc }}',
|
|
sort: '{{ $sort }}',
|
|
device_id: '{{ $device }}'
|
|
}
|
|
},
|
|
url: "ajax_table.php",
|
|
rowCount: [50, 100, 250, -1]
|
|
}).on("loaded.rs.jquery.bootgrid", function() {
|
|
alerts_grid = $(this);
|
|
alerts_grid.find(".incident-toggle").each( function() {
|
|
$(this).parent().addClass('incident-toggle-td');
|
|
}).on("click", function(e) {
|
|
var target = $(this).data("target");
|
|
$(target).collapse('toggle');
|
|
$(this).toggleClass('fa-plus fa-minus');
|
|
});
|
|
alerts_grid.find(".incident").each( function() {
|
|
$(this).parent().addClass('col-lg-4 col-md-4 col-sm-4 col-xs-4');
|
|
$(this).parent().parent().on("mouseenter", function() {
|
|
$(this).find(".incident-toggle").fadeIn(200);
|
|
}).on("mouseleave", function() {
|
|
$(this).find(".incident-toggle").fadeOut(200);
|
|
});
|
|
});
|
|
alerts_grid.find(".command-ack-alert").on("click", function(e) {
|
|
e.preventDefault();
|
|
var alert_state = $(this).data("alert_state");
|
|
var alert_id = $(this).data('alert_id');
|
|
$('#ack_alert_id').val(alert_id);
|
|
$('#ack_alert_state').val(alert_state);
|
|
$('#ack_msg').val('');
|
|
$("#alert_ack_modal").modal('show');
|
|
});
|
|
alerts_grid.find(".command-alert-note").on("click", function(e) {
|
|
e.preventDefault();
|
|
var alert_id = $(this).data('alert_id');
|
|
$('#alert_id').val(alert_id);
|
|
$("#alert_notes_modal").modal('show');
|
|
});
|
|
});
|
|
</script>
|