diff --git a/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/ServiceController.php b/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/ServiceController.php index c6ec78b56..7f5cf3b37 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/ServiceController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/IDS/Api/ServiceController.php @@ -311,4 +311,24 @@ class ServiceController extends ApiControllerBase return array(); } } + + /** + * drop alert log + * @return array status + */ + public function dropAlertLogAction() + { + if ($this->request->isPost()) { + // close session for long running action + $this->sessionClose(); + $backend = new Backend(); + $filename = $this->request->getPost('filename', 'string', null); + if ($filename != null) { + $filename = basename($filename); + $backend->configdpRun("ids drop alertlog", array($filename)); + return array("status" => "ok"); + } + } + return array("status" => "failed"); + } } diff --git a/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt b/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt index 5fc7dd4b2..f6e455db9 100644 --- a/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt +++ b/src/opnsense/mvc/app/views/OPNsense/IDS/index.volt @@ -69,9 +69,9 @@ POSSIBILITY OF SUCH DAMAGE. $('#alert-logfile').html(""); $.each(data, function(key, value) { if (value['sequence'] == undefined) { - $('#alert-logfile').append($("").attr("value",'none').text(value['modified'])); + $('#alert-logfile').append($("").attr("value",value['sequence']).text(value['modified'])); + $('#alert-logfile').append($("