Fixed search & device eventlog (#9329)

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.

In #9252 search box and inside device eventlog where broken.

Noticed in https://community.librenms.org/t/bug-set-filter-in-device-eventlog-shows-filtered-events-from-all-devices/5633

I hope my fix does the job :)
This commit is contained in:
TheGreatDoc
2018-10-17 09:44:04 +02:00
committed by Neil Lathwood
parent 3fc9e334b8
commit 4a23f8dddd
2 changed files with 5 additions and 1 deletions

View File

@@ -58,6 +58,10 @@ class EventlogController extends TableController
$query->where('type', $type);
}
if ($searchPhrase = $request->get('searchPhrase')) {
$query->where('message', 'like', '%'.$searchPhrase.'%');
}
return $query;
}

View File

@@ -55,7 +55,7 @@ $pagetitle[] = 'Eventlog';
'</div>&nbsp;&nbsp;&nbsp;&nbsp;' +
<?php
} else {
echo "'&nbsp;&nbsp;<input type=\"hidden\" name=\"device\" id=\"device\" value=\"" . $device_id . "\">' + ";
echo "'&nbsp;&nbsp;<input type=\"hidden\" name=\"device\" id=\"device\" value=\"" . $vars['device'] . "\">' + ";
}
?>
'<div class="form-group"><label><strong>Type&nbsp;&nbsp;</strong></label>' +