1122 lines
56 KiB
HTML
1122 lines
56 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
|
|
<meta name="description" content="a2host - Panel Web de Gestión Dinámica de Subdominios Apache2 en elingejose.com">
|
|
<meta name="theme-color" content="#080c08">
|
|
<title>a2host — Subdomain Orchestrator | elingejose.com</title>
|
|
<link rel="stylesheet" href="/css/main.css">
|
|
<link rel="stylesheet" href="/css/components.css">
|
|
</head>
|
|
<body>
|
|
<!-- Ambient Glow Blobs de Fondo -->
|
|
<div class="ambient-glow-wrapper" aria-hidden="true">
|
|
<div class="ambient-blob ambient-blob-1"></div>
|
|
<div class="ambient-blob ambient-blob-2"></div>
|
|
<div class="ambient-blob ambient-blob-3"></div>
|
|
</div>
|
|
|
|
<div class="app-shell">
|
|
<!-- Top Header & Telemetría en Vivo -->
|
|
<header class="top-header">
|
|
<div class="header-inner">
|
|
<!-- Logo y Branding -->
|
|
<a href="/" class="brand-section" aria-label="Ir al inicio de a2host">
|
|
<div class="brand-logo-icon" aria-hidden="true">
|
|
<svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2.2">
|
|
<rect x="2" y="3" width="20" height="14" rx="2"></rect>
|
|
<path stroke-linecap="round" d="M8 21h8M12 17v4"></path>
|
|
<circle cx="6" cy="7" r="1" fill="currentColor"></circle>
|
|
<circle cx="9" cy="7" r="1" fill="currentColor"></circle>
|
|
<circle cx="12" cy="7" r="1" fill="currentColor"></circle>
|
|
</svg>
|
|
</div>
|
|
<div class="brand-info">
|
|
<div class="brand-title-wrap">
|
|
<span class="brand-name">a2host</span>
|
|
<span class="brand-version">v1.0</span>
|
|
</div>
|
|
<span class="brand-subdomain">elingejose.com</span>
|
|
</div>
|
|
</a>
|
|
|
|
<!-- Barra de Telemetría del VPS (RAM PM2, Apache, Host) -->
|
|
<div class="telemetry-bar">
|
|
<!-- Widget RAM PM2 con Barra de Progreso contra límite de 120MB -->
|
|
<div class="telemetry-card" title="Uso de memoria RSS del proceso PM2 frente al límite estricto de 120 MB">
|
|
<svg class="telemetry-icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2">
|
|
<rect x="3" y="4" width="14" height="12" rx="2"></rect>
|
|
<path stroke-linecap="round" d="M6 2v2M14 2v2M6 16v2M14 16v2"></path>
|
|
</svg>
|
|
<div class="telemetry-details">
|
|
<span class="telemetry-label">RAM PM2</span>
|
|
<div class="telemetry-value-wrap">
|
|
<span id="ram-usage-text" class="telemetry-value tabular-nums">-- MB / 120 MB</span>
|
|
<div class="ram-bar-container" aria-label="Barra de uso de memoria PM2">
|
|
<div id="ram-bar-fill" class="ram-bar-fill"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Widget Estado de Apache2 (Pulsante) -->
|
|
<div class="telemetry-card" title="Estado operativo del servidor web Apache2">
|
|
<div id="apache-status-dot" class="status-pulsing-dot" aria-hidden="true"></div>
|
|
<div class="telemetry-details">
|
|
<span class="telemetry-label">Servidor Web</span>
|
|
<span id="apache-status-text" class="telemetry-value">Apache2...</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Widget Sistema & Host -->
|
|
<div class="telemetry-card" title="Hostname y tiempo activo del VPS">
|
|
<svg class="telemetry-icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="10" cy="10" r="7"></circle>
|
|
<path stroke-linecap="round" d="M10 6v4l2.5 2.5"></path>
|
|
</svg>
|
|
<div class="telemetry-details">
|
|
<span class="telemetry-label">Host / Uptime</span>
|
|
<span id="system-uptime-text" class="telemetry-value tabular-nums">vps-jose</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Perfil del Operador y Logout -->
|
|
<div class="user-menu-section">
|
|
<div class="user-badge">
|
|
<span id="user-full-name" style="font-weight: 600;">Usuario</span>
|
|
<span id="user-role-badge" class="user-role-tag role-admin">admin</span>
|
|
</div>
|
|
<button type="button" id="btn-logout" class="btn-logout" title="Cerrar Sesión" aria-label="Cerrar sesión">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M13 3h3a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-3M8 14l4-4-4-4M12 10H3"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Contenedor Principal -->
|
|
<main class="main-container">
|
|
<!-- Navegación por Pestañas Accesibles -->
|
|
<nav class="tabs-nav-container" aria-label="Pestañas principales">
|
|
<ul class="tabs-list" role="tablist">
|
|
<li role="presentation">
|
|
<button type="button" class="tab-btn active" role="tab" id="tab-btn-subdomains" aria-selected="true" aria-controls="tab-panel-subdomains" data-tab="subdomains">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="10" cy="10" r="8"></circle>
|
|
<path stroke-linecap="round" d="M2 10h16M10 2a14 14 0 0 1 0 16M10 2a14 14 0 0 0 0 16"></path>
|
|
</svg>
|
|
<span>Subdominios</span>
|
|
<span id="subdomains-count-badge" class="tab-badge tabular-nums">0</span>
|
|
</button>
|
|
</li>
|
|
<li role="presentation">
|
|
<button type="button" class="tab-btn" role="tab" id="tab-btn-folders" aria-selected="false" aria-controls="tab-panel-folders" data-tab="folders">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-6l-2-2H3z"></path>
|
|
</svg>
|
|
<span>Carpetas Web (/var/www)</span>
|
|
<span id="folders-count-badge" class="tab-badge tabular-nums">0</span>
|
|
</button>
|
|
</li>
|
|
<li role="presentation">
|
|
<button type="button" class="tab-btn" role="tab" id="tab-btn-terminal" aria-selected="false" aria-controls="tab-panel-terminal" data-tab="terminal">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<polyline points="4 17 10 11 4 5"></polyline>
|
|
<line x1="12" y1="19" x2="20" y2="19"></line>
|
|
</svg>
|
|
<span>🖥️ Terminal</span>
|
|
</button>
|
|
</li>
|
|
<li role="presentation">
|
|
<button type="button" class="tab-btn" role="tab" id="tab-btn-monitor" aria-selected="false" aria-controls="tab-panel-monitor" data-tab="monitor">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 3v14a1 1 0 0 0 1 1h13"></path>
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="m18 8-5 5-4-4-4 4"></path>
|
|
</svg>
|
|
<span>📊 Monitor del Servidor</span>
|
|
</button>
|
|
</li>
|
|
<li role="presentation">
|
|
<button type="button" class="tab-btn" role="tab" id="tab-btn-users" aria-selected="false" aria-controls="tab-panel-users" data-tab="users">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M16 17v-1.5a3.5 3.5 0 0 0-3.5-3.5h-5A3.5 3.5 0 0 0 4 15.5V17M10 8.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"></path>
|
|
</svg>
|
|
<span>Operadores & Usuarios</span>
|
|
</button>
|
|
</li>
|
|
<li role="presentation">
|
|
<button type="button" class="tab-btn" role="tab" id="tab-btn-docs" aria-selected="false" aria-controls="tab-panel-docs" data-tab="docs">
|
|
<svg viewBox="0 0 20 20" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M4 3h10a2 2 0 0 1 2 2v12a1 1 0 0 1-1.5.86L10 15l-4.5 2.86A1 1 0 0 1 4 17V3z"></path>
|
|
</svg>
|
|
<span>Documentación Técnica (/docs)</span>
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<!-- =====================================================================
|
|
Pestaña 1: Subdominios
|
|
===================================================================== -->
|
|
<section id="tab-panel-subdomains" class="tab-panel active" role="tabpanel" aria-labelledby="tab-btn-subdomains">
|
|
<!-- Toolbar: Búsqueda, Filtros y Creación -->
|
|
<div class="panel-toolbar">
|
|
<div class="toolbar-left">
|
|
<div class="search-input-wrapper">
|
|
<svg class="search-icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="8.5" cy="8.5" r="5.5"></circle>
|
|
<path stroke-linecap="round" d="M13 13l4.5 4.5"></path>
|
|
</svg>
|
|
<input
|
|
type="search"
|
|
id="search-subdomains"
|
|
class="input-search"
|
|
placeholder="Buscar por subdominio o puerto..."
|
|
aria-label="Buscar subdominios"
|
|
>
|
|
</div>
|
|
|
|
<select id="filter-mode" class="select-filter" aria-label="Filtrar por modo de subdominio">
|
|
<option value="all">Todos los Modos</option>
|
|
<option value="static">Modo A (Estático)</option>
|
|
<option value="proxy">Modo B (Proxy Inverso)</option>
|
|
</select>
|
|
|
|
<select id="filter-status" class="select-filter" aria-label="Filtrar por estado">
|
|
<option value="all">Todos los Estados</option>
|
|
<option value="enabled">Habilitados (Activos)</option>
|
|
<option value="disabled">Pausados (Inactivos)</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="toolbar-right">
|
|
<button type="button" id="btn-refresh-subdomains" class="btn btn-secondary" title="Recargar subdominios">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M14 8A6 6 0 1 1 9.5 2.5M14 2.5v4h-4"></path>
|
|
</svg>
|
|
<span>Refrescar</span>
|
|
</button>
|
|
|
|
<button type="button" id="btn-open-create-subdomain" class="btn btn-primary">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 3v10M3 8h10"></path>
|
|
</svg>
|
|
<span>+ Nuevo Subdominio</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabla Desktop (Tier 2 Glassmorphism) -->
|
|
<div class="table-glass-card">
|
|
<div class="table-responsive">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Subdominio & Dominio</th>
|
|
<th>Tipo / Modo</th>
|
|
<th>Destino / Puerto</th>
|
|
<th>Estado</th>
|
|
<th>Protección</th>
|
|
<th style="text-align: right;">Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="subdomains-table-body">
|
|
<!-- Se llena dinámicamente con app.js -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tarjetas en Mobile (< 768px) -->
|
|
<div id="subdomains-mobile-list" class="mobile-cards-grid">
|
|
<!-- Se llena dinámicamente con app.js -->
|
|
</div>
|
|
|
|
<!-- Empty State -->
|
|
<div id="subdomains-empty-state" class="empty-state-card" style="display: none;">
|
|
<div class="empty-state-icon" aria-hidden="true">
|
|
<svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="12" cy="12" r="10"></circle>
|
|
<path stroke-linecap="round" d="M12 8v4M12 16v.5"></path>
|
|
</svg>
|
|
</div>
|
|
<h3 class="empty-state-title">No se encontraron subdominios</h3>
|
|
<p class="empty-state-desc">No hay ningún VirtualHost coincidente con los filtros actuales. Crea uno nuevo con el botón superior.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =====================================================================
|
|
Pestaña 2: Carpetas Web (/var/www)
|
|
===================================================================== -->
|
|
<section id="tab-panel-folders" class="tab-panel" role="tabpanel" aria-labelledby="tab-btn-folders">
|
|
<div class="panel-toolbar">
|
|
<div class="toolbar-left">
|
|
<div>
|
|
<span class="telemetry-label">Raíz Web:</span>
|
|
<strong style="font-family: ui-monospace, monospace; color: var(--accent-lime); font-size: 0.95rem;">/var/www</strong>
|
|
</div>
|
|
</div>
|
|
<div class="toolbar-right">
|
|
<button type="button" id="btn-refresh-folders" class="btn btn-secondary">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M14 8A6 6 0 1 1 9.5 2.5M14 2.5v4h-4"></path>
|
|
</svg>
|
|
<span>Escanear /var/www</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-glass-card">
|
|
<div class="table-responsive">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Carpeta & Ruta</th>
|
|
<th>Tamaño</th>
|
|
<th>Archivos</th>
|
|
<th>Propietario / Grupo</th>
|
|
<th>Permisos UNIX</th>
|
|
<th>Verificación SGID 2775</th>
|
|
<th style="text-align: right;">Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="folders-table-body">
|
|
<!-- Se llena dinámicamente con app.js -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="folders-mobile-list" class="mobile-cards-grid">
|
|
<!-- Se llena dinámicamente -->
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =====================================================================
|
|
Pestaña 3: 🖥️ Terminal Remota del Sistema (Bash)
|
|
===================================================================== -->
|
|
<section id="tab-panel-terminal" class="tab-panel" role="tabpanel" aria-labelledby="tab-btn-terminal">
|
|
<div class="panel-toolbar">
|
|
<div class="toolbar-left">
|
|
<div>
|
|
<span class="telemetry-label">Entorno Shell:</span>
|
|
<strong id="terminal-env-badge" style="font-family: ui-monospace, monospace; color: var(--accent-lime); font-size: 0.9rem;">
|
|
ggc@vps-jose (~/var/www)
|
|
</strong>
|
|
</div>
|
|
<span class="badge badge-mode-proxy" id="terminal-status-badge">Sesión Activa</span>
|
|
</div>
|
|
<div class="toolbar-right">
|
|
<button type="button" id="terminal-btn-clear" class="btn btn-secondary" title="Limpiar la salida de la consola">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4h10M6 4V2.5A1.5 1.5 0 0 1 7.5 1h1A1.5 1.5 0 0 1 10 2.5V4M5 4v9a1.5 1.5 0 0 0 1.5 1.5h3A1.5 1.5 0 0 0 11 13V4"></path>
|
|
</svg>
|
|
<span>Limpiar Consola</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Botones de Acceso Rápido a Comandos Comunes del VPS -->
|
|
<div class="terminal-quick-actions-bar" aria-label="Comandos rápidos del sistema">
|
|
<span class="quick-actions-label">Comandos Rápidos:</span>
|
|
<div class="quick-buttons-wrapper">
|
|
<button type="button" class="btn-quick-cmd" data-cmd="apache2ctl -S">apache2ctl -S</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="pm2 list">pm2 list</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="free -m">free -m</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="df -h">df -h</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="systemctl status apache2">systemctl status apache2</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="ls -la /var/www">ls -la /var/www</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="php -v">php -v</button>
|
|
<button type="button" class="btn-quick-cmd" data-cmd="uptime">uptime</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Ventana de Consola Terminal Negra / Estilo Xterm -->
|
|
<div class="terminal-window-card">
|
|
<div class="terminal-window-topbar">
|
|
<div class="terminal-dots-indicator" aria-hidden="true">
|
|
<span class="dot-circle dot-red"></span>
|
|
<span class="dot-circle dot-yellow"></span>
|
|
<span class="dot-circle dot-green"></span>
|
|
</div>
|
|
<div class="terminal-window-title" id="terminal-topbar-title">
|
|
bash — ggc@vps-jose:/var/www
|
|
</div>
|
|
<div class="terminal-window-meta">
|
|
<span class="terminal-meta-tag">Aislamiento Seguro (Timeout 30s)</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="terminal-screen" class="terminal-screen-body" tabindex="0" role="region" aria-label="Salida de la consola terminal" aria-live="polite">
|
|
<div class="terminal-banner">
|
|
<span class="terminal-banner-brand">a2host Remote Web Terminal v1.0 [Linux 6.x / VPS elingejose.com]</span>
|
|
<span class="terminal-banner-sub">Escribe un comando o selecciona una acción rápida superior. Usa las flechas ↑/↓ para navegar en el historial.</span>
|
|
</div>
|
|
</div>
|
|
|
|
<form id="terminal-command-form" class="terminal-cli-form" autocomplete="off">
|
|
<div class="terminal-prompt-prefix" id="terminal-prompt-label">ggc@vps:~$</div>
|
|
<input
|
|
type="text"
|
|
id="terminal-input"
|
|
class="terminal-cli-input"
|
|
placeholder="Escribe un comando (ej: apache2ctl -S, free -m, ls -la)..."
|
|
autocomplete="off"
|
|
autocorrect="off"
|
|
autocapitalize="off"
|
|
spellcheck="false"
|
|
required
|
|
>
|
|
<button type="submit" id="terminal-btn-execute" class="btn btn-primary btn-sm terminal-execute-btn">
|
|
<span>Ejecutar</span>
|
|
<kbd class="kbd-hint">Enter</kbd>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =====================================================================
|
|
Pestaña 4: 📊 Monitor del Servidor VPS
|
|
===================================================================== -->
|
|
<section id="tab-panel-monitor" class="tab-panel" role="tabpanel" aria-labelledby="tab-btn-monitor">
|
|
<div class="panel-toolbar">
|
|
<div class="toolbar-left">
|
|
<div>
|
|
<span class="telemetry-label">Monitoreo de Recursos:</span>
|
|
<strong style="color: var(--accent-lime); font-size: 0.95rem;">VPS 1 GB RAM · elingejose.com</strong>
|
|
</div>
|
|
<span id="monitor-last-updated-text" class="text-xs text-muted">Actualizado hace un momento</span>
|
|
</div>
|
|
<div class="toolbar-right">
|
|
<div class="auto-refresh-selector-wrap">
|
|
<label for="monitor-interval-select" class="form-label" style="margin: 0; font-size: 0.78rem;">Auto-refresco:</label>
|
|
<select id="monitor-interval-select" class="select-filter" style="padding-right: 1.8rem; font-size: 0.8rem;">
|
|
<option value="0">Manual (Sin auto-refresco)</option>
|
|
<option value="3000">Cada 3 segundos</option>
|
|
<option value="5000" selected>Cada 5 segundos</option>
|
|
<option value="10000">Cada 10 segundos</option>
|
|
<option value="30000">Cada 30 segundos</option>
|
|
</select>
|
|
</div>
|
|
<button type="button" id="btn-refresh-monitor" class="btn btn-secondary" title="Actualizar métricas del sistema">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M14 8A6 6 0 1 1 9.5 2.5M14 2.5v4h-4"></path>
|
|
</svg>
|
|
<span>Refrescar Ahora</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Grid de Tarjetas de Rendimiento con Barras de Progreso -->
|
|
<div class="monitor-cards-grid">
|
|
<!-- Tarjeta 1: CPU & Load Average -->
|
|
<div class="monitor-metric-card">
|
|
<div class="metric-card-header">
|
|
<div class="metric-card-icon-wrap" style="color: #38bdf8; background: rgba(56, 189, 248, 0.12);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<rect x="4" y="4" width="12" height="12" rx="2"></rect>
|
|
<path d="M7 1v3M13 1v3M7 16v3M13 16v3M1 7h3M1 13h3M16 7h3M16 13h3"></path>
|
|
</svg>
|
|
</div>
|
|
<div class="metric-card-title-wrap">
|
|
<span class="metric-title">CPU & Carga Promedio</span>
|
|
<span id="monitor-cpu-model-text" class="metric-subtitle">Cores: --</span>
|
|
</div>
|
|
<span id="monitor-cpu-percent" class="metric-percentage tabular-nums">0%</span>
|
|
</div>
|
|
<div class="metric-progress-track" aria-label="Uso de CPU">
|
|
<div id="monitor-cpu-bar" class="metric-progress-fill" style="width: 0%;"></div>
|
|
</div>
|
|
<div class="metric-card-footer">
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Load 1m:</span>
|
|
<strong id="monitor-load-1m" class="stat-value tabular-nums">0.00</strong>
|
|
</div>
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Load 5m:</span>
|
|
<strong id="monitor-load-5m" class="stat-value tabular-nums">0.00</strong>
|
|
</div>
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Load 15m:</span>
|
|
<strong id="monitor-load-15m" class="stat-value tabular-nums">0.00</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tarjeta 2: RAM Detallada del VPS -->
|
|
<div class="monitor-metric-card">
|
|
<div class="metric-card-header">
|
|
<div class="metric-card-icon-wrap" style="color: #a3e635; background: rgba(163, 230, 53, 0.12);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<rect x="3" y="4" width="14" height="12" rx="2"></rect>
|
|
<path stroke-linecap="round" d="M6 2v2M14 2v2M6 16v2M14 16v2"></path>
|
|
</svg>
|
|
</div>
|
|
<div class="metric-card-title-wrap">
|
|
<span class="metric-title">Memoria RAM del VPS</span>
|
|
<span id="monitor-ram-used-text" class="metric-subtitle">-- / --</span>
|
|
</div>
|
|
<span id="monitor-ram-percent" class="metric-percentage tabular-nums">0%</span>
|
|
</div>
|
|
<div class="metric-progress-track" aria-label="Uso de memoria RAM">
|
|
<div id="monitor-ram-bar" class="metric-progress-fill fill-lime" style="width: 0%;"></div>
|
|
</div>
|
|
<div class="metric-card-footer">
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Libre:</span>
|
|
<strong id="monitor-ram-free" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Buffers/Caché:</span>
|
|
<strong id="monitor-ram-cache" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tarjeta 3: Memoria Swap -->
|
|
<div class="monitor-metric-card">
|
|
<div class="metric-card-header">
|
|
<div class="metric-card-icon-wrap" style="color: #c084fc; background: rgba(192, 132, 252, 0.12);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M17 10H3M13 6l4 4-4 4M7 14l-4-4 4-4"></path>
|
|
</svg>
|
|
</div>
|
|
<div class="metric-card-title-wrap">
|
|
<span class="metric-title">Espacio Swap</span>
|
|
<span id="monitor-swap-used-text" class="metric-subtitle">-- / --</span>
|
|
</div>
|
|
<span id="monitor-swap-percent" class="metric-percentage tabular-nums">0%</span>
|
|
</div>
|
|
<div class="metric-progress-track" aria-label="Uso de espacio swap">
|
|
<div id="monitor-swap-bar" class="metric-progress-fill fill-purple" style="width: 0%;"></div>
|
|
</div>
|
|
<div class="metric-card-footer">
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Libre:</span>
|
|
<strong id="monitor-swap-free" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Total Swap:</span>
|
|
<strong id="monitor-swap-total" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tarjeta 4: Almacenamiento Raíz / -->
|
|
<div class="monitor-metric-card">
|
|
<div class="metric-card-header">
|
|
<div class="metric-card-icon-wrap" style="color: #fb923c; background: rgba(251, 146, 60, 0.12);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<ellipse cx="10" cy="5" rx="7" ry="2.5"></ellipse>
|
|
<path d="M3 5v5c0 1.38 3.13 2.5 7 2.5s7-1.12 7-2.5V5M3 10v5c0 1.38 3.13 2.5 7 2.5s7-1.12 7-2.5v-5"></path>
|
|
</svg>
|
|
</div>
|
|
<div class="metric-card-title-wrap">
|
|
<span class="metric-title">Disco Raíz (/)</span>
|
|
<span id="monitor-disk-used-text" class="metric-subtitle">-- / --</span>
|
|
</div>
|
|
<span id="monitor-disk-percent" class="metric-percentage tabular-nums">0%</span>
|
|
</div>
|
|
<div class="metric-progress-track" aria-label="Uso de disco">
|
|
<div id="monitor-disk-bar" class="metric-progress-fill fill-orange" style="width: 0%;"></div>
|
|
</div>
|
|
<div class="metric-card-footer">
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Disponible:</span>
|
|
<strong id="monitor-disk-free" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Total:</span>
|
|
<strong id="monitor-disk-total" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tarjeta 5: Proceso a2host (Node/PM2 vs Tope 120M) -->
|
|
<div class="monitor-metric-card">
|
|
<div class="metric-card-header">
|
|
<div class="metric-card-icon-wrap" style="color: #4ade80; background: rgba(74, 222, 128, 0.12);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="10" cy="10" r="7"></circle>
|
|
<polygon points="9 7 13 10 9 13 9 7" fill="currentColor"></polygon>
|
|
</svg>
|
|
</div>
|
|
<div class="metric-card-title-wrap">
|
|
<span class="metric-title">Proceso a2host (PM2)</span>
|
|
<span id="monitor-pm2-used-text" class="metric-subtitle">-- / 120 MB</span>
|
|
</div>
|
|
<span id="monitor-pm2-percent" class="metric-percentage tabular-nums">0%</span>
|
|
</div>
|
|
<div class="metric-progress-track" aria-label="Memoria RSS frente al límite de 120MB de PM2">
|
|
<div id="monitor-pm2-bar" class="metric-progress-fill fill-lime" style="width: 0%;"></div>
|
|
</div>
|
|
<div class="metric-card-footer">
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Heap Usado:</span>
|
|
<strong id="monitor-pm2-heap" class="stat-value tabular-nums">--</strong>
|
|
</div>
|
|
<div class="metric-stat-item">
|
|
<span class="stat-name">Límite Estricto:</span>
|
|
<strong class="stat-value text-accent" style="color: var(--accent-lime);">120.0 MB</strong>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabla de Top Procesos del VPS -->
|
|
<div class="processes-section-wrap" style="margin-top: 1.5rem;">
|
|
<div class="panel-toolbar" style="margin-bottom: 0.85rem;">
|
|
<div class="toolbar-left">
|
|
<h3 style="font-size: 1.05rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem;">
|
|
<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<rect x="2" y="2" width="12" height="12" rx="2"></rect>
|
|
<path d="M5 8h6M8 5v6"></path>
|
|
</svg>
|
|
<span>Top Procesos Activos en VPS (Ordenados por Consumo)</span>
|
|
</h3>
|
|
</div>
|
|
<div class="toolbar-right">
|
|
<input
|
|
type="search"
|
|
id="search-processes-input"
|
|
class="input-search"
|
|
placeholder="Filtrar por comando o PID..."
|
|
style="max-width: 260px;"
|
|
aria-label="Filtrar procesos"
|
|
>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-glass-card">
|
|
<div class="table-responsive">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 80px;">PID</th>
|
|
<th>Usuario</th>
|
|
<th>CPU %</th>
|
|
<th>Memoria %</th>
|
|
<th>Memoria RSS</th>
|
|
<th>Comando / Proceso</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="processes-table-body">
|
|
<!-- Se llena dinámicamente con app.js -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="processes-mobile-list" class="mobile-cards-grid">
|
|
<!-- Mobile -->
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =====================================================================
|
|
Pestaña 5: Operadores & Usuarios
|
|
===================================================================== -->
|
|
<section id="tab-panel-users" class="tab-panel" role="tabpanel" aria-labelledby="tab-btn-users">
|
|
<div class="panel-toolbar">
|
|
<div class="toolbar-left">
|
|
<span class="telemetry-label">Gestión de Cuentas de Acceso al Panel a2host</span>
|
|
</div>
|
|
<div class="toolbar-right">
|
|
<button type="button" id="btn-open-create-user" class="btn btn-primary">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 3v10M3 8h10"></path>
|
|
</svg>
|
|
<span>+ Nuevo Operador</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-glass-card">
|
|
<div class="table-responsive">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Nombre Completo / Usuario</th>
|
|
<th>Rol</th>
|
|
<th>Estado</th>
|
|
<th>Último Inicio de Sesión</th>
|
|
<th style="text-align: right;">Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="users-table-body">
|
|
<!-- Se llena dinámicamente -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="users-mobile-list" class="mobile-cards-grid">
|
|
<!-- Mobile -->
|
|
</div>
|
|
|
|
<!-- Aviso para usuarios sin privilegios admin -->
|
|
<div id="users-restricted-notice" class="empty-state-card" style="display: none;">
|
|
<div class="empty-state-icon" style="color: var(--color-warning); background: rgba(245, 158, 11, 0.1);">
|
|
<svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="currentColor" stroke-width="2">
|
|
<rect x="3" y="11" width="18" height="11" rx="2"></rect>
|
|
<path stroke-linecap="round" d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
</svg>
|
|
</div>
|
|
<h3 class="empty-state-title">Acceso Restringido</h3>
|
|
<p class="empty-state-desc">Tu cuenta actual tiene rol de <strong>Operador</strong>. La gestión y creación de usuarios requiere credenciales de Administrador.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- =====================================================================
|
|
Pestaña 4: Documentación Técnica (/docs)
|
|
===================================================================== -->
|
|
<section id="tab-panel-docs" class="tab-panel" role="tabpanel" aria-labelledby="tab-btn-docs">
|
|
<div class="docs-wrapper">
|
|
<!-- Sidebar con Índice de Especificaciones -->
|
|
<aside class="docs-sidebar">
|
|
<div style="font-size: 0.88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem;">
|
|
Suite de Especificaciones
|
|
</div>
|
|
<div id="docs-sidebar-nav">
|
|
<!-- Se llena dinámicamente -->
|
|
</div>
|
|
</aside>
|
|
|
|
<!-- Visor Markdown Renderizado -->
|
|
<article id="docs-content-viewer" class="docs-content-viewer">
|
|
<div style="text-align: center; color: var(--text-muted); padding: 3rem;">
|
|
Selecciona un documento para visualizar su especificación.
|
|
</div>
|
|
</article>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
</div>
|
|
|
|
<!-- =======================================================================
|
|
Modal: Crear / Editar Subdominio con Terminal de Rollback
|
|
======================================================================= -->
|
|
<div id="modal-subdomain" class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="modal-subdomain-title">
|
|
<div class="modal-dialog">
|
|
<div class="modal-header">
|
|
<div class="modal-title-wrap">
|
|
<div class="modal-icon-badge" aria-hidden="true">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="10" cy="10" r="8"></circle>
|
|
<path stroke-linecap="round" d="M2 10h16M10 2a14 14 0 0 1 0 16"></path>
|
|
</svg>
|
|
</div>
|
|
<h2 id="modal-subdomain-title" class="modal-title">Crear Nuevo Subdominio</h2>
|
|
</div>
|
|
<button type="button" class="modal-close-btn" aria-label="Cerrar modal">×</button>
|
|
</div>
|
|
|
|
<form id="form-subdomain" novalidate>
|
|
<div class="modal-body">
|
|
<!-- Selector Modo A (Estático) vs Modo B (Proxy Inverso) -->
|
|
<div class="form-group">
|
|
<label class="form-label">Modo Operativo de Apache2</label>
|
|
<div class="mode-selector-grid">
|
|
<button type="button" id="mode-btn-static" class="mode-card-btn active">
|
|
<div class="mode-card-header">
|
|
<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M2 3h12a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"></path>
|
|
</svg>
|
|
<span>Modo A: Estático</span>
|
|
</div>
|
|
<p class="mode-card-desc">Crea /var/www/<subdominio> con index.html inicial y permisos SGID 2775.</p>
|
|
</button>
|
|
|
|
<button type="button" id="mode-btn-proxy" class="mode-card-btn">
|
|
<div class="mode-card-header">
|
|
<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
|
|
<circle cx="4" cy="8" r="2"></circle>
|
|
<circle cx="12" cy="8" r="2"></circle>
|
|
<path stroke-linecap="round" d="M6 8h4"></path>
|
|
</svg>
|
|
<span>Modo B: Proxy</span>
|
|
</div>
|
|
<p class="mode-card-desc">ProxyPass reverso a servicio local (127.0.0.1:<puerto> Node, FastAPI, etc.).</p>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Nombre del Subdominio -->
|
|
<div class="form-group">
|
|
<label for="subdomain-name-input" class="form-label">
|
|
<span>Nombre del Subdominio</span>
|
|
<span style="font-size: 0.72rem; color: var(--text-muted);">Solo a-z, 0-9 y guiones</span>
|
|
</label>
|
|
<input
|
|
type="text"
|
|
id="subdomain-name-input"
|
|
class="form-input"
|
|
placeholder="ejemplo-app"
|
|
required
|
|
maxlength="63"
|
|
autocomplete="off"
|
|
>
|
|
<div id="subdomain-name-feedback" class="input-feedback"></div>
|
|
</div>
|
|
|
|
<!-- Vista Previa de URL en Vivo -->
|
|
<div class="url-preview-card">
|
|
<span>URL Resultante:</span>
|
|
<strong id="preview-url-domain">subdominio.elingejose.com</strong>
|
|
</div>
|
|
|
|
<!-- Puerto para Modo Proxy (Modo B) -->
|
|
<div id="form-group-port" class="form-group" style="display: none;">
|
|
<label for="subdomain-port-input" class="form-label">
|
|
<span>Puerto TCP Local (1024 - 65535)</span>
|
|
<span style="font-size: 0.72rem; color: var(--text-muted);">Redirige a http://127.0.0.1:<puerto></span>
|
|
</label>
|
|
<input
|
|
type="number"
|
|
id="subdomain-port-input"
|
|
class="form-input"
|
|
placeholder="8080"
|
|
min="1024"
|
|
max="65535"
|
|
>
|
|
<div id="subdomain-port-feedback" class="input-feedback"></div>
|
|
</div>
|
|
|
|
<!-- Caja de Alerta de Riesgo Dinámico (Site Risk Assessment) -->
|
|
<div id="subdomain-risk-container" class="risk-alert-container" style="display: none;">
|
|
<div class="risk-alert-header">
|
|
<div class="risk-alert-badge" id="subdomain-risk-level-badge">CRÍTICO</div>
|
|
<strong class="risk-alert-title">Riesgo de Reconfiguración Detectado</strong>
|
|
</div>
|
|
<div id="subdomain-risk-list" class="risk-alert-list">
|
|
<!-- Se puebla dinámicamente al validar riesgos -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Checkbox Obligatorio para Confirmar Impacto de Riesgo -->
|
|
<div id="subdomain-risk-confirmation" class="risk-confirmation-box" style="display: none;">
|
|
<input type="checkbox" id="chk-confirm-subdomain-risk" class="risk-checkbox">
|
|
<label for="chk-confirm-subdomain-risk" class="risk-checkbox-label">
|
|
<strong>Comprendo el impacto y confirmo que deseo aplicar esta reconfiguración</strong>
|
|
<span class="risk-checkbox-sub">Esta acción reconfigurará Apache2 y validará la sintaxis antes del reload.</span>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Terminal de Diagnóstico de Rollback (RFC 7807 Stderr) -->
|
|
<div id="rollback-terminal" class="rollback-terminal-container">
|
|
<div class="terminal-header">
|
|
<div class="terminal-title-wrap">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M10 3.5 2 16.5h16L10 3.5zM10 8.5v4M10 14.5v.5"></path>
|
|
</svg>
|
|
<span>Diagnóstico de Fallo en Apache2</span>
|
|
<span class="terminal-badge">Rollback Atómico OK</span>
|
|
</div>
|
|
<button type="button" id="btn-copy-terminal-stderr" class="btn-copy-code" title="Copiar log">
|
|
Copiar Log
|
|
</button>
|
|
</div>
|
|
<pre id="terminal-stderr-text" class="terminal-body"></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-modal-cancel">Cancelar</button>
|
|
<button type="submit" id="btn-submit-subdomain" class="btn btn-primary" disabled>
|
|
Crear Subdominio
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- =======================================================================
|
|
Modal: Eliminar Subdominio con Checkbox de Purga Física
|
|
======================================================================= -->
|
|
<div id="modal-delete-subdomain" class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="modal-delete-title">
|
|
<div class="modal-dialog">
|
|
<div class="modal-header">
|
|
<div class="modal-title-wrap">
|
|
<div class="modal-icon-badge" style="background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4h14M7 4V2.5A1.5 1.5 0 0 1 8.5 1h3A1.5 1.5 0 0 1 13 2.5V4M5 4v11a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V4"></path>
|
|
</svg>
|
|
</div>
|
|
<h2 id="modal-delete-title" class="modal-title">Eliminar Subdominio</h2>
|
|
</div>
|
|
<button type="button" class="modal-close-btn" aria-label="Cerrar modal">×</button>
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
<p style="font-size: 0.9rem; color: var(--text-secondary);">
|
|
¿Estás seguro de que deseas eliminar el subdominio <strong id="delete-subdomain-target-text" style="color: #f87171;">subdominio.elingejose.com</strong>?
|
|
</p>
|
|
<p style="font-size: 0.8rem; color: var(--text-muted); line-height: 1.5;">
|
|
Esta acción ejecutará <code>a2dissite</code>, eliminará el archivo de configuración en <code>/etc/apache2/sites-available/</code> y recargará Apache2.
|
|
</p>
|
|
|
|
<!-- Checkbox Purga Física -->
|
|
<div id="delete-files-checkbox-container" style="display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.85rem; background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.25); border-radius: var(--radius-md);">
|
|
<input type="checkbox" id="chk-delete-files" style="margin-top: 0.25rem; cursor: pointer;">
|
|
<label for="chk-delete-files" style="font-size: 0.82rem; cursor: pointer; color: var(--text-primary);">
|
|
<strong>Purgar físicamente los archivos web del disco</strong>
|
|
<span style="display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 0.15rem;">
|
|
Elimina de forma irreversible la carpeta asociada en <code>/var/www/<subdominio></code>. Si no se marca, los archivos se preservarán intactos.
|
|
</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-modal-cancel">Cancelar</button>
|
|
<button type="button" id="btn-confirm-delete-subdomain" class="btn btn-danger">
|
|
Confirmar Eliminación
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- =======================================================================
|
|
Modal: Gestor de Archivos (File Manager) para /var/www/<subdominio>
|
|
======================================================================= -->
|
|
<div id="modal-file-manager" class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="fm-modal-title">
|
|
<div class="modal-dialog modal-dialog-xl">
|
|
<div class="modal-header">
|
|
<div class="modal-title-wrap">
|
|
<div class="modal-icon-badge" style="background: rgba(163, 230, 53, 0.12); color: var(--accent-lime); border-color: rgba(163, 230, 53, 0.25);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3 4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-6l-2-2H3z"></path>
|
|
</svg>
|
|
</div>
|
|
<div>
|
|
<h2 id="fm-modal-title" class="modal-title">Gestor de Archivos</h2>
|
|
<div id="fm-current-path-display" class="fm-path-subtitle">/var/www/subdominio</div>
|
|
</div>
|
|
</div>
|
|
<button type="button" class="modal-close-btn" aria-label="Cerrar modal">×</button>
|
|
</div>
|
|
|
|
<!-- Breadcrumbs de Navegación Interactiva -->
|
|
<nav id="fm-breadcrumbs" class="fm-breadcrumbs-bar" aria-label="Ruta de carpetas">
|
|
<!-- Generado dinámicamente -->
|
|
</nav>
|
|
|
|
<!-- Barra de Herramientas del File Manager -->
|
|
<div class="fm-toolbar-container">
|
|
<div class="fm-toolbar-left">
|
|
<!-- Input oculto para subida de archivos -->
|
|
<input type="file" id="fm-file-input" style="display: none;">
|
|
|
|
<button type="button" id="fm-btn-upload" class="btn btn-primary btn-sm">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 12V2M4 6l4-4 4 4M2 14h12"></path>
|
|
</svg>
|
|
<span>Subir Archivo</span>
|
|
</button>
|
|
|
|
<button type="button" id="fm-btn-new-file" class="btn btn-secondary btn-sm">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 3v10M3 8h10"></path>
|
|
</svg>
|
|
<span>Nuevo Archivo</span>
|
|
</button>
|
|
|
|
<button type="button" id="fm-btn-new-folder" class="btn btn-secondary btn-sm">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M2 3h4l2 2h6v8H2zM8 7v4M6 9h4"></path>
|
|
</svg>
|
|
<span>Nueva Carpeta</span>
|
|
</button>
|
|
|
|
<button type="button" id="fm-btn-up-dir" class="btn btn-secondary btn-sm" title="Subir un nivel de carpeta">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8 13V3M4 7l4-4 4 4"></path>
|
|
</svg>
|
|
<span>Subir Nivel</span>
|
|
</button>
|
|
</div>
|
|
|
|
<div class="fm-toolbar-right">
|
|
<span id="fm-items-count-text" class="text-xs text-muted">0 elementos</span>
|
|
<button type="button" id="fm-btn-refresh" class="btn btn-secondary btn-sm" title="Refrescar contenido">
|
|
<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M14 8A6 6 0 1 1 9.5 2.5M14 2.5v4h-4"></path>
|
|
</svg>
|
|
<span>Refrescar</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Fila de creación de nuevo elemento (archivo o carpeta) -->
|
|
<div id="fm-new-item-row" class="fm-create-item-panel" style="display: none;">
|
|
<div class="fm-create-item-form">
|
|
<span id="fm-create-type-label" class="badge badge-mode-static">Archivo</span>
|
|
<input
|
|
type="text"
|
|
id="fm-new-item-name-input"
|
|
class="form-input fm-create-input"
|
|
placeholder="nombre-archivo.php"
|
|
autocomplete="off"
|
|
>
|
|
<button type="button" id="fm-btn-confirm-create-item" class="btn btn-primary btn-sm">Crear</button>
|
|
<button type="button" id="fm-btn-cancel-create-item" class="btn btn-secondary btn-sm">Cancelar</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-body fm-modal-body">
|
|
<div class="table-responsive fm-table-wrap">
|
|
<table class="data-table fm-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Nombre</th>
|
|
<th>Tipo</th>
|
|
<th>Tamaño</th>
|
|
<th>Permisos</th>
|
|
<th>Última Modificación</th>
|
|
<th style="text-align: right;">Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="fm-files-table-body">
|
|
<!-- Se puebla dinámicamente -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-modal-cancel">Cerrar</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- =======================================================================
|
|
Modal: Editor de Código para Archivos Web (.php, .html, .css, .js, etc.)
|
|
======================================================================= -->
|
|
<div id="modal-code-editor" class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="code-editor-file-title">
|
|
<div class="modal-dialog modal-dialog-xl code-editor-dialog">
|
|
<div class="modal-header code-editor-header">
|
|
<div class="modal-title-wrap">
|
|
<div class="modal-icon-badge" style="background: rgba(56, 189, 248, 0.12); color: #38bdf8; border-color: rgba(56, 189, 248, 0.25);">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<polyline points="14 4 18 8 14 12"></polyline>
|
|
<polyline points="6 16 2 12 6 8"></polyline>
|
|
<line x1="12" y1="2" x2="8" y2="18"></line>
|
|
</svg>
|
|
</div>
|
|
<div>
|
|
<h2 id="code-editor-file-title" class="modal-title">index.php</h2>
|
|
<div id="code-editor-file-path" class="code-editor-path">/var/www/app/index.php</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="code-editor-header-actions">
|
|
<div id="code-editor-save-status" class="code-editor-status-tag status-clean">Sin cambios</div>
|
|
<button type="button" id="code-editor-btn-save" class="btn btn-primary btn-sm">
|
|
<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M13 14H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h7l4 4v7a1 1 0 0 1-1 1zM11 2v4H5V2M5 14v-5h6v5"></path>
|
|
</svg>
|
|
<span>Guardar Archivo</span>
|
|
</button>
|
|
<button type="button" id="code-editor-btn-close" class="modal-close-btn" aria-label="Cerrar editor">×</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-body code-editor-body">
|
|
<div class="code-editor-workspace">
|
|
<!-- Columna Izquierda: Números de Línea Sincronizados -->
|
|
<div id="code-editor-linenumbers" class="code-editor-gutter" aria-hidden="true">
|
|
1
|
|
</div>
|
|
<!-- Área de Código -->
|
|
<textarea
|
|
id="code-editor-textarea"
|
|
class="code-editor-textarea"
|
|
placeholder="Contenido del archivo..."
|
|
spellcheck="false"
|
|
autocomplete="off"
|
|
autocorrect="off"
|
|
autocapitalize="off"
|
|
wrap="off"
|
|
></textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer code-editor-footer">
|
|
<div class="code-editor-footer-left">
|
|
<span id="code-editor-cursor-pos" class="text-xs text-muted tabular-nums">Línea 1, Col 1</span>
|
|
<span id="code-editor-char-count" class="text-xs text-muted tabular-nums">0 caracteres</span>
|
|
<span class="code-editor-shortcut-hint"><kbd>Ctrl + S</kbd> para guardar rápidamente</span>
|
|
</div>
|
|
<div class="code-editor-footer-right">
|
|
<button type="button" class="btn btn-secondary btn-modal-cancel">Cerrar</button>
|
|
<button type="button" id="code-editor-btn-save-bottom" class="btn btn-primary">
|
|
Guardar Cambios
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- =======================================================================
|
|
Modal: Crear / Editar Usuario
|
|
======================================================================= -->
|
|
<div id="modal-user" class="modal-backdrop" role="dialog" aria-modal="true" aria-labelledby="modal-user-title">
|
|
<div class="modal-dialog">
|
|
<div class="modal-header">
|
|
<div class="modal-title-wrap">
|
|
<div class="modal-icon-badge">
|
|
<svg viewBox="0 0 20 20" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
|
|
<path stroke-linecap="round" stroke-linejoin="round" d="M16 17v-1.5a3.5 3.5 0 0 0-3.5-3.5h-5A3.5 3.5 0 0 0 4 15.5V17M10 8.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"></path>
|
|
</svg>
|
|
</div>
|
|
<h2 id="modal-user-title" class="modal-title">Gestión de Usuario</h2>
|
|
</div>
|
|
<button type="button" class="modal-close-btn" aria-label="Cerrar modal">×</button>
|
|
</div>
|
|
|
|
<form id="form-user" novalidate>
|
|
<input type="hidden" id="user-id-hidden">
|
|
<div class="modal-body">
|
|
<div class="form-group">
|
|
<label for="user-username-input" class="form-label">Nombre de Usuario</label>
|
|
<input type="text" id="user-username-input" class="form-input" placeholder="ej: operador1" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="user-fullname-input" class="form-label">Nombre Completo</label>
|
|
<input type="text" id="user-fullname-input" class="form-input" placeholder="ej: Juan Pérez">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="user-password-input" class="form-label">Contraseña</label>
|
|
<input type="password" id="user-password-input" class="form-input" placeholder="••••••••••••">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="user-role-select" class="form-label">Rol del Sistema</label>
|
|
<select id="user-role-select" class="select-filter" style="width: 100%;">
|
|
<option value="operator">Operador (Gestionar subdominios y ver estadísticas)</option>
|
|
<option value="admin">Administrador (Control total y gestión de usuarios)</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary btn-modal-cancel">Cancelar</button>
|
|
<button type="submit" id="btn-submit-user" class="btn btn-primary">Guardar Usuario</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Contenedor Global de Toasts Flotantes -->
|
|
<div id="toast-container" class="toast-container" aria-live="polite" aria-atomic="true"></div>
|
|
|
|
<!-- Script Principal de la SPA (Zero-Build ES Module) -->
|
|
<script type="module" src="/js/app.js"></script>
|
|
</body>
|
|
</html>
|