This commit is contained in:
2026-03-07 22:50:23 +01:00
parent 706917ec7c
commit 9c45696765

View File

@@ -353,29 +353,37 @@
}
return;
}
const activeIframe = getActiveIframe();
if (!activeIframe) {
if (consoleNotice) {
consoleNotice.textContent = 'Keine aktive Konsole es wird eine neue Konsole geöffnet.';
consoleNotice.style.display = 'block';
}
submitOpen();
return;
}
const formData = new FormData(consoleForm);
if (presetSelect) formData.set('terminal_preset_id', '');
const url = new URL(window.location.href);
url.searchParams.set('send_active_json', '1');
url.searchParams.set('open_console_json', '1');
fetch(url.toString(), { method: 'POST', body: formData, cache: 'no-store' })
.then((res) => res.json())
.then((data) => {
if (data.ok) {
if (!data.ok) {
if (consoleNotice) {
consoleNotice.textContent = data.notice || 'Befehl wurde in der bestehenden Konsole ausgeführt.';
consoleNotice.textContent = data.error || 'Befehl konnte nicht ausgeführt werden.';
consoleNotice.style.display = 'block';
}
if (consoleError) consoleError.style.display = 'none';
return;
}
if (consoleNotice) {
consoleNotice.textContent = data.error || 'Befehl konnte nicht in der bestehenden Konsole ausgeführt werden.';
consoleNotice.style.display = 'block';
if (data.url) {
activeIframe.src = data.url;
}
if (consoleError) consoleError.style.display = 'none';
})
.catch(() => {
if (consoleNotice) {
consoleNotice.textContent = 'Befehl konnte nicht in der bestehenden Konsole ausgeführt werden.';
consoleNotice.textContent = 'Befehl konnte nicht ausgeführt werden.';
consoleNotice.style.display = 'block';
}
});