From ed7b4c771bd9ee081c6e361b1b34756b087a769b Mon Sep 17 00:00:00 2001 From: "info@pi-farm.de" Date: Thu, 12 Mar 2026 15:50:45 +0000 Subject: [PATCH] source/templates/index.html aktualisiert --- source/templates/index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/templates/index.html b/source/templates/index.html index 03a2e35..e89e4b7 100644 --- a/source/templates/index.html +++ b/source/templates/index.html @@ -292,6 +292,8 @@ let currentSettings = {}; let termDataDisposable = null; let term, fitAddon; + const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + const wsHost = window.location.host; // 1. CHAT LOGIK 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) => { const div = document.createElement('div'); div.textContent = `> ${ev.data}`; @@ -515,7 +517,7 @@ 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"); initChat(chatWs); @@ -553,7 +555,7 @@ term.clear(); 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 = () => { // Initiale Größe nach dem Verbinden senden