cambios y estilos; terminal
This commit is contained in:
parent
0c89f4a144
commit
873c8851b5
|
|
@ -221,7 +221,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEW: Cancel Button
|
// Cancel Button
|
||||||
btnCancelDownload.addEventListener('click', () => {
|
btnCancelDownload.addEventListener('click', () => {
|
||||||
if(confirm('⚠️ Are you completely sure you want to CANCEL the ongoing download?\n\nIncomplete files will be wiped from your hard drive.')) {
|
if(confirm('⚠️ Are you completely sure you want to CANCEL the ongoing download?\n\nIncomplete files will be wiped from your hard drive.')) {
|
||||||
btnCancelDownload.disabled = true;
|
btnCancelDownload.disabled = true;
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,30 @@
|
||||||
|
|
||||||
<div class="card bg-dark text-light mb-4 p-3 border-secondary shadow-sm">
|
<div class="card bg-dark text-light mb-4 p-3 border-secondary shadow-sm">
|
||||||
<label for="raw-command" class="form-label text-warning fw-bold">Execute "New Maps" shell command:</label>
|
<label for="raw-command" class="form-label text-warning fw-bold">Execute "New Maps" shell command:</label>
|
||||||
<textarea id="raw-command" class="form-control bg-secondary text-light border-0 mb-3" rows="1" placeholder="e.g.: sudo /opt/iiab/maps/..."></textarea>
|
<div class="row g-2 align-items-stretch">
|
||||||
<div class="d-grid gap-2">
|
<div class="col-12 col-md-10">
|
||||||
<button id="btn-start" class="btn btn-primary">Start</button>
|
<textarea id="raw-command" class="form-control bg-secondary text-light border-0 h-100" rows="2" style="resize: none;" placeholder="e.g.: sudo /opt/iiab/maps/..."></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md-2">
|
||||||
|
<button id="btn-start" class="btn btn-primary w-100 h-100 fw-bold">Start</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="terminal" style="background-color: #000; color: #0f0; height: 250px; overflow-y: auto; padding: 10px; font-family: monospace; border-radius: 5px; white-space: pre-wrap; margin-bottom: 15px;">Waiting for commands...</div>
|
<div id="maps-terminal-container" class="position-relative mb-4">
|
||||||
|
<div id="terminal" style="background-color: #000; color: #0f0; height: 250px; overflow-y: auto; padding: 10px; font-family: monospace; border-radius: 5px; white-space: pre-wrap; margin-bottom: 15px;">Waiting for commands...</div>
|
||||||
|
|
||||||
|
<div class="collapse-btn-container d-flex justify-content-center">
|
||||||
|
<button id="btn-toggle-maps-terminal" class="btn btn-sm btn-dark border-secondary text-secondary" style="border-radius: 20px; padding: 2px 15px;">▲ Hide Terminal</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="controls-yn" class="card bg-dark border-warning p-3 hidden-section shadow mb-4">
|
<div id="controls-yn" class="card bg-dark border-warning p-3 hidden-section shadow mb-4">
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<span class="text-warning fw-bold">⚠️ The system requires your confirmation to continue:</span>
|
<span class="text-warning fw-bold">⚠️ The system requires your confirmation to continue:</span>
|
||||||
<div>
|
<div>
|
||||||
<button id="btn-yes" class="btn btn-success me-2 px-4">Yes (y)</button>
|
<button id="btn-yes" class="btn btn-success me-2 px-4">Yes</button>
|
||||||
<button id="btn-no" class="btn btn-danger px-4">No (n)</button>
|
<button id="btn-no" class="btn btn-danger px-4">No</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -43,6 +53,28 @@
|
||||||
const rawCommandInput = document.getElementById('raw-command');
|
const rawCommandInput = document.getElementById('raw-command');
|
||||||
const controlsYN = document.getElementById('controls-yn');
|
const controlsYN = document.getElementById('controls-yn');
|
||||||
|
|
||||||
|
// Logic for Hiding/Showing Map Terminal
|
||||||
|
let mapsTerminalVisible = true;
|
||||||
|
const btnToggleMapsTerminal = document.getElementById('btn-toggle-maps-terminal');
|
||||||
|
|
||||||
|
btnToggleMapsTerminal.addEventListener('click', (e) => {
|
||||||
|
if(mapsTerminalVisible) {
|
||||||
|
terminal.style.display = 'none';
|
||||||
|
e.target.textContent = '▼ Show Terminal';
|
||||||
|
} else {
|
||||||
|
terminal.style.display = 'block';
|
||||||
|
e.target.textContent = '▲ Hide Terminal';
|
||||||
|
}
|
||||||
|
mapsTerminalVisible = !mapsTerminalVisible;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Extra function to force the display of errors or new processes
|
||||||
|
function forceShowMapsTerminal() {
|
||||||
|
terminal.style.display = 'block';
|
||||||
|
btnToggleMapsTerminal.textContent = '▲ Hide Terminal';
|
||||||
|
mapsTerminalVisible = true;
|
||||||
|
}
|
||||||
|
|
||||||
function printToTerminal(text) {
|
function printToTerminal(text) {
|
||||||
terminal.textContent += text;
|
terminal.textContent += text;
|
||||||
terminal.scrollTop = terminal.scrollHeight;
|
terminal.scrollTop = terminal.scrollHeight;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue