mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/haproxy: sync service start
PR: https://github.com/opnsense/core/issues/1954
This commit is contained in:
+7
-1
@@ -46,8 +46,10 @@ class ServiceController extends ApiControllerBase
|
||||
public function startAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("haproxy start", true);
|
||||
$response = $backend->configdRun("haproxy start");
|
||||
return array("response" => $response);
|
||||
} else {
|
||||
return array("response" => array());
|
||||
@@ -61,6 +63,8 @@ class ServiceController extends ApiControllerBase
|
||||
public function stopAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("haproxy stop");
|
||||
return array("response" => $response);
|
||||
@@ -76,6 +80,8 @@ class ServiceController extends ApiControllerBase
|
||||
public function restartAction()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
$response = $backend->configdRun("haproxy restart");
|
||||
return array("response" => $response);
|
||||
|
||||
@@ -41,8 +41,6 @@ class IndexController extends \OPNsense\Base\IndexController
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
// set page title
|
||||
$this->view->title = gettext("HAProxy Load Balancer");
|
||||
// include form definitions
|
||||
$this->view->mainForm = $this->getForm("main");
|
||||
$this->view->formDialogFrontend = $this->getForm("dialogFrontend");
|
||||
|
||||
@@ -37,7 +37,6 @@ class StatisticsController extends \OPNsense\Base\IndexController
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->title = gettext("HAProxy Load Balancer / Statistics");
|
||||
// choose template
|
||||
$this->view->pick('OPNsense/HAProxy/statistics');
|
||||
}
|
||||
|
||||
@@ -352,12 +352,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
draggable: true
|
||||
});
|
||||
} else {
|
||||
// request service status after successful save and update status box (wait a few seconds before update)
|
||||
setTimeout(function(){
|
||||
ajaxCall(url="/api/haproxy/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
},3000);
|
||||
ajaxCall(url="/api/haproxy/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user