mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-16 18:50:20 +00:00
aio-interface: show sub-steps for starting containers
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
e9108e3660
commit
b51943d8a1
5 changed files with 127 additions and 0 deletions
27
php/public/overlay-log.js
Normal file
27
php/public/overlay-log.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
function displayOverlayLogMessage(message) {
|
||||
const overlayLogElement = document.getElementById('overlay-log');
|
||||
if (!overlayLogElement) {
|
||||
return;
|
||||
}
|
||||
overlayLogElement.textContent = message;
|
||||
}
|
||||
|
||||
// Attempt to connect to Server-Sent Events at /events/containers and listen for 'container-start' events
|
||||
if (typeof EventSource !== 'undefined') {
|
||||
try {
|
||||
const serverSentEventSource = new EventSource('events/containers');
|
||||
serverSentEventSource.addEventListener('container-start', function(serverSentEvent) {
|
||||
try {
|
||||
let parsedPayload = JSON.parse(serverSentEvent.data);
|
||||
displayOverlayLogMessage(parsedPayload.name || serverSentEvent.data);
|
||||
} catch (parseError) {
|
||||
displayOverlayLogMessage(serverSentEvent.data);
|
||||
}
|
||||
});
|
||||
serverSentEventSource.onerror = function() { serverSentEventSource.close(); };
|
||||
} catch (connectionError) {
|
||||
/* ignore if Server-Sent Events are not available */
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue