Commit 168ec390 authored by Ad Schellevis's avatar Ad Schellevis

(ids) reload general settings after download (part 2)

parent 1e11b60a
......@@ -120,6 +120,29 @@ POSSIBILITY OF SUCH DAMAGE.
});
}
/**
* save (general) settings and reconfigure
*/
function actionReconfigure() {
saveFormToEndpoint(url="/api/ids/settings/set",formid='frm_GeneralSettings',callback_ok=function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/ids/service/reconfigure", sendData={}, callback=function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
updateStatus();
if (status != "success" || data['status'].toLowerCase().trim() != "ok") {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "Error reconfiguring IDS",
message: data['status'],
draggable: true
});
}
});
});
}
loadGeneralSettings();
updateStatus();
......@@ -217,23 +240,7 @@ POSSIBILITY OF SUCH DAMAGE.
* save settings and reconfigure ids
*/
$("#reconfigureAct").click(function(){
saveFormToEndpoint(url="/api/ids/settings/set",formid='frm_GeneralSettings',callback_ok=function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/ids/service/reconfigure", sendData={}, callback=function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
updateStatus();
if (status != "success" || data['status'].toLowerCase().trim() != "ok") {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "Error reconfiguring IDS",
message: data['status'],
draggable: true
});
}
});
});
actionReconfigure();
});
/**
......@@ -246,7 +253,11 @@ POSSIBILITY OF SUCH DAMAGE.
$("#updateRulesAct_progress").removeClass("fa fa-spinner fa-pulse");
$('#grid-rule-files').bootgrid('reload');
updateStatus();
loadGeneralSettings();
if ($('#scheduled_updates').is(':hidden') ){
// save and reconfigure on initial download (tries to create a cron job)
actionReconfigure();
loadGeneralSettings();
}
});
});
......
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