Commit 7c82fe62 authored by Ad Schellevis's avatar Ad Schellevis

(hassync) trigger xmlrpc sync before service action, for...

(hassync) trigger xmlrpc sync before service action, for https://github.com/opnsense/core/issues/1217
parent b27e0269
...@@ -97,6 +97,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { ...@@ -97,6 +97,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
xmlrpc_exec('opnsense.configd_reload_all_templates'); xmlrpc_exec('opnsense.configd_reload_all_templates');
echo json_encode(array("status" => "done")); echo json_encode(array("status" => "done"));
break; break;
case 'exec_sync':
configd_run('filter sync load');
echo json_encode(array("status" => "done"));
break;
} }
} }
exit; exit;
...@@ -155,6 +159,7 @@ include("head.inc"); ...@@ -155,6 +159,7 @@ include("head.inc");
} }
// reload all templates first // reload all templates first
$("#action_templates").show(); $("#action_templates").show();
$.post(window.location, {action: 'exec_sync'}, function(data) {
$.post(window.location, {action: 'reload_templates'}, function(data) { $.post(window.location, {action: 'reload_templates'}, function(data) {
$("#action_templates").hide(); $("#action_templates").hide();
$("#action_templates_done").show(); $("#action_templates_done").show();
...@@ -162,6 +167,7 @@ include("head.inc"); ...@@ -162,6 +167,7 @@ include("head.inc");
}); });
}); });
}); });
});
</script> </script>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
......
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