diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/LogController.php b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/LogController.php index 1994a2a0a..dd2633faf 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/LogController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/LogController.php @@ -40,6 +40,25 @@ class LogController extends IndexController $this->view->pick('OPNsense/Diagnostics/log'); $this->view->module = $module; $this->view->scope = $scope; + $this->view->service = ''; + + $service = $module == 'core' ? $scope : $module; + + /* XXX manually hook up known services for now */ + switch ($service) { + case 'ipsec': + $this->view->service = 'ipsec'; + break; + case 'suricata': + $this->view->service = 'ids'; + break; + case 'squid': + $this->view->service = 'proxy'; + break; + default: + /* no service API at the moment */ + break; + } } public function __call($name, $arguments) diff --git a/src/opnsense/mvc/app/views/OPNsense/Diagnostics/log.volt b/src/opnsense/mvc/app/views/OPNsense/Diagnostics/log.volt index c08064da6..0e4813884 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Diagnostics/log.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Diagnostics/log.volt @@ -65,7 +65,7 @@ } $('').attr('href',download_link).get(0).click(); }); - + updateServiceControlUI('{{service}}'); }); diff --git a/src/opnsense/www/js/opnsense_ui.js b/src/opnsense/www/js/opnsense_ui.js index 536f48784..66758392e 100644 --- a/src/opnsense/www/js/opnsense_ui.js +++ b/src/opnsense/www/js/opnsense_ui.js @@ -93,7 +93,7 @@ function saveFormToEndpoint(url, formid, callback_ok, disable_dialog, callback_f if ( callback_fail !== undefined ) { // execute callback function callback_fail(data); - } + } } else if ( callback_ok !== undefined ) { // execute callback function callback_ok(data); @@ -169,6 +169,10 @@ function updateServiceStatusUI(status) */ function updateServiceControlUI(serviceName) { + if (serviceName == '') { + return; + } + ajaxCall("/api/" + serviceName + "/service/status", {}, function(data) { let status_html = '