sync: add cross-subsystem event bus for config consistency
Add EventBus with loop guards to keep firewall, dnsmasq, wireguard, and network configs consistent. Handlers emit SyncEvent after mutations; subscribers compute diffs and write JSON without manual cascade loops.
This commit is contained in:
@@ -182,7 +182,13 @@ export default definePage({
|
||||
'on:click': async () => {
|
||||
const res = await apiFetch('/api/dhcp/apply', { method: 'POST' });
|
||||
if (res.ok) {
|
||||
toast('dnsmasq applied', 'success');
|
||||
const synced = res.data?.synced;
|
||||
let msg = 'dnsmasq applied';
|
||||
if (synced && synced.length) {
|
||||
msg += ' (auto-synced: ' + synced.join(', ') + ')';
|
||||
synced.forEach(s => modelFetch(s));
|
||||
}
|
||||
toast(msg, 'success');
|
||||
modelFetch('dnsmasq');
|
||||
} else {
|
||||
toast(res.error || 'Apply failed', 'error');
|
||||
|
||||
Reference in New Issue
Block a user