diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php b/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php index 246e34fdf..1df2cc065 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Proxy/Api/ServiceController.php @@ -148,4 +148,21 @@ class ServiceController extends ApiControllerBase return array("status" => "failed"); } } + + + /** + * fetch acls + * @return array + */ + public function fetchaclsAction() + { + if ($this->request->isPost()) { + $backend = new Backend(); + $response = $backend->configdRun("proxy fetchacls", true); + return array("response" => $response); + } else { + return array("response" => array()); + } + } + } diff --git a/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt b/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt index 9cad73cbf..a45345573 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt @@ -69,7 +69,39 @@ POSSIBILITY OF SUCH DAMAGE. if (status != "success" || data['status'] != 'ok') { BootstrapDialog.show({ type: BootstrapDialog.TYPE_WARNING, - title: "Error reconfiguring cron", + title: "Error reconfiguring proxy", + message: data['status'], + draggable: true + }); + } + }); + }); + + /** + * + * Download ACLs and reconfigure poxy - activate changes + */ + $("#fetchandreconfigureAct").click(function(){ + $("#fetchandreconfigureAct_progress").addClass("fa fa-spinner fa-pulse"); + ajaxCall(url="/api/proxy/service/fetchacls", sendData={}, callback=function(data,status) { + + if (status != "success" || data['status'] != 'ok') { + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_WARNING, + title: "Error fetching remote acls", + message: data['status'], + draggable: true + }); + } + }); + ajaxCall(url="/api/proxy/service/reconfigure", sendData={}, callback=function(data,status) { + // when done, disable progress animation. + $("#fetchandreconfigureAct_progress").removeClass("fa fa-spinner fa-pulse"); + + if (status != "success" || data['status'] != 'ok') { + BootstrapDialog.show({ + type: BootstrapDialog.TYPE_WARNING, + title: "Error reconfiguring proxy", message: data['status'], draggable: true }); @@ -228,6 +260,8 @@ POSSIBILITY OF SUCH DAMAGE.

+ +