feat: OCI CLI Terminal, Spanish i18n, language in My Settings

Terminal:
- New /terminal page with Linux-style terminal UI (dark theme, title bar, prompt)
- OCI Config selector — isolated per user (ownership check)
- Tab autocomplete: parses oci --help dynamically, caches results, commands first
- Command history (↑/↓) persisted in DB per user
- Security: only 'oci' commands, blocks pipes/redirects/shell injection
- Built-in commands: clear, history, help
- Timeout 60s per command

i18n:
- Spanish (es.ts): 748+ keys, Latin American formal
- Language selector moved from sidebar to My Settings (🇧🇷/🇺🇸/🇪🇸)
- Auto-detect browser language (pt/es/en)

Backend:
- POST /api/terminal/execute — run OCI CLI with selected config
- GET /api/terminal/completions — dynamic autocomplete from oci --help
- GET /api/terminal/history — per-user command history
- terminal_history table in SQLite
This commit is contained in:
nogueiraguh
2026-04-01 17:45:25 -03:00
parent 62f2a3d1ab
commit 8caa032055
9 changed files with 1363 additions and 20 deletions

View File

@@ -20,6 +20,7 @@ const pt: Record<string, string> = {
'nav.adb': 'ADB Vector',
'nav.embeddings': 'Embeddings',
'nav.embConsult': 'Consultar Embeddings',
'nav.terminal': 'Terminal',
'nav.userMgmt': 'Gestão de Usuários',
'nav.users': 'Usuários',
'nav.mySettings': 'Minhas Configurações',
@@ -756,6 +757,8 @@ const pt: Record<string, string> = {
'settings.timezone': 'Timezone',
'settings.tzDesc': 'Define o fuso horário para exibição de datas e horários.',
'settings.tzChanged': 'Timezone alterado com sucesso',
'settings.language': 'Idioma',
'settings.langDesc': 'Selecione o idioma da interface.',
'settings.changePassword': 'Alterar Senha',
'settings.currentPw': 'Senha Atual',
'settings.newPw': 'Nova Senha',
@@ -768,6 +771,16 @@ const pt: Record<string, string> = {
'settings.pwMinLength': 'A nova senha deve ter pelo menos 8 caracteres',
'settings.federatedInfo': 'Senha e MFA são gerenciados pelo Oracle IAM Identity Domain. Configure diretamente no portal OCI.',
'settings.mfa': 'Autenticação Multi-Fator (MFA)',
// ── Terminal ──
'term.title': 'OCI CLI Terminal',
'term.subtitle': 'Execute comandos OCI CLI diretamente no navegador',
'term.config': 'Configuração',
'term.selectConfig': 'Selecione uma configuração OCI',
'term.welcome': 'Digite comandos OCI CLI. Ex: oci iam user list --compartment-id <ocid>',
'term.clearHint': 'para limpar',
'term.historyHint': 'para navegar no histórico',
'term.executing': 'Executando...',
'term.noOutput': 'Comando executado sem output',
// ── Oracle IAM ──
'iam.title': 'Oracle IAM Identity Domains',
'iam.subtitle': 'Integração OIDC para autenticação corporativa',