Fix missing config handling and auto-restart after setup
This commit is contained in:
@@ -158,6 +158,16 @@
|
||||
}, 1000); // Check every second
|
||||
}
|
||||
|
||||
async function requestRestartAndWait() {
|
||||
showStatus('Перезапуск приложения...', 'info');
|
||||
try {
|
||||
await fetch('/api/restart', { method: 'POST' });
|
||||
} catch (e) {
|
||||
// Ignore network errors here: restart may break connection immediately.
|
||||
}
|
||||
checkServerReady();
|
||||
}
|
||||
|
||||
document.getElementById('setup-form').addEventListener('submit', async function(e) {
|
||||
e.preventDefault();
|
||||
showStatus('Сохранение настроек...', 'info');
|
||||
@@ -176,9 +186,8 @@
|
||||
|
||||
// Check if restart is required
|
||||
if (data.restart_required) {
|
||||
// In normal mode, restart must be done manually
|
||||
setTimeout(() => {
|
||||
showStatus('⚠️ Пожалуйста, перезапустите приложение вручную для применения изменений', 'warning');
|
||||
requestRestartAndWait();
|
||||
}, 2000);
|
||||
} else {
|
||||
// In setup mode, auto-restart is happening
|
||||
|
||||
Reference in New Issue
Block a user