CONSOLE
This commit is contained in:
@@ -330,7 +330,6 @@
|
|||||||
|
|
||||||
const openBtn = consoleForm.querySelector('[data-open-console]');
|
const openBtn = consoleForm.querySelector('[data-open-console]');
|
||||||
const runBtn = consoleForm.querySelector('[data-run-command]');
|
const runBtn = consoleForm.querySelector('[data-run-command]');
|
||||||
const sendBtn = consoleForm.querySelector('[data-send-active]');
|
|
||||||
if (openBtn) {
|
if (openBtn) {
|
||||||
openBtn.addEventListener('click', (e) => {
|
openBtn.addEventListener('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -343,51 +342,6 @@
|
|||||||
submitRun();
|
submitRun();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (sendBtn) {
|
// send-active removed
|
||||||
sendBtn.addEventListener('click', (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
if (!commandTextarea || !commandTextarea.value.trim()) {
|
|
||||||
if (consoleError) {
|
|
||||||
consoleError.textContent = 'Bitte zuerst einen Befehl eingeben.';
|
|
||||||
consoleError.style.display = 'block';
|
|
||||||
}
|
|
||||||
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('open_console_json', '1');
|
|
||||||
fetch(url.toString(), { method: 'POST', body: formData, cache: 'no-store' })
|
|
||||||
.then((res) => res.json())
|
|
||||||
.then((data) => {
|
|
||||||
if (!data.ok) {
|
|
||||||
if (consoleNotice) {
|
|
||||||
consoleNotice.textContent = data.error || 'Befehl konnte nicht ausgeführt werden.';
|
|
||||||
consoleNotice.style.display = 'block';
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (data.url) {
|
|
||||||
activeIframe.src = data.url;
|
|
||||||
}
|
|
||||||
if (consoleError) consoleError.style.display = 'none';
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
if (consoleNotice) {
|
|
||||||
consoleNotice.textContent = 'Befehl konnte nicht ausgeführt werden.';
|
|
||||||
consoleNotice.style.display = 'block';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -467,7 +467,10 @@ function sendToActiveConsole(array $host, string $command, bool $strictHostKey):
|
|||||||
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
<div style="display:flex; gap:10px; flex-wrap:wrap;">
|
||||||
<button class="cta-button" type="button" data-open-console>Neue Konsole öffnen</button>
|
<button class="cta-button" type="button" data-open-console>Neue Konsole öffnen</button>
|
||||||
<button class="nav-link" type="button" data-run-command>Im Hintergrund ausführen</button>
|
<button class="nav-link" type="button" data-run-command>Im Hintergrund ausführen</button>
|
||||||
<button class="nav-link" type="button" data-send-active>In bestehender Konsole ausführen</button>
|
<button class="icon-button queue-button" type="button" data-queue-button>
|
||||||
|
Queue
|
||||||
|
<span class="queue-badge" data-queue-count>0</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="muted" style="margin-top:.5rem;">
|
<div class="muted" style="margin-top:.5rem;">
|
||||||
@@ -491,16 +494,6 @@ function sendToActiveConsole(array $host, string $command, bool $strictHostKey):
|
|||||||
<p class="muted" style="margin-top:.5rem;">Mehrere Konsolen bleiben hier parallel offen.</p>
|
<p class="muted" style="margin-top:.5rem;">Mehrere Konsolen bleiben hier parallel offen.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card form-card" style="background:var(--panel-2);">
|
|
||||||
<div style="display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;">
|
|
||||||
<strong>Queue</strong>
|
|
||||||
<button class="icon-button queue-button" type="button" data-queue-button>
|
|
||||||
Queue
|
|
||||||
<span class="queue-badge" data-queue-count>0</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal" data-queue-modal aria-hidden="true">
|
<div class="modal" data-queue-modal aria-hidden="true">
|
||||||
<div class="modal-card">
|
<div class="modal-card">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|||||||
Reference in New Issue
Block a user