source/templates/index.html aktualisiert
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user