Commit Graph
4 Commits
Author SHA1 Message Date
Lizandro GuarnizoandCopilot c834e40e83 fix(servidor-dashboard): show DB connection count on server cards
- GetServidor: query conx_count per server with GROUP BY and attach to response
- servidor_dashboard.html: use conx_count from API (fallback to _conexiones.length)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 10:25:18 -05:00
Lizandro GuarnizoandCopilot 03ccc75337 Fix servidor dashboard: correct all field names to match models
All fields were using wrong names (Go struct names instead of JSON tags):
- servidor.Nombre → servidor.nombre
- servidor.IP → servidor.ip_servidor
- servidor.TipoServidor → servidor.tipo_servidor
- servidor.ProvServidor → servidor.prov_servidor
- servidor.Ram → servidor.ram
- servidor.CPU → servidor.nucleos (correct field)
- servidor.Almacenamiento → servidor.disco
- servidor.SO → servidor.so
- servidor.FechaExpiracion → servidor.vencimiento
- servidor.Activo → removed (field does not exist)
- servidor.Descripcion → removed (field does not exist)

For ConxDb:
- conexion.Nombre → removed (field does not exist)
- conexion.Host → conexion.servidor.ip_servidor (from preloaded relation)
- conexion.Puerto → conexion.puerto
- conexion.Usuario → conexion.usuario
- conexion.TipoDb → conexion.tipo_db
- conexion.Estado → removed (field does not exist)
- conexion.Version → removed (field does not exist)

Also improved UI: loading skeleton, better card layout, ping badges inline.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 10:07:06 -05:00
Lizandro GuarnizoandCopilot 7d02add55e Fix dashboard URLs: remove /api prefix from fetch calls
Routes are registered under /app (web group), not /api/app.
The requests were hitting the JWT-protected API group causing 'Invalid Attempt' error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 09:58:21 -05:00
Lizandro GuarnizoandCopilot 29820c8706 Add Servidor Dashboard with connection monitoring
- Created servidor_dashboard.html with beautiful visual dashboard
- Shows all servers in grid cards with basic info
- Click button opens detailed modal with:
  - Server full information (IP, CPU, RAM, Storage, OS, Expiration)
  - All connected databases in a clean diagram layout
  - Database connection status (active/inactive)
  - Connection details (Host, Port, User, Type)
  - Ping button to test connection with response time
  - View Connection button to open query-runner
- Backend updates:
  - Added ServidorDashboard() controller to render the dashboard view
  - Added GetServidorDashboard() API endpoint to fetch server + connections
  - Added PingConexion() endpoint to test database connections (TCP + DB test)
  - Color-coded status badges and database type indicators
  - Responsive design for mobile and desktop
- Routes:
  - GET /app/servidor-dashboard (render view)
  - GET /api/app/servidor-dashboard/:id (get server details API)
  - GET /api/app/conx-ping/:id (ping connection endpoint)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 08:49:18 -05:00