Files
librenms-librenms/html/pages/eventlog.inc.php

73 lines
1.7 KiB
PHP
Raw Normal View History

<?php
2015-07-13 20:10:26 +02:00
$no_refresh = true;
$param = array();
2015-07-13 20:10:26 +02:00
if ($vars['action'] == 'expunge' && $_SESSION['userlevel'] >= '10') {
dbQuery('TRUNCATE TABLE `eventlog`');
print_message('Event log truncated');
}
2015-07-13 20:10:26 +02:00
$pagetitle[] = 'Eventlog';
print_optionbar_start();
?>
<form method="post" action="" class="form-inline" role="form" id="result_form">
<div class="form-group">
<label>
<strong>Device</strong>
</label>
<select name="device" id="device" class="form-control input-sm">
<option value="">All Devices</option>
<?php
2015-07-13 20:10:26 +02:00
foreach (get_all_devices() as $hostname) {
$device_id = getidbyname($hostname);
if (device_permitted($device_id)) {
echo "<option value='".$device_id."'";
if ($device_id == $_POST['device']) {
echo 'selected';
}
echo '>'.$hostname.'</option>';
}
}
?>
</select>
</div>
<button type="submit" class="btn btn-default input-sm">Filter</button>
</form>
<?php
print_optionbar_end();
?>
<table id="eventlog" class="table table-hover table-condensed table-striped">
<thead>
<tr>
<th data-column-id="datetime" data-order="desc">Datetime</th>
<th data-column-id="hostname">Hostname</th>
<th data-column-id="type">Type</th>
<th data-column-id="message">Message</th>
</tr>
</thead>
</table>
<script>
var grid = $("#eventlog").bootgrid({
ajax: true,
post: function ()
{
return {
id: "eventlog",
2015-03-27 16:59:58 +00:00
device: '<?php echo htmlspecialchars($_POST['device']); ?>'
};
},
url: "/ajax_table.php"
});
</script>