mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
web proxy: synchronous service start, no delay, session closed for #1954
This commit is contained in:
parent
91c8493068
commit
7ccfe1ba9f
@ -45,8 +45,11 @@ 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("proxy start", true);
|
||||
$response = $backend->configdRun("proxy start");
|
||||
return array("response" => $response);
|
||||
} else {
|
||||
return array("response" => array());
|
||||
@ -60,6 +63,9 @@ 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("proxy stop");
|
||||
return array("response" => $response);
|
||||
@ -75,6 +81,9 @@ 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("proxy restart");
|
||||
return array("response" => $response);
|
||||
@ -108,7 +117,6 @@ class ServiceController extends ApiControllerBase
|
||||
$status = "unkown";
|
||||
}
|
||||
|
||||
|
||||
return array("status" => $status);
|
||||
}
|
||||
|
||||
|
||||
@ -169,12 +169,10 @@ 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/proxy/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
},3000);
|
||||
// request service status after successful save and update status box
|
||||
ajaxCall(url="/api/proxy/service/status", sendData={}, callback=function(data,status) {
|
||||
updateServiceStatusUI(data['status']);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user