diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/InterfaceController.php b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/InterfaceController.php index 7404eb43f..61132dcca 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/InterfaceController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/InterfaceController.php @@ -75,6 +75,21 @@ class InterfaceController extends ApiControllerBase return $arptable; } + /** + * retrieve system arp table contents + * @return array + */ + public function flushArpAction() + { + if ($this->request->isPost()) { + $backend = new Backend(); + $response = $backend->configdpRun("interface flush arp"); + return $response; + } else { + return array("message" => "error"); + } + } + /** * retrieve system ndp table contents * @return array diff --git a/src/opnsense/mvc/app/views/OPNsense/Diagnostics/arp.volt b/src/opnsense/mvc/app/views/OPNsense/Diagnostics/arp.volt index 49ef1c10f..ba37c7fa6 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Diagnostics/arp.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Diagnostics/arp.volt @@ -61,7 +61,28 @@ POSSIBILITY OF SUCH DAMAGE. } ); } - + + $("#flushModal").click(function(event){ + BootstrapDialog.show({ + type:BootstrapDialog.TYPE_DANGER, + title: "", + message: "", + buttons: [{ + label: "", + action: function(dialogRef) { + dialogRef.close(); + }}, { + label: "", + action: function(dialogRef) { + ajaxCall(url = "/api/diagnostics/interface/flushArp", + sendData = {}, callback = function (data, status) { + $("#refresh").click(); + }); + } + }] + }); // end BootstrapDialog.show + }); // end .click(function(event) + // initial fetch $("#refresh").click(updateARP); $("#refresh").click(); @@ -96,6 +117,10 @@ POSSIBILITY OF SUCH DAMAGE.
+