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-09-24 02:07:00 -05:00
|
|
|
use App\Models\Device;
|
2018-04-07 15:55:28 -05:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$no_refresh = true;
|
2018-09-24 02:07:00 -05:00
|
|
|
$param = [];
|
|
|
|
if ($device_id = (int)Request::get('device')) {
|
|
|
|
$device = Device::find($device_id);
|
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
|
2019-04-11 23:26:42 -05:00
|
|
|
require_once 'includes/html/common/eventlog.inc.php';
|
2017-12-24 21:56:24 +02:00
|
|
|
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">' +
|
2019-07-17 07:20:26 -05:00
|
|
|
'<?php echo csrf_field() ?>' +
|
2018-08-23 22:05:18 +02:00
|
|
|
<?php
|
|
|
|
if (!isset($vars['fromdevice'])) {
|
|
|
|
?>
|
2018-09-24 02:07:00 -05:00
|
|
|
'<div class="form-group">' +
|
2017-12-24 21:56:24 +02:00
|
|
|
'<label><strong>Device </strong></label>' +
|
2018-09-24 02:07:00 -05:00
|
|
|
'<select name="device" id="device" class="form-control">' +
|
2017-12-24 21:56:24 +02:00
|
|
|
'<option value="">All Devices</option>' +
|
2014-01-13 10:05:19 +00:00
|
|
|
<?php
|
2018-09-24 02:07:00 -05:00
|
|
|
if ($device instanceof Device) {
|
|
|
|
echo "'<option value=$device->device_id>" . $device->displayName() . "</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>' +
|
2018-09-24 02:07:00 -05:00
|
|
|
'</div> ' +
|
2018-08-23 22:05:18 +02:00
|
|
|
<?php
|
|
|
|
} else {
|
2018-10-17 09:44:04 +02:00
|
|
|
echo "' <input type=\"hidden\" name=\"device\" id=\"device\" value=\"" . $vars['device'] . "\">' + ";
|
2018-08-23 22:05:18 +02:00
|
|
|
}
|
|
|
|
?>
|
2017-12-24 21:56:24 +02:00
|
|
|
'<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
|
2018-09-24 02:07:00 -05:00
|
|
|
if ($type = Request::get('eventtype')) {
|
|
|
|
$js_type = addcslashes(htmlentities($type), "'");
|
|
|
|
echo "'<option value=\"$js_type\">$js_type</option>' +";
|
2017-12-24 21:56:24 +02:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
'</select>' +
|
|
|
|
'</div> ' +
|
2018-09-24 02:07:00 -05:00
|
|
|
'<button type="submit" class="btn btn-default">Filter</button>' +
|
2017-12-24 21:56:24 +02:00
|
|
|
'</form>' +
|
|
|
|
'</div>'
|
|
|
|
);
|
2018-09-24 02:07:00 -05:00
|
|
|
|
|
|
|
<?php if (!isset($vars['fromdevice'])) { ?>
|
|
|
|
$("#device").select2({
|
|
|
|
theme: 'bootstrap',
|
|
|
|
dropdownAutoWidth : true,
|
|
|
|
width: "auto",
|
|
|
|
allowClear: true,
|
|
|
|
placeholder: "All Devices",
|
|
|
|
ajax: {
|
2019-05-20 11:47:34 -05:00
|
|
|
url: '<?php echo url('/ajax/select/device'); ?>',
|
2018-09-24 02:07:00 -05:00
|
|
|
delay: 200
|
|
|
|
}
|
|
|
|
})<?php echo $device_id ? ".val($device_id).trigger('change');" : ''; ?>;
|
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
$("#eventtype").select2({
|
|
|
|
theme: 'bootstrap',
|
|
|
|
dropdownAutoWidth : true,
|
|
|
|
width: "auto",
|
|
|
|
allowClear: true,
|
|
|
|
placeholder: "All Types",
|
|
|
|
ajax: {
|
2019-05-20 11:47:34 -05:00
|
|
|
url: '<?php echo url('/ajax/select/eventlog'); ?>',
|
2018-09-24 02:07:00 -05:00
|
|
|
delay: 200,
|
|
|
|
data: function(params) {
|
|
|
|
return {
|
|
|
|
field: "type",
|
|
|
|
device: $('#device').val(),
|
|
|
|
term: params.term,
|
|
|
|
page: params.page || 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})<?php echo Request::get('eventtype') ? ".val('" . addcslashes(Request::get('eventtype'), "'") . "').trigger('change');" : ''; ?>;
|
|
|
|
|
2017-12-24 21:56:24 +02:00
|
|
|
</script>
|