mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 11:04:42 +00:00
system: missing control widget from log pages
Just as a POC shuffle known service controllers into the page making sure to correctly translate their names. Can't be the final state but it's a start. Should probably move all service monitoring to a separate API under the "correct" (well, "matching" anyway) name.
This commit is contained in:
parent
7ac50f9f8d
commit
5d6aff7af2
@ -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)
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
}
|
||||
$('<a></a>').attr('href',download_link).get(0).click();
|
||||
});
|
||||
|
||||
updateServiceControlUI('{{service}}');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -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 = '<span class="label label-opnsense label-opnsense-sm ';
|
||||
let status_icon = '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user