454 lines
29 KiB
HTML
454 lines
29 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="pt-BR">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
<meta name="theme-color" content="#0284c7">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
<title>Maestri Remote — Supervisor Móvel</title>
|
|
<link rel="manifest" href="/manifest.json">
|
|
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
|
<link rel="stylesheet" href="/style.css">
|
|
<script>
|
|
(function() {
|
|
try {
|
|
var c = localStorage.getItem('maestri_ota_css');
|
|
if (c && c.length > 200) {
|
|
var s = document.createElement('style');
|
|
s.id = 'ota-live-css';
|
|
s.textContent = c;
|
|
document.head.appendChild(s);
|
|
}
|
|
} catch(e) {}
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="brand" id="brand-header" role="button" tabindex="0" title="Toque para ver a versão e dados do app">
|
|
<svg style="width:28px;height:28px;color:#38bdf8" viewBox="0 0 512 512" fill="none">
|
|
<rect width="512" height="512" rx="128" fill="#151e32"/>
|
|
<circle cx="256" cy="256" r="160" stroke="#0284c7" stroke-width="32" stroke-dasharray="32 20"/>
|
|
<path d="M180 256 L240 316 L340 196" stroke="#38bdf8" stroke-width="40" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
<h1>Maestri Remote</h1>
|
|
</div>
|
|
<div style="display:flex; align-items:center; gap:0.5rem">
|
|
<div id="user-badge" class="user-badge" style="display: none;">
|
|
<img id="user-avatar" class="user-avatar" src="" alt="" style="display: none;">
|
|
<span id="user-name" class="user-name"></span>
|
|
<button id="btn-auth-logout" class="btn-auth-logout" title="Sair da conta Google">Sair</button>
|
|
</div>
|
|
<div class="status-badge" id="status-badge" style="display: none;">
|
|
<span class="status-dot"></span>
|
|
<span id="status-text">Desconectado</span>
|
|
</div>
|
|
<button id="btn-logout" class="btn-logout" style="display:none;" title="Sair da sessão">
|
|
<svg style="width:16px;height:16px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
<!-- Tela 0: Login Obrigatório com Google SSO -->
|
|
<section id="auth-screen" class="auth-screen">
|
|
<div class="pin-icon">
|
|
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" />
|
|
</svg>
|
|
</div>
|
|
<h2>Entrar no Maestri Remote</h2>
|
|
<p>Faça login com sua conta Google para sincronizar suas estações entre dispositivos.</p>
|
|
<button id="btn-google-login" class="btn-google-login" type="button">
|
|
<svg class="google-icon" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true">
|
|
<path fill="#4285F4" d="M23.745 12.27c0-.7-.06-1.4-.19-2.07H12v4.51h6.6c-.29 1.52-1.14 2.82-2.4 3.68v3.05h3.88c2.27-2.09 3.665-5.17 3.665-9.17z"/>
|
|
<path fill="#34A853" d="M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.88-3.05c-1.08.72-2.45 1.16-4.05 1.16-3.12 0-5.77-2.11-6.72-4.96H1.29v3.14C3.26 21.3 7.31 24 12 24z"/>
|
|
<path fill="#FBBC05" d="M5.28 14.24c-.24-.72-.38-1.49-.38-2.24s.14-1.52.38-2.24V6.62H1.29C.47 8.24 0 10.06 0 12s.47 3.76 1.29 5.38l3.99-3.14z"/>
|
|
<path fill="#EA4335" d="M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.31 0 3.26 2.7 1.29 6.62l3.99 3.14c.95-2.85 3.6-4.96 6.72-4.96z"/>
|
|
</svg>
|
|
<span>Entrar com Google</span>
|
|
</button>
|
|
<p id="auth-status-text" class="auth-status-text" style="display: none;"></p>
|
|
<div style="margin-top: 2rem; border-top: 1px solid #334155; padding-top: 1rem; text-align: center; display: flex; flex-direction: column; gap: 0.5rem;">
|
|
<a href="/maestri-remote.apk" download style="color: #38bdf8; text-decoration: none; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;">
|
|
<svg style="width:16px;height:16px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
|
|
</svg>
|
|
Baixar APK Android (Instalação Inicial)
|
|
</a>
|
|
<a href="/maestri-agent.zip" download style="color: #94a3b8; text-decoration: none; font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;">
|
|
📦 Baixar Daemon para outra máquina (ZIP)
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Tela 1: Entrada do PIN -->
|
|
<section id="pin-screen" style="display: none;">
|
|
<div class="pin-icon">
|
|
<svg fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.75" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
|
|
</svg>
|
|
</div>
|
|
<h2>Acesso Remoto</h2>
|
|
<p>Digite o PIN de 6 dígitos gerado no terminal da sua máquina de desenvolvimento.</p>
|
|
<input type="text" id="pin-station-name-input" class="pin-input pin-station-name" placeholder="Apelido da estação (opcional, ex: Nitro, Note)" maxlength="24" autocomplete="off">
|
|
<input type="tel" id="pin-input" class="pin-input" maxlength="6" placeholder="000000" autocomplete="off">
|
|
<button id="btn-connect" class="btn-primary">Conectar</button>
|
|
<button id="btn-clear-stored" style="background:none;border:none;color:#64748b;font-size:0.75rem;cursor:pointer;margin-top:0.75rem;text-decoration:underline;padding:0.25rem;">Limpar PIN salvo</button>
|
|
<div style="margin-top: 2rem; border-top: 1px solid #334155; padding-top: 1rem; text-align: center; display: flex; flex-direction: column; gap: 0.5rem;">
|
|
<a href="/maestri-remote.apk" download style="color: #38bdf8; text-decoration: none; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;">
|
|
<svg style="width:16px;height:16px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
|
|
</svg>
|
|
Baixar APK Android (Instalação Inicial)
|
|
</a>
|
|
<a href="/maestri-agent.zip" download style="color: #94a3b8; text-decoration: none; font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;">
|
|
📦 Baixar Daemon para outra máquina (ZIP)
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Tela 2: App Ativo / Todas as Estações Agrupadas -->
|
|
<section id="app-screen" style="display: none;">
|
|
<!-- Barra Superior com Ações de Estações -->
|
|
<div class="stations-bar">
|
|
<div class="stations-bar-title">
|
|
<svg style="width:18px;height:18px;color:#38bdf8" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
|
|
</svg>
|
|
<span>Estações Conectadas</span>
|
|
<span id="stations-count-badge" class="stations-count-badge">0</span>
|
|
</div>
|
|
<div class="station-actions">
|
|
<button id="btn-add-station" class="btn-station-action btn-add" title="Conectar outra estação">+ Estação</button>
|
|
<button id="btn-logout-screen" class="btn-station-action btn-logout" title="Sair da sessão">Sair</button>
|
|
</div>
|
|
</div>
|
|
<select id="station-select" class="station-select" style="display: none;" aria-label="Selecione a estação ativa"></select>
|
|
|
|
<!-- Banner de ativação de notificações Push -->
|
|
<div class="push-banner" id="push-banner" style="display: none;">
|
|
<div>
|
|
<p><strong>Receber alertas no celular?</strong></p>
|
|
<span style="font-size: 0.75rem; color: #94a3b8;">Notifica quando um agente esperar aprovação.</span>
|
|
</div>
|
|
<button id="btn-enable-push" class="btn-sm">Ativar</button>
|
|
</div>
|
|
|
|
<!-- Container Principal com as Estações Agrupadas -->
|
|
<div id="stations-container" class="stations-container"></div>
|
|
|
|
<!-- Elementos para compatibilidade com testes e scripts legados -->
|
|
<div id="legacy-compat-container" style="display: none;">
|
|
<span id="machine-name">...</span>
|
|
<div id="agents-list"></div>
|
|
<div id="cards-container"></div>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<!-- Modal: Adicionar Nova Estação -->
|
|
<div id="modal-station" class="modal-backdrop" style="display: none;">
|
|
<div class="modal-card">
|
|
<div class="modal-header">
|
|
<h3>Adicionar Estação</h3>
|
|
<button id="btn-close-station-modal" class="btn-icon" onclick="window.closeStationModal && window.closeStationModal()" aria-label="Fechar Modal">×</button>
|
|
</div>
|
|
<p style="font-size: 0.8rem; color: #94a3b8; margin-bottom: 1rem;">Cadastre outra máquina de desenvolvimento (ex: Notebook, PC Secundário) informando o nome e o PIN.</p>
|
|
<form id="form-station" onsubmit="return false;">
|
|
<input type="text" id="station-name-input" class="modal-input" placeholder="Nome (ex: Notebook, PC 2)" maxlength="24" autocomplete="off">
|
|
<input type="tel" id="station-pin-input" class="modal-input" placeholder="PIN de 6 dígitos" maxlength="8" autocomplete="off" required>
|
|
<div style="display: flex; gap: 0.5rem; margin-top: 1rem;">
|
|
<button type="submit" id="btn-save-station" class="btn-primary" style="flex: 1; padding: 0.75rem;">Conectar Estação</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal: Informações de Versão do App -->
|
|
<div id="modal-version" class="modal-backdrop" style="display: none;">
|
|
<div class="modal-card">
|
|
<div class="modal-header">
|
|
<div style="display: flex; align-items: center; gap: 0.5rem;">
|
|
<svg style="width:20px;height:20px;color:#38bdf8" viewBox="0 0 512 512" fill="none">
|
|
<rect width="512" height="512" rx="128" fill="#151e32"/>
|
|
<circle cx="256" cy="256" r="160" stroke="#0284c7" stroke-width="32" stroke-dasharray="32 20"/>
|
|
<path d="M180 256 L240 316 L340 196" stroke="#38bdf8" stroke-width="40" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
<h3 style="margin: 0; font-size: 1.05rem;">Sobre o Maestri Remote</h3>
|
|
</div>
|
|
<button id="btn-close-version-modal" class="btn-icon" aria-label="Fechar Modal">×</button>
|
|
</div>
|
|
|
|
<div class="version-info-box">
|
|
<div class="version-row">
|
|
<span class="version-label">Aplicativo</span>
|
|
<span class="version-value">Maestri Remote</span>
|
|
</div>
|
|
<div class="version-row">
|
|
<span class="version-label">Versão</span>
|
|
<span class="version-value highlight" id="app-version-val">v1.0.2</span>
|
|
</div>
|
|
<div class="version-row">
|
|
<span class="version-label">Build ID</span>
|
|
<span class="version-value code" id="app-build-val">Carregando...</span>
|
|
</div>
|
|
<div class="version-row">
|
|
<span class="version-label">Data e Hora</span>
|
|
<span class="version-value" id="app-date-val">Carregando...</span>
|
|
</div>
|
|
<div class="version-row" id="app-checksum-row" style="display: none;">
|
|
<span class="version-label">Checksum</span>
|
|
<span class="version-value code-small" id="app-checksum-val">-</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin-top: 0.85rem; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 0.85rem;">
|
|
<a id="btn-download-apk" href="/maestri-remote.apk" download="maestri-remote.apk" target="_blank" style="display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.4); color: #38bdf8; padding: 0.7rem; border-radius: 10px; text-decoration: none; font-size: 0.85rem; font-weight: 600; text-align: center;">
|
|
<svg style="width:18px;height:18px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
|
|
</svg>
|
|
Baixar APK v1.0.2 (Microfone & Câmera)
|
|
</a>
|
|
<p style="font-size: 0.72rem; color: #94a3b8; margin-top: 0.45rem; line-height: 1.35; text-align: center;">
|
|
⚠️ <strong>Atenção:</strong> Permissões de Microfone e Câmera no Android exigem a instalação do APK v1.0.2 (permissões de hardware não podem ser liberadas via OTA).
|
|
</p>
|
|
</div>
|
|
|
|
<div style="margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem;">
|
|
<button id="btn-check-update-manual" class="btn-primary" style="width: 100%; padding: 0.75rem; font-size: 0.88rem;">Verificar Atualização</button>
|
|
<button id="btn-force-reload" class="btn-secondary" style="width: 100%; padding: 0.6rem; font-size: 0.8rem; background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 8px; cursor: pointer;">Limpar Cache e Forçar Atualização</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal: Visualização e Download de Arquivo -->
|
|
<div id="file-preview-modal" class="modal-backdrop" style="display: none;">
|
|
<div class="modal-card file-preview-card">
|
|
<div class="modal-header">
|
|
<div style="display: flex; align-items: center; gap: 0.5rem; overflow: hidden;">
|
|
<span style="font-size: 1.2rem; flex-shrink: 0;" id="file-preview-icon">📄</span>
|
|
<div style="overflow: hidden;">
|
|
<h3 id="file-preview-title" style="margin: 0; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">arquivo.ext</h3>
|
|
<span id="file-preview-meta" style="font-size: 0.72rem; color: #94a3b8;">0 KB • text/plain</span>
|
|
</div>
|
|
</div>
|
|
<button id="btn-close-file-preview" class="btn-icon" aria-label="Fechar">×</button>
|
|
</div>
|
|
|
|
<div class="file-preview-body" id="file-preview-body">
|
|
<!-- Conteúdo do arquivo renderizado via JS -->
|
|
</div>
|
|
|
|
<div class="file-preview-actions">
|
|
<button type="button" id="btn-copy-file-content" class="btn-secondary" style="display: none; padding: 0.65rem 0.9rem; font-size: 0.82rem;">
|
|
📋 Copiar Texto
|
|
</button>
|
|
<button type="button" id="btn-save-file" class="btn-primary" style="flex: 1; padding: 0.65rem 1rem; font-size: 0.85rem;">
|
|
💾 Salvar Arquivo
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal: Arquivos da Estação (Downloads Sob Demanda) -->
|
|
<div id="session-downloads-modal" class="modal-backdrop" style="display: none;">
|
|
<div class="modal-card session-downloads-card">
|
|
<div class="modal-header">
|
|
<div style="display: flex; align-items: center; gap: 0.5rem; overflow: hidden;">
|
|
<span style="font-size: 1.2rem; flex-shrink: 0;">📥</span>
|
|
<div style="overflow: hidden;">
|
|
<h3 style="margin: 0; font-size: 0.95rem;">Arquivos da Estação</h3>
|
|
<span id="session-downloads-count" style="font-size: 0.72rem; color: #94a3b8;">0 arquivos detectados</span>
|
|
</div>
|
|
</div>
|
|
<button id="btn-close-session-downloads" class="btn-icon" aria-label="Fechar">×</button>
|
|
</div>
|
|
|
|
<div class="session-downloads-body" id="session-downloads-body">
|
|
<div id="session-downloads-empty" class="session-downloads-empty">
|
|
<span style="font-size: 2.2rem; display: block; margin-bottom: 0.5rem;">📂</span>
|
|
<strong style="color: #e2e8f0; display: block; margin-bottom: 0.25rem;">Nenhum arquivo detectado</strong>
|
|
<p style="font-size: 0.8rem; margin: 0; line-height: 1.4; color: #94a3b8;">Peça ao agente para citar, gerar ou manipular arquivos no terminal para visualizá-los ou baixá-los aqui.</p>
|
|
</div>
|
|
<div id="session-downloads-list" class="session-downloads-list" style="display: none;"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Bottom Sheet / Drawer: Chat Interativo com Agente -->
|
|
<div id="chat-drawer" class="chat-drawer" style="display: none;">
|
|
<div class="chat-backdrop" id="chat-backdrop" onclick="window.closeChat && window.closeChat()"></div>
|
|
<div class="chat-content">
|
|
<div class="chat-header">
|
|
<div class="chat-agent-info">
|
|
<span class="status-dot active" id="chat-agent-status-dot"></span>
|
|
<div>
|
|
<strong id="chat-agent-name" style="font-size: 0.95rem; color: #f8fafc;">Agente</strong>
|
|
<div id="chat-agent-subtitle" style="font-size: 0.7rem; color: #38bdf8;">Terminal Maestri Conectado</div>
|
|
</div>
|
|
</div>
|
|
<div class="chat-header-actions" style="display: flex; align-items: center; gap: 0.25rem;">
|
|
<button id="btn-session-downloads" class="btn-icon btn-session-downloads" aria-label="Arquivos da Estação (Downloads)" title="Arquivos da Estação" style="position: relative; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; z-index: 30;">
|
|
<span style="font-size: 1.1rem; line-height: 1;">📥</span>
|
|
<span id="session-downloads-badge" class="session-downloads-badge" style="display: none;">0</span>
|
|
</button>
|
|
<button type="button" id="btn-tui-toggle" class="btn-icon btn-tui-toggle-header" aria-label="Teclas de navegação do terminal (Setas / Enter / Esc)" title="Teclas de Menu (↑ ↓ Enter Esc)" style="min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; z-index: 30;">
|
|
<span style="font-size: 1.05rem; line-height: 1;">⌨️</span>
|
|
</button>
|
|
<button id="chat-notif-toggle-btn" class="btn-icon btn-chat-notif-toggle muted" aria-label="Alternar Notificações" title="Alternar Notificações" style="font-size: 1.1rem; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; z-index: 30;">🔕</button>
|
|
<button type="button" id="btn-restart-terminal" class="btn-icon btn-restart-terminal" aria-label="Reiniciar / Recarregar terminal via Maestri" title="Reiniciar / Recarregar terminal via Maestri" style="min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; z-index: 30;">
|
|
<svg style="width:18px;height:18px;color:#f59e0b" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 5.636a9 9 0 11-12.728 0M12 3v9" />
|
|
</svg>
|
|
</button>
|
|
<button id="btn-refresh-chat" class="btn-icon" aria-label="Atualizar saída do terminal" title="Atualizar terminal" style="min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; touch-action: manipulation; z-index: 30;">
|
|
<svg style="width:18px;height:18px;color:#38bdf8" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
|
|
</svg>
|
|
</button>
|
|
<button id="btn-close-chat" class="btn-icon btn-close-chat" onclick="window.closeChat && window.closeChat()" aria-label="Fechar Chat">×</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Componente Recolhível de Saída do Terminal (Sob Demanda) -->
|
|
<div id="chat-terminal-collapsible" class="chat-terminal-collapsible">
|
|
<button type="button" id="chat-terminal-toggle-btn" class="chat-terminal-toggle-btn" aria-expanded="false">
|
|
<span class="terminal-toggle-icon">>_</span>
|
|
<span class="terminal-toggle-text">Ver saída do terminal</span>
|
|
<span class="terminal-toggle-arrow">▾</span>
|
|
</button>
|
|
<div id="chat-terminal-collapsible-content" class="chat-terminal-collapsible-content" style="display: none;">
|
|
<pre id="chat-terminal-output-raw" class="chat-terminal-output-raw">Aguardando dados do terminal...</pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="chat-messages" id="chat-messages">
|
|
<!-- Mensagens do chat serão injetadas aqui -->
|
|
</div>
|
|
|
|
<!-- Botão Flutuante: Rolar para o Fim do Chat -->
|
|
<button id="btn-chat-scroll-bottom" class="chat-scroll-bottom-btn" style="display: none;" title="Rolar para o fim" aria-label="Rolar para o fim">
|
|
<svg style="width: 18px; height: 18px;" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2.5" d="M19 14l-7 7m0 0l-7-7m7 7V3" />
|
|
</svg>
|
|
</button>
|
|
|
|
<!-- Banner de Status de Pensamento / Atividade do Agente -->
|
|
<div id="chat-thinking-banner" class="chat-thinking-banner" style="display: none;">
|
|
<div style="display: flex; align-items: center; gap: 0.45rem;">
|
|
<span style="font-size: 0.9rem;">⚡</span>
|
|
<span id="chat-thinking-text">Agente está pensando...</span>
|
|
</div>
|
|
<div class="typing-wave"><span></span><span></span><span></span></div>
|
|
</div>
|
|
|
|
<!-- Painel Interativo de Navegação de Menu TUI (Setas / Enter / Esc / Tab + Opções Detectadas) -->
|
|
<div id="chat-tui-panel" class="chat-tui-panel" style="display: none;">
|
|
<div class="chat-tui-header">
|
|
<span class="chat-tui-title" id="chat-tui-title">🎛️ Menu Interativo Detectado</span>
|
|
<span class="chat-tui-hint" id="chat-tui-hint">Toque numa opção ou use as teclas</span>
|
|
</div>
|
|
<div id="chat-tui-options" class="chat-tui-options" style="display: none;"></div>
|
|
<div class="chat-tui-keypad" role="toolbar" aria-label="Controles de navegação do terminal">
|
|
<button type="button" class="btn-tui-key" data-raw="\e[A" title="Seta para Cima" aria-label="Seta para Cima">↑ Cima</button>
|
|
<button type="button" class="btn-tui-key" data-raw="\e[B" title="Seta para Baixo" aria-label="Seta para Baixo">↓ Baixo</button>
|
|
<button type="button" class="btn-tui-key" data-raw="\e[D" title="Seta para Esquerda" aria-label="Seta para Esquerda">← Esq</button>
|
|
<button type="button" class="btn-tui-key" data-raw="\e[C" title="Seta para Direita" aria-label="Seta para Direita">→ Dir</button>
|
|
<button type="button" class="btn-tui-key btn-tui-enter" data-raw="\n" title="Confirmar (Enter)" aria-label="Enter">↵ Enter</button>
|
|
<button type="button" class="btn-tui-key btn-tui-esc" data-raw="\e" title="Voltar / Cancelar (Esc)" aria-label="Escape">Esc</button>
|
|
<button type="button" class="btn-tui-key" data-raw="\t" title="Tab (Editar / Alternar)" aria-label="Tab">Tab ⇥</button>
|
|
<button type="button" class="btn-tui-key" data-raw=" " title="Espaço (Marcar)" aria-label="Espaço">␣ Espaço</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Backdrop para fechar o menu de anexo flutuante -->
|
|
<div id="attach-backdrop" class="attach-backdrop" style="display: none;"></div>
|
|
|
|
<!-- Menu Flutuante de Ações de Anexo (Câmera / Galeria / Arquivos / Downloads) -->
|
|
<div id="attach-menu" class="attach-menu-popover" style="display: none;">
|
|
<button type="button" class="attach-menu-item" id="btn-attach-camera">
|
|
<span class="attach-item-icon camera">
|
|
<svg style="width:18px;height:18px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z" />
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 13a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
</svg>
|
|
</span>
|
|
<span class="attach-item-label">Tirar Foto (Câmera)</span>
|
|
</button>
|
|
<button type="button" class="attach-menu-item" id="btn-attach-gallery">
|
|
<span class="attach-item-icon gallery">
|
|
<svg style="width:18px;height:18px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
|
</svg>
|
|
</span>
|
|
<span class="attach-item-label">Galeria de Fotos</span>
|
|
</button>
|
|
<button type="button" class="attach-menu-item" id="btn-attach-file">
|
|
<span class="attach-item-icon file">
|
|
<svg style="width:18px;height:18px" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
|
|
</svg>
|
|
</span>
|
|
<span class="attach-item-label">Documentos / Arquivos</span>
|
|
</button>
|
|
<button type="button" class="attach-menu-item" id="btn-menu-downloads">
|
|
<span class="attach-item-icon downloads">📥</span>
|
|
<span class="attach-item-label">Arquivos da Estação (Downloads)</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Preview de Anexo Flutuante antes do envio (Suporte a múltiplos itens) -->
|
|
<div id="attachment-preview-bar" class="attachment-preview-bar" style="display: none;">
|
|
<div id="attachment-list" class="attachment-list"></div>
|
|
<div id="attachment-legacy-preview" class="attachment-legacy-preview" style="display: none;">
|
|
<div id="attachment-thumb-wrapper" class="attachment-thumb-wrapper"></div>
|
|
<div class="attachment-info">
|
|
<span id="attachment-name" class="attachment-name">arquivo.png</span>
|
|
<span id="attachment-size" class="attachment-size">0 KB</span>
|
|
</div>
|
|
<button type="button" id="btn-remove-attachment" class="btn-remove-attachment" aria-label="Remover anexo">×</button>
|
|
</div>
|
|
<div class="attachment-summary-wrapper">
|
|
<span id="attachment-summary-badge" class="attachment-summary-badge" style="display: none;"></span>
|
|
<button type="button" id="btn-clear-all-attachments" class="btn-clear-all-attachments" title="Remover todos os anexos" aria-label="Remover todos">× Limpar</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Barra de Input com Anexo, Entrada e Ação Dinâmica (Voz / Envio) -->
|
|
<form class="chat-input-bar" id="chat-form">
|
|
<!-- Inputs Especializados para Câmera Direta, Galeria de Fotos e Arquivos Gerais -->
|
|
<input type="file" id="chat-camera-input" style="display: none;" accept="image/*" capture="environment">
|
|
<input type="file" id="chat-gallery-input" style="display: none;" accept="image/*" multiple>
|
|
<input type="file" id="chat-file-input" style="display: none;" accept=".pdf,.txt,.log,.json,.csv,.md,audio/*" multiple>
|
|
|
|
<button type="button" id="btn-attach" class="btn-input-action" aria-label="Anexar foto ou arquivo" title="Anexar foto ou arquivo">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" style="width:20px;height:20px">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
|
|
</svg>
|
|
</button>
|
|
|
|
<input type="text" id="chat-input" placeholder="Digite ou fale para o agente..." autocomplete="off">
|
|
|
|
<button type="button" id="btn-voice" class="btn-input-action" aria-label="Gravar voz / Transcrição" title="Falar">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" style="width:20px;height:20px">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z" />
|
|
</svg>
|
|
</button>
|
|
|
|
<button type="submit" id="btn-chat-send" class="btn-send" aria-label="Enviar mensagem" style="display: none;">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" style="width:18px;height:18px">
|
|
<path d="M5 12h14m-7-7l7 7-7 7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
</svg>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/ota-bootstrapper.js?v=1.0.3"></script>
|
|
</body>
|
|
</html>
|