feat: enhance update progress handling and add WebSocket closure notification
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user