Commit b46bbe02 authored by Jos Schellevis's avatar Jos Schellevis

(proxy) wip adding download option

parent a8b9a6bc
...@@ -148,4 +148,21 @@ class ServiceController extends ApiControllerBase ...@@ -148,4 +148,21 @@ class ServiceController extends ApiControllerBase
return array("status" => "failed"); 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());
}
}
} }
...@@ -69,7 +69,39 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -69,7 +69,39 @@ POSSIBILITY OF SUCH DAMAGE.
if (status != "success" || data['status'] != 'ok') { if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({ BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING, 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'], message: data['status'],
draggable: true draggable: true
}); });
...@@ -228,6 +260,8 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -228,6 +260,8 @@ POSSIBILITY OF SUCH DAMAGE.
<div class="col-md-12"> <div class="col-md-12">
<hr/> <hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>Apply</b><i id="reconfigureAct_progress" class=""></i></button> <button class="btn btn-primary" id="reconfigureAct" type="button"><b>Apply</b><i id="reconfigureAct_progress" class=""></i></button>
<button class="btn btn-primary" id="fetchandreconfigureAct" type="button"><b>Download ACLs & Apply</b><i id="fetchandreconfigureAct_progress" class=""></i></button>
<button class="btn btn-primary" id="ScheduleAct" type="button"><b>Schedule with Cron</b><i id="scheduleAct_progress" class=""></i></button>
</div> </div>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment