Fix WebSocket, add auto refresh on frontend update

This commit is contained in:
2025-06-19 19:05:53 +02:00
parent 34deaa1984
commit 7e45373846
887 changed files with 114282 additions and 2 deletions

20
ejs/footer.ejs Normal file
View File

@@ -0,0 +1,20 @@
<script>
let ws;
function connectWebSocket() {
const ws = new WebSocket((window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + window.location.pathname);
ws.onmessage = async (event) => {
if (event.data === 'update') {
location.reload();
}
};
ws.onclose = () => {
setTimeout(connectWebSocket, 5000);
};
}
connectWebSocket();
</script>