/** * ConsoleView — Linux Terminal Simulation for OTRS Turbo * Shortcut: Ctrl + Alt + T */ const ConsoleView = { isOpen: false, history: [], historyIndex: -1, currentTheme: 'dark', // dark, green, amber, cyber activeAnimation: null, toggle() { if (this.isOpen) { this.close(); } else { this.open(); } }, open() { let modal = document.getElementById('linux-console-modal'); if (!modal) { this.createModal(); modal = document.getElementById('linux-console-modal'); } modal.style.display = 'flex'; this.isOpen = true; const input = document.getElementById('console-input'); if (input) { input.focus(); } }, close() { const modal = document.getElementById('linux-console-modal'); if (modal) { modal.style.display = 'none'; } this.stopAnimation(); this.isOpen = false; }, createModal() { const overlay = document.createElement('div'); overlay.id = 'linux-console-modal'; overlay.className = 'console-modal-overlay theme-dark'; overlay.innerHTML = `
____ _____ ____ ____ _____ _ _ ____ ____ ___
/ ___|_ _| _ \\/ ___| |_ _| | | | _ \\/ __ ) / _ \\
| | | | | |_) \\___ \\ | | | | | | |_) | _ \\| | | |
| |___ | | | _ < ___) | | | | |_| | _ <| |_) | |_| |
\\____| |_| |_| \\_\\____/ |_| \\___/|_| \\_\\____/ \\___/
${lines}`);
},
async cmdNeofetch() {
let ticketStats = { total: 0, open: 0 };
try {
const data = await App.api('/api/tickets/stats');
if (data) {
ticketStats.total = data.total_tickets || data.total || 0;
ticketStats.open = data.open_tickets || data.open || 0;
}
} catch (e) {}
const agent = App.activeAgent || 'gabriele.cimaschi';
const html = `
██████╗ ████████╗██████╗ ██████╗
██╔═══██╗╚══██╔══╝██╔══██╗██╔════╝
██║ ██║ ██║ ██████╔╝╚█████╗
██║ ██║ ██║ ██╔══██╗ ╚═══██╗
╚██████╔╝ ██║ ██║ ██║██████╔╝
╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═════╝
⚡ T U R B O E N G I N E
| TN | Titolo | Stato | Coda | Cliente |
|---|---|---|---|---|
| #${App.escapeHtml(t.tn)} | ${App.escapeHtml((t.title || '').substring(0, 35))} | ${App.escapeHtml(t.state_name || '')} | ${App.escapeHtml(t.queue_name || '')} | ${App.escapeHtml(t.customer_first ? `${t.customer_first} ${t.customer_last}` : (t.customer_user_id || '—'))} |