fix: save auto-refreshes cameras and switches to Live Wall — no restart needed
This commit is contained in:
parent
e94d49253e
commit
9de8536bdf
1 changed files with 7 additions and 1 deletions
|
|
@ -326,8 +326,14 @@ document.getElementById('btn-save').addEventListener('click', async () => {
|
||||||
});
|
});
|
||||||
const j = await r.json();
|
const j = await r.json();
|
||||||
if (j.success) {
|
if (j.success) {
|
||||||
status.textContent = '✅ Configuration saved! Restart may be required.';
|
// Reload cameras from the server (in-memory config is now updated).
|
||||||
|
await loadCameras();
|
||||||
|
renderLiveGrid();
|
||||||
|
renderPlaybackCameras();
|
||||||
|
renderCameraCards();
|
||||||
|
status.textContent = '✅ Cameras saved! Switching to Live Wall...';
|
||||||
status.style.color = 'var(--green)';
|
status.style.color = 'var(--green)';
|
||||||
|
setTimeout(() => switchTab('live'), 800);
|
||||||
} else {
|
} else {
|
||||||
status.textContent = '❌ Save failed: ' + j.error;
|
status.textContent = '❌ Save failed: ' + j.error;
|
||||||
status.style.color = 'var(--red)';
|
status.style.color = 'var(--red)';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue