2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2017-12-24 21:56:24 +02:00
|
|
|
/*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version. Please see LICENSE.txt at the top level of
|
|
|
|
* the source code distribution for details.
|
|
|
|
*
|
|
|
|
* @package LibreNMS
|
|
|
|
* @subpackage webui
|
|
|
|
* @link http://librenms.org
|
|
|
|
* @copyright 2017 LibreNMS
|
|
|
|
* @author LibreNMS Contributors
|
|
|
|
*/
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2018-04-07 15:55:28 -05:00
|
|
|
use LibreNMS\Authentication\Auth;
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$no_refresh = true;
|
2011-10-08 22:04:56 +00:00
|
|
|
$param = array();
|
|
|
|
|
2018-04-07 15:55:28 -05:00
|
|
|
if ($vars['action'] == 'expunge' && Auth::user()->hasGlobalAdmin()) {
|
2015-07-13 20:10:26 +02:00
|
|
|
dbQuery('TRUNCATE TABLE `eventlog`');
|
|
|
|
print_message('Event log truncated');
|
2011-10-08 22:04:56 +00:00
|
|
|
}
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$pagetitle[] = 'Eventlog';
|
2017-12-24 21:56:24 +02:00
|
|
|
?>
|
2011-10-18 14:41:19 +00:00
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
<div class="panel panel-default panel-condensed">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<strong>Eventlog</strong>
|
|
|
|
</div>
|
2011-10-08 22:04:56 +00:00
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
<?php
|
|
|
|
require_once 'includes/common/eventlog.inc.php';
|
|
|
|
echo implode('', $common_output);
|
|
|
|
?>
|
|
|
|
</div>
|
2011-10-08 22:04:56 +00:00
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
<script>
|
|
|
|
$('.actionBar').append(
|
|
|
|
'<div class="pull-left">' +
|
|
|
|
'<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>' +
|
2014-01-13 10:05:19 +00:00
|
|
|
<?php
|
2017-05-05 12:25:58 +01:00
|
|
|
foreach (get_all_devices() as $data) {
|
|
|
|
if (device_permitted($data['device_id'])) {
|
2017-12-24 21:56:24 +02:00
|
|
|
echo "'<option value=\"" . $data['device_id'] . "\"";
|
2017-05-05 12:25:58 +01:00
|
|
|
if ($data['device_id'] == $_POST['device']) {
|
2017-12-24 21:56:24 +02:00
|
|
|
echo ' selected';
|
2015-07-13 20:10:26 +02:00
|
|
|
}
|
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
echo ">" . format_hostname($data) . "</option>' + ";
|
2015-07-13 20:10:26 +02:00
|
|
|
}
|
|
|
|
}
|
2014-01-13 10:05:19 +00:00
|
|
|
?>
|
2017-12-24 21:56:24 +02:00
|
|
|
'</select>' +
|
|
|
|
'</div> ' +
|
|
|
|
'<div class="form-group"><label><strong>Type </strong></label>' +
|
|
|
|
'<select name="eventtype" id="eventtype" class="form-control input-sm">' +
|
|
|
|
'<option value="">All types</option>' +
|
|
|
|
<?php
|
2015-08-05 20:05:45 +00:00
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
foreach (dbFetchColumn("SELECT `type` FROM `eventlog` GROUP BY `type`") as $type) {
|
|
|
|
echo "'<option value=\"" . $type . "\"";
|
|
|
|
if ($type === $_POST['eventtype']) {
|
|
|
|
echo " selected";
|
|
|
|
}
|
|
|
|
echo ">" . $type . "</option>' + ";
|
|
|
|
}
|
2011-10-08 22:04:56 +00:00
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
?>
|
|
|
|
'</select>' +
|
|
|
|
'</div> ' +
|
|
|
|
'<button type="submit" class="btn btn-default input-sm">Filter</button>' +
|
|
|
|
'</form>' +
|
|
|
|
'</div>'
|
|
|
|
);
|
|
|
|
</script>
|
2015-03-27 16:28:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|