feat: enhance update progress handling and add WebSocket closure notification

This commit is contained in:
2025-02-22 18:19:21 +01:00
parent 4135073623
commit d2da501b94
2 changed files with 20 additions and 6 deletions

View File

@ -161,6 +161,7 @@
try {
const data = JSON.parse(event.data);
if (data.type === "updateProgress") {
progressContainer.style.display = 'block';
progress.style.width = data.progress + '%';
progress.textContent = data.progress + '%';
}
@ -169,6 +170,15 @@
}
};
ws.onclose = function() {
// Wenn der WebSocket geschlossen wird während eines Updates, zeige eine Nachricht
if (progressContainer.style.display !== 'none' && progress.style.width !== '100%') {
status.textContent = "Connection lost. Update may still be in progress...";
status.classList.add('warning');
status.style.display = 'block';
}
};
function handleUpdate(e) {
e.preventDefault();
const form = e.target;