- admin.html: removed conflicting inline script, added api.js + admin.js - admin.js: dynamic section loader with fetch, init navigates to hash - api.js: credentials: 'include' for all admin requests - propertyModal: added name attributes to all form fields, saveProperty onclick handler - server/index.ts: added POST /api/analytics/event with daily aggregation - server/validation.ts: removed min(6) from password for 401 on invalid credentials - capability-index.yaml: added 11 MCP capability routes - docker-compose-mcp.yml: created for MCP servers
80 lines
4.4 KiB
HTML
80 lines
4.4 KiB
HTML
<!-- ============ USERS SECTION ============ -->
|
|
<section class="page-section" id="section-users">
|
|
<div class="page-header">
|
|
<div>
|
|
<h1 class="page-title">Usuarios</h1>
|
|
<p class="page-subtitle">Gestiona los usuarios del sistema</p>
|
|
</div>
|
|
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#userModal">
|
|
<i class="bi bi-plus-lg me-2"></i>Añadir usuario
|
|
</button>
|
|
</div>
|
|
|
|
<div class="table-card">
|
|
<div class="table-wrapper">
|
|
<table class="table table-hover mb-0" id="usersTable">
|
|
<thead>
|
|
<tr>
|
|
<th>Usuario</th>
|
|
<th>Email</th>
|
|
<th>Rol</th>
|
|
<th>Fecha creación</th>
|
|
<th>Estado</th>
|
|
<th>Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="usersTableBody">
|
|
<tr><td colspan="6" class="text-center text-muted py-4">Cargando...</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- User Modal -->
|
|
<div class="modal fade" id="userModal" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="userModalTitle"><i class="bi bi-person-plus me-2"></i>Añadir usuario</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<input type="hidden" id="userEditId">
|
|
<div class="mb-3">
|
|
<label class="form-label">Nombre</label>
|
|
<input type="text" class="form-control" id="userName" placeholder="Nombre completo">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Email</label>
|
|
<input type="email" class="form-control" id="userEmail" placeholder="usuario@ejemplo.com">
|
|
</div>
|
|
<div class="mb-3" id="userPasswordField">
|
|
<label class="form-label">Contraseña</label>
|
|
<input type="password" class="form-control" id="userPassword" placeholder="Mínimo 8 caracteres">
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Rol</label>
|
|
<select class="form-select" id="userRole">
|
|
<option value="admin">Administrador</option>
|
|
<option value="agent">Agente</option>
|
|
<option value="editor">Editor</option>
|
|
</select>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Idioma</label>
|
|
<select class="form-select" id="userLanguage">
|
|
<option value="es">Español</option>
|
|
<option value="ru">Русский</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancelar</button>
|
|
<button type="button" class="btn btn-primary" onclick="admin.saveUser()">
|
|
<i class="bi bi-check-lg me-2"></i>Guardar
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |