Framework - Logging : when the default severity level is different than "Warning" because the application doesn't send anything else out, make sure to push these defaults via the controller. closes https://github.com/opnsense/core/pull/5472

In a future version we might want to be able to ship metadata per log view, in which case the service binding and defaults should be provided from there.
This commit is contained in:
Ad Schellevis 2022-01-07 18:24:40 +01:00
parent 88334b838a
commit b39b8f22c9
2 changed files with 11 additions and 1 deletions

View File

@ -44,6 +44,16 @@ class LogController extends IndexController
$service = $module == 'core' ? $scope : $module;
/* XXX manually hook different severity for specific cases */
switch ($service) {
case 'filter':
$this->view->default_log_severity = "Informational";
break;
default:
$this->view->default_log_severity = "Warning";
break;
}
/* XXX manually hook up known services for now */
switch ($service) {
case 'ipsec':

View File

@ -27,7 +27,7 @@
<script>
$( document ).ready(function() {
var filter_exact = false;
let s_filter_val = "Warning";
let s_filter_val = '{{default_log_severity}}';
s_header = '<a href="#"><i class="fa fa-toggle-off text-danger" id="exact_severity" title="{{ lang._('Toggle between range (max level) and exact severity filter') }}"></i> {{ lang._('Multiselect') }}</a>';
m_header = '<a href="#"><i class="fa fa-toggle-on text-success" id="exact_severity" title="{{ lang._('Toggle between range (max level) and exact severity filter') }}"></i> {{ lang._('Multiselect') }}</a>';
var page = 0;