diff --git a/.env.example b/.env.example index 891d903..7c167f0 100644 --- a/.env.example +++ b/.env.example @@ -9,10 +9,10 @@ APACHE_SITES_AVAILABLE=/etc/apache2/sites-available APACHE_SITES_ENABLED=/etc/apache2/sites-enabled SYSTEM_USER=ggc -# Autenticación y Credenciales -ADMIN_USER=admin -ADMIN_PASS=cambiar_password_segura -ADMIN_FULL_NAME=Administrador Principal +# Autenticación y Credenciales (Superadministrador Inmutable) +ADMIN_USER=root +ADMIN_PASS=ddEMVJ-N8T5mZG +ADMIN_FULL_NAME=root SESSION_SECRET=minimo_32_caracteres_aleatorios_para_cookies_o_jwt # Restricciones diff --git a/public/css/components.css b/public/css/components.css index 49fffce..4953c91 100644 --- a/public/css/components.css +++ b/public/css/components.css @@ -1311,3 +1311,811 @@ width: 48px; } } + +/* ========================================================================== + Nuevas Interfaces y Módulos: Terminal, Monitor, File Manager y Editor + ========================================================================== */ + +/* Diálogo Extra Ancho para File Manager y Code Editor */ +.modal-dialog-xl { + max-width: 1040px; + width: 95vw; +} + +/* ========================================================================== + 1. MÓDULO TERMINAL (CONSOLA BASH INTERACTIVA) + ========================================================================== */ + +.terminal-quick-actions-bar { + display: flex; + align-items: center; + gap: 0.75rem; + margin-bottom: 1rem; + flex-wrap: wrap; + padding: 0.75rem 1rem; + background: var(--bg-surface); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + backdrop-filter: blur(12px); +} + +.quick-actions-label { + font-size: 0.8rem; + font-weight: 600; + color: var(--text-secondary); + white-space: nowrap; +} + +.quick-buttons-wrapper { + display: flex; + align-items: center; + gap: 0.45rem; + flex-wrap: wrap; +} + +.btn-quick-cmd { + padding: 0.35rem 0.65rem; + font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', monospace; + font-size: 0.78rem; + color: var(--text-secondary); + background: rgba(255, 255, 255, 0.04); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-sm); + cursor: pointer; + transition: all var(--transition-fast); + white-space: nowrap; +} + +.btn-quick-cmd:hover { + color: var(--accent-lime); + background: rgba(163, 230, 53, 0.08); + border-color: var(--accent-lime-hover); + transform: translateY(-1px); +} + +.terminal-window-card { + background: #060907; + border: 1px solid rgba(255, 255, 255, 0.1); + border-radius: var(--radius-lg); + overflow: hidden; + box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08); + display: flex; + flex-direction: column; +} + +.terminal-window-topbar { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.75rem 1rem; + background: rgba(18, 26, 20, 0.95); + border-bottom: 1px solid rgba(255, 255, 255, 0.08); +} + +.terminal-dots-indicator { + display: flex; + align-items: center; + gap: 0.45rem; +} + +.dot-circle { + width: 11px; + height: 11px; + border-radius: 50%; + display: inline-block; +} + +.dot-red { background: #ef4444; } +.dot-yellow { background: #f59e0b; } +.dot-green { background: #10b981; } + +.terminal-window-title { + font-family: ui-monospace, 'JetBrains Mono', monospace; + font-size: 0.82rem; + font-weight: 600; + color: var(--text-secondary); +} + +.terminal-window-meta { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.terminal-meta-tag { + font-size: 0.72rem; + padding: 0.2rem 0.5rem; + background: rgba(16, 185, 129, 0.12); + color: var(--accent-emerald); + border: 1px solid rgba(16, 185, 129, 0.25); + border-radius: var(--radius-sm); +} + +.terminal-screen-body { + height: 480px; + max-height: 55vh; + overflow-y: auto; + padding: 1.25rem 1.25rem 0.75rem; + font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace; + font-size: 0.88rem; + line-height: 1.55; + color: #e2e8f0; + display: flex; + flex-direction: column; + gap: 0.85rem; +} + +.terminal-banner { + padding: 0.85rem 1rem; + background: rgba(255, 255, 255, 0.02); + border: 1px dashed rgba(255, 255, 255, 0.12); + border-radius: var(--radius-md); + margin-bottom: 0.5rem; + display: flex; + flex-direction: column; + gap: 0.35rem; +} + +.terminal-banner-brand { + color: var(--accent-lime); + font-weight: 700; + font-size: 0.88rem; +} + +.terminal-banner-sub { + color: var(--text-muted); + font-size: 0.78rem; +} + +.terminal-entry { + display: flex; + flex-direction: column; + gap: 0.35rem; +} + +.terminal-cmd-row { + display: flex; + align-items: center; + gap: 0.5rem; + color: var(--accent-lime); + font-weight: 600; + word-break: break-all; +} + +.terminal-prompt-sym { + color: var(--text-muted); +} + +.terminal-output-block { + padding: 0.65rem 0.85rem; + background: rgba(0, 0, 0, 0.35); + border-radius: var(--radius-sm); + border-left: 3px solid var(--accent-lime); + white-space: pre-wrap; + word-break: break-word; + font-size: 0.84rem; + color: #cbd5e1; +} + +.terminal-output-block.has-error { + border-left-color: #ef4444; + background: rgba(239, 68, 68, 0.05); +} + +.terminal-stderr-text { + color: #fca5a5; + margin-top: 0.35rem; +} + +.terminal-entry-footer { + display: flex; + align-items: center; + gap: 0.75rem; + font-size: 0.72rem; + color: var(--text-muted); + margin-top: 0.15rem; +} + +.terminal-badge-ok { + color: #4ade80; + background: rgba(74, 222, 128, 0.12); + padding: 0.15rem 0.4rem; + border-radius: 4px; +} + +.terminal-badge-err { + color: #f87171; + background: rgba(248, 113, 113, 0.12); + padding: 0.15rem 0.4rem; + border-radius: 4px; +} + +.terminal-cli-form { + display: flex; + align-items: center; + gap: 0.65rem; + padding: 0.75rem 1rem; + background: rgba(14, 22, 16, 0.95); + border-top: 1px solid rgba(255, 255, 255, 0.08); +} + +.terminal-prompt-prefix { + font-family: ui-monospace, 'JetBrains Mono', monospace; + font-size: 0.88rem; + font-weight: 700; + color: var(--accent-lime); + white-space: nowrap; +} + +.terminal-cli-input { + flex: 1; + background: transparent; + border: none; + font-family: ui-monospace, 'JetBrains Mono', monospace; + font-size: 0.88rem; + color: #f8fafc; + outline: none; + caret-color: var(--accent-lime); +} + +.terminal-cli-input::placeholder { + color: rgba(255, 255, 255, 0.25); + font-size: 0.82rem; +} + +.terminal-execute-btn { + display: inline-flex; + align-items: center; + gap: 0.45rem; + padding: 0.4rem 0.85rem; + font-size: 0.8rem; +} + +.kbd-hint { + font-family: ui-monospace, monospace; + font-size: 0.68rem; + background: rgba(0, 0, 0, 0.3); + padding: 0.1rem 0.35rem; + border-radius: 3px; + border: 1px solid rgba(255, 255, 255, 0.15); +} + +/* ========================================================================== + 2. MÓDULO MONITOR DEL SERVIDOR + ========================================================================== */ + +.auto-refresh-selector-wrap { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.monitor-cards-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 1.25rem; + margin-bottom: 1.5rem; +} + +.monitor-metric-card { + background: var(--bg-surface-elevated); + border: 1px solid var(--border-subtle); + border-radius: var(--radius-lg); + padding: 1.25rem; + backdrop-filter: blur(16px); + box-shadow: var(--shadow-sm), var(--glass-sheen); + display: flex; + flex-direction: column; + gap: 0.85rem; + transition: transform var(--transition-fast), border-color var(--transition-fast); +} + +.monitor-metric-card:hover { + transform: translateY(-2px); + border-color: var(--border-medium); +} + +.metric-card-header { + display: flex; + align-items: center; + gap: 0.75rem; +} + +.metric-card-icon-wrap { + width: 36px; + height: 36px; + border-radius: var(--radius-md); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.metric-card-title-wrap { + flex: 1; + display: flex; + flex-direction: column; + min-width: 0; +} + +.metric-title { + font-size: 0.9rem; + font-weight: 700; + color: var(--text-primary); +} + +.metric-subtitle { + font-size: 0.75rem; + color: var(--text-muted); +} + +.metric-percentage { + font-size: 1.25rem; + font-weight: 800; + color: var(--text-primary); +} + +.metric-progress-track { + width: 100%; + height: 8px; + background: rgba(255, 255, 255, 0.06); + border-radius: var(--radius-full); + overflow: hidden; + position: relative; +} + +.metric-progress-fill { + height: 100%; + background: linear-gradient(90deg, #38bdf8, #0ea5e9); + border-radius: var(--radius-full); + transition: width 400ms ease; + box-shadow: 0 0 10px rgba(56, 189, 248, 0.3); +} + +.metric-progress-fill.fill-lime { + background: linear-gradient(90deg, #10b981, #a3e635); + box-shadow: 0 0 10px rgba(163, 230, 53, 0.3); +} + +.metric-progress-fill.fill-purple { + background: linear-gradient(90deg, #a855f7, #c084fc); + box-shadow: 0 0 10px rgba(192, 132, 252, 0.3); +} + +.metric-progress-fill.fill-orange { + background: linear-gradient(90deg, #f97316, #fb923c); + box-shadow: 0 0 10px rgba(251, 146, 60, 0.3); +} + +.metric-progress-fill.fill-warning { + background: linear-gradient(90deg, #f59e0b, #fbbf24) !important; + box-shadow: 0 0 12px rgba(245, 158, 11, 0.4) !important; +} + +.metric-progress-fill.fill-danger { + background: linear-gradient(90deg, #ef4444, #f87171) !important; + box-shadow: 0 0 14px rgba(239, 68, 68, 0.5) !important; +} + +.metric-card-footer { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + padding-top: 0.4rem; + border-top: 1px solid rgba(255, 255, 255, 0.05); +} + +.metric-stat-item { + display: flex; + align-items: center; + gap: 0.35rem; + font-size: 0.76rem; +} + +.stat-name { + color: var(--text-muted); +} + +.stat-value { + color: var(--text-secondary); +} + +/* Badges de Procesos del VPS */ +.process-cmd-badge { + display: inline-flex; + align-items: center; + gap: 0.35rem; + padding: 0.2rem 0.55rem; + border-radius: var(--radius-sm); + font-family: ui-monospace, monospace; + font-size: 0.78rem; + font-weight: 600; +} + +.proc-apache { + background: rgba(56, 189, 248, 0.12); + color: #38bdf8; + border: 1px solid rgba(56, 189, 248, 0.25); +} + +.proc-node { + background: rgba(74, 222, 128, 0.12); + color: #4ade80; + border: 1px solid rgba(74, 222, 128, 0.25); +} + +.proc-gitea { + background: rgba(192, 132, 252, 0.12); + color: #c084fc; + border: 1px solid rgba(192, 132, 252, 0.25); +} + +.proc-mysql { + background: rgba(251, 146, 60, 0.12); + color: #fb923c; + border: 1px solid rgba(251, 146, 60, 0.25); +} + +.proc-system { + background: rgba(255, 255, 255, 0.06); + color: var(--text-muted); + border: 1px solid var(--border-subtle); +} + +/* ========================================================================== + 3. GESTOR DE ARCHIVOS (FILE MANAGER) + ========================================================================== */ + +.fm-path-subtitle { + font-family: ui-monospace, monospace; + font-size: 0.76rem; + color: var(--accent-lime); +} + +.fm-breadcrumbs-bar { + display: flex; + align-items: center; + gap: 0.35rem; + padding: 0.65rem 1.25rem; + background: rgba(0, 0, 0, 0.35); + border-bottom: 1px solid var(--border-subtle); + overflow-x: auto; + white-space: nowrap; +} + +.fm-breadcrumb-item { + display: inline-flex; + align-items: center; + gap: 0.35rem; + font-size: 0.82rem; + color: var(--text-muted); + background: transparent; + border: none; + cursor: pointer; + padding: 0.2rem 0.45rem; + border-radius: 4px; + transition: all var(--transition-fast); +} + +.fm-breadcrumb-item:hover { + color: var(--accent-lime); + background: rgba(163, 230, 53, 0.08); +} + +.fm-breadcrumb-active { + color: var(--text-primary); + font-weight: 700; + pointer-events: none; +} + +.fm-breadcrumb-separator { + color: rgba(255, 255, 255, 0.2); + font-size: 0.75rem; +} + +.fm-toolbar-container { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.75rem 1.25rem; + background: var(--bg-surface); + border-bottom: 1px solid var(--border-subtle); + gap: 0.75rem; + flex-wrap: wrap; +} + +.fm-toolbar-left, .fm-toolbar-right { + display: flex; + align-items: center; + gap: 0.5rem; +} + +.fm-create-item-panel { + padding: 0.75rem 1.25rem; + background: rgba(16, 185, 129, 0.05); + border-bottom: 1px solid rgba(16, 185, 129, 0.2); +} + +.fm-create-item-form { + display: flex; + align-items: center; + gap: 0.65rem; +} + +.fm-create-input { + max-width: 320px; + height: 34px; + font-size: 0.85rem; +} + +.fm-modal-body { + padding: 0; + max-height: 480px; + overflow-y: auto; +} + +.fm-table { + width: 100%; +} + +.fm-table tbody tr { + cursor: default; +} + +.fm-table tbody tr.fm-dir-row { + cursor: pointer; +} + +.fm-file-name-cell { + display: flex; + align-items: center; + gap: 0.65rem; +} + +.fm-icon-folder { color: #f59e0b; } +.fm-icon-php { color: #60a5fa; } +.fm-icon-js { color: #facc15; } +.fm-icon-html { color: #fb923c; } +.fm-icon-css { color: #38bdf8; } +.fm-icon-json { color: #4ade80; } +.fm-icon-img { color: #f472b6; } +.fm-icon-default { color: var(--text-muted); } + +.fm-folder-link { + font-weight: 600; + color: var(--text-primary); + text-decoration: none; +} + +.fm-folder-link:hover { + color: var(--accent-lime); + text-decoration: underline; +} + +/* ========================================================================== + 4. EDITOR DE CÓDIGO + ========================================================================== */ + +.code-editor-dialog { + display: flex; + flex-direction: column; + height: 85vh; +} + +.code-editor-header { + padding: 0.85rem 1.25rem; +} + +.code-editor-path { + font-family: ui-monospace, monospace; + font-size: 0.74rem; + color: var(--text-muted); +} + +.code-editor-header-actions { + display: flex; + align-items: center; + gap: 0.75rem; +} + +.code-editor-status-tag { + font-size: 0.74rem; + padding: 0.25rem 0.55rem; + border-radius: var(--radius-sm); + font-weight: 600; +} + +.status-clean { + color: var(--text-muted); + background: rgba(255, 255, 255, 0.05); +} + +.status-dirty { + color: #fbbf24; + background: rgba(245, 158, 11, 0.15); + border: 1px solid rgba(245, 158, 11, 0.3); +} + +.status-saving { + color: #38bdf8; + background: rgba(56, 189, 248, 0.15); +} + +.status-saved { + color: #4ade80; + background: rgba(74, 222, 128, 0.15); +} + +.code-editor-body { + flex: 1; + padding: 0; + overflow: hidden; + background: #080c09; +} + +.code-editor-workspace { + display: flex; + height: 100%; + width: 100%; + overflow: hidden; + position: relative; +} + +.code-editor-gutter { + width: 52px; + background: #050806; + border-right: 1px solid rgba(255, 255, 255, 0.08); + color: rgba(255, 255, 255, 0.3); + font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', monospace; + font-size: 0.85rem; + line-height: 1.6; + text-align: right; + padding: 0.75rem 0.5rem 0.75rem 0.25rem; + user-select: none; + overflow: hidden; + white-space: pre; +} + +.code-editor-textarea { + flex: 1; + height: 100%; + background: transparent; + border: none; + color: #e2e8f0; + font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', monospace; + font-size: 0.85rem; + line-height: 1.6; + padding: 0.75rem 1rem; + outline: none; + resize: none; + white-space: pre; + overflow: auto; + tab-size: 2; + caret-color: var(--accent-lime); +} + +.code-editor-footer { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.65rem 1.25rem; + background: var(--bg-surface-elevated); +} + +.code-editor-footer-left { + display: flex; + align-items: center; + gap: 1rem; +} + +.code-editor-shortcut-hint { + font-size: 0.72rem; + color: var(--text-muted); +} + +/* ========================================================================== + 5. RIESGOS DE SUBDOMINIOS Y USUARIOS INMUTABLES + ========================================================================== */ + +.risk-alert-container { + margin: 1rem 0; + padding: 0.9rem 1rem; + background: rgba(239, 68, 68, 0.08); + border: 1px solid rgba(239, 68, 68, 0.3); + border-radius: var(--radius-md); + display: flex; + flex-direction: column; + gap: 0.65rem; +} + +.risk-alert-header { + display: flex; + align-items: center; + gap: 0.65rem; +} + +.risk-alert-badge { + font-size: 0.7rem; + font-weight: 800; + letter-spacing: 0.05em; + padding: 0.2rem 0.45rem; + border-radius: 4px; + background: #ef4444; + color: #fff; +} + +.risk-alert-title { + font-size: 0.88rem; + color: #fca5a5; +} + +.risk-alert-list { + display: flex; + flex-direction: column; + gap: 0.45rem; +} + +.risk-alert-item { + font-size: 0.8rem; + line-height: 1.45; + color: #fecaca; + padding: 0.45rem 0.65rem; + background: rgba(0, 0, 0, 0.25); + border-left: 3px solid #ef4444; + border-radius: 4px; +} + +.risk-alert-item.risk-warning { + border-left-color: #f59e0b; + color: #fde68a; +} + +.risk-confirmation-box { + display: flex; + align-items: flex-start; + gap: 0.75rem; + padding: 0.85rem 1rem; + margin: 0.85rem 0; + background: rgba(245, 158, 11, 0.08); + border: 1px solid rgba(245, 158, 11, 0.35); + border-radius: var(--radius-md); +} + +.risk-checkbox { + margin-top: 0.25rem; + width: 17px; + height: 17px; + accent-color: var(--accent-lime); + cursor: pointer; +} + +.risk-checkbox-label { + display: flex; + flex-direction: column; + gap: 0.15rem; + font-size: 0.84rem; + color: var(--text-primary); + cursor: pointer; +} + +.risk-checkbox-sub { + font-size: 0.74rem; + color: var(--text-muted); +} + +/* Badge de Usuario Inmutable / Root */ +.badge-immutable { + display: inline-flex; + align-items: center; + gap: 0.35rem; + padding: 0.25rem 0.6rem; + font-size: 0.72rem; + font-weight: 800; + letter-spacing: 0.04em; + color: #d8b4fe; + background: rgba(168, 85, 247, 0.16); + border: 1px solid rgba(168, 85, 247, 0.45); + border-radius: var(--radius-sm); + box-shadow: 0 0 10px rgba(168, 85, 247, 0.2); +} diff --git a/public/css/main.css b/public/css/main.css index 175c557..c852cd4 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -539,3 +539,11 @@ body { transform: translateY(0); } } + +/* Clases Utilitarias */ +.text-xs { font-size: 0.75rem; } +.text-sm { font-size: 0.85rem; } +.text-muted { color: var(--text-muted); } +.text-accent { color: var(--accent-lime); } +.tabular-nums { font-variant-numeric: tabular-nums; } +.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } diff --git a/public/index.html b/public/index.html index 395ced7..4614c0e 100644 --- a/public/index.html +++ b/public/index.html @@ -121,6 +121,24 @@ 0 +
  • + +
  • +
  • + +
  • + + + + +
    + Comandos Rápidos: +
    + + + + + + + + +
    +
    + + +
    +
    + +
    + bash — ggc@vps-jose:/var/www +
    +
    + Aislamiento Seguro (Timeout 30s) +
    +
    + +
    +
    + a2host Remote Web Terminal v1.0 [Linux 6.x / VPS elingejose.com] + Escribe un comando o selecciona una acción rápida superior. Usa las flechas ↑/↓ para navegar en el historial. +
    +
    + +
    +
    ggc@vps:~$
    + + +
    +
    + + + +
    +
    +
    +
    + Monitoreo de Recursos: + VPS 1 GB RAM · elingejose.com +
    + Actualizado hace un momento +
    +
    +
    + + +
    + +
    +
    + + +
    + +
    +
    +
    + + + + +
    +
    + CPU & Carga Promedio + Cores: -- +
    + 0% +
    +
    +
    +
    + +
    + + +
    +
    +
    + + + + +
    +
    + Memoria RAM del VPS + -- / -- +
    + 0% +
    +
    +
    +
    + +
    + + +
    +
    +
    + + + +
    +
    + Espacio Swap + -- / -- +
    + 0% +
    +
    +
    +
    + +
    + + +
    +
    +
    + + + + +
    +
    + Disco Raíz (/) + -- / -- +
    + 0% +
    +
    +
    +
    + +
    + + +
    +
    +
    + + + + +
    +
    + Proceso a2host (PM2) + -- / 120 MB +
    + 0% +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +

    + + + + + Top Procesos Activos en VPS (Ordenados por Consumo) +

    +
    +
    + +
    +
    + +
    +
    + + + + + + + + + + + + + + +
    PIDUsuarioCPU %Memoria %Memoria RSSComando / Proceso
    +
    +
    + +
    + +
    +
    +
    + +
    @@ -446,6 +785,26 @@
    + + + + + +
    @@ -521,25 +880,109 @@
    -