From 397c56aa06c82d83e6afa3eb93f3890fa30e173c Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 8 May 2015 16:25:57 +0000 Subject: [PATCH] Proxy fix status check --- src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt | 12 +++++++----- src/opnsense/www/js/opnsense_ui.js | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt b/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt index f461b18b7..227970533 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Proxy/index.volt @@ -40,7 +40,7 @@ POSSIBILITY OF SUCH DAMAGE. $('.selectpicker').selectpicker('refresh'); // request service status on load and update status box ajaxCall(url="/api/proxy/service/status", sendData={}, callback=function(data,status) { - updateServiceStatusUI("proxy",data['responseText']); + updateServiceStatusUI(data['status']); }); }); @@ -68,10 +68,12 @@ POSSIBILITY OF SUCH DAMAGE. draggable: true }); } else { - // request service status after successful save and update status box - ajaxCall(url="/api/proxy/service/status", sendData={}, callback=function(data,status) { - updateServiceStatusUI("proxy",data['responseText']); - }); + // request service status after successful save and update status box (wait a few seconds before update) + setTimeout(function(){ + ajaxCall(url="/api/proxy/service/status", sendData={}, callback=function(data,status) { + updateServiceStatusUI(data['status']); + }); + },3000); } }); }); diff --git a/src/opnsense/www/js/opnsense_ui.js b/src/opnsense/www/js/opnsense_ui.js index eab71f956..c49557fbf 100644 --- a/src/opnsense/www/js/opnsense_ui.js +++ b/src/opnsense/www/js/opnsense_ui.js @@ -105,7 +105,7 @@ function mapDataToFormUI(data_get_map) { /** * update service status buttons in user interface */ -function updateServiceStatusUI(service, status) { +function updateServiceStatusUI(status) { var status_html = '';