source/templates/index.html aktualisiert

This commit is contained in:
2026-03-12 15:50:45 +00:00
parent 55ae56dee1
commit ed7b4c771b

View File

@@ -292,6 +292,8 @@
let currentSettings = {}; let currentSettings = {};
let termDataDisposable = null; let termDataDisposable = null;
let term, fitAddon; let term, fitAddon;
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsHost = window.location.host;
// 1. CHAT LOGIK // 1. CHAT LOGIK
function initChat(chatWs) { function initChat(chatWs) {
@@ -507,7 +509,7 @@
} }
}); });
const logWs = new WebSocket(`ws://${location.host}/ws/install_logs`); const logWs = new WebSocket(`${wsProtocol}//${wsHost}/ws/install_logs`);
logWs.onmessage = (ev) => { logWs.onmessage = (ev) => {
const div = document.createElement('div'); const div = document.createElement('div');
div.textContent = `> ${ev.data}`; div.textContent = `> ${ev.data}`;
@@ -515,7 +517,7 @@
document.getElementById('install-log').scrollTop = document.getElementById('install-log').scrollHeight; document.getElementById('install-log').scrollTop = document.getElementById('install-log').scrollHeight;
}; };
const chatWs = new WebSocket(`ws://${location.host}/ws/chat`); const chatWs = new WebSocket(`${wsProtocol}//${wsHost}/ws/chat`);
chatWs.onmessage = (ev) => appendChat("J.A.R.V.I.S.", ev.data, "text-blue-400 font-bold"); chatWs.onmessage = (ev) => appendChat("J.A.R.V.I.S.", ev.data, "text-blue-400 font-bold");
initChat(chatWs); initChat(chatWs);
@@ -553,7 +555,7 @@
term.clear(); term.clear();
fitAddon.fit(); // Einmal anpassen beim Öffnen fitAddon.fit(); // Einmal anpassen beim Öffnen
window.termWs = new WebSocket(`ws://${location.host}/ws/terminal/${ip}`); window.termWs = new WebSocket(`${wsProtocol}//${wsHost}/ws/terminal/${ip}`);
window.termWs.onopen = () => { window.termWs.onopen = () => {
// Initiale Größe nach dem Verbinden senden // Initiale Größe nach dem Verbinden senden