mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: eventlog type variable collision (#5046)
This commit is contained in:
committed by
Neil Lathwood
parent
2aad2683b9
commit
6708c7cb81
@@ -22,6 +22,7 @@ var eventlog_grid = $("#eventlog").bootgrid({
|
||||
return {
|
||||
id: "eventlog",
|
||||
device: "' .mres($vars['device']) .'",
|
||||
eventtype: "' .mres($vars['eventtype']) .'",
|
||||
};
|
||||
},
|
||||
url: "ajax_table.php"
|
||||
|
@@ -7,9 +7,9 @@ if (is_numeric($_POST['device'])) {
|
||||
$param[] = $_POST['device'];
|
||||
}
|
||||
|
||||
if (!empty($_POST['type'])) {
|
||||
if (!empty($_POST['eventtype'])) {
|
||||
$where .= ' AND `E`.`type` = ?';
|
||||
$param[] = $_POST['type'];
|
||||
$param[] = $_POST['eventtype'];
|
||||
}
|
||||
|
||||
if ($_POST['string']) {
|
||||
@@ -58,7 +58,6 @@ foreach (dbFetchRows($sql, $param) as $eventlog) {
|
||||
$type = '<b>'.generate_port_link($this_if, makeshortif(strtolower($this_if['label']))).'</b>';
|
||||
} else {
|
||||
$type = $eventlog['type'];
|
||||
;
|
||||
}
|
||||
|
||||
$response[] = array(
|
||||
|
@@ -41,16 +41,16 @@ print_optionbar_start();
|
||||
<label>
|
||||
<strong>Type: </strong>
|
||||
</label>
|
||||
<select name="type" id="type" class="form-control input-sm">
|
||||
<select name="eventtype" id="eventtype" class="form-control input-sm">
|
||||
<option value="">All types</option>
|
||||
<?php
|
||||
|
||||
foreach (dbFetchRows("SELECT `type` FROM `eventlog` GROUP BY `type`") as $types) {
|
||||
echo '<option value="'.$types['type'].'"';
|
||||
if ($types['type'] === $_POST['type']) {
|
||||
foreach (dbFetchColumn("SELECT `type` FROM `eventlog` GROUP BY `type`") as $type) {
|
||||
echo "<option value='$type'";
|
||||
if ($type === $_POST['eventtype']) {
|
||||
echo ' selected';
|
||||
}
|
||||
echo '>'.$types['type'].'</option>';
|
||||
echo ">$type</option>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user