feat: Complete ATLAS system installation and API fixes

## Backend Changes
- Add new API endpoints: combustible, pois, mantenimiento, video, configuracion
- Fix vehiculos endpoint to return paginated response with items array
- Add /vehiculos/all endpoint for non-paginated list
- Add /geocercas/all endpoint
- Add /alertas/configuracion GET/PUT endpoints
- Add /viajes/activos and /viajes/iniciar endpoints
- Add /reportes/stats, /reportes/templates, /reportes/preview endpoints
- Add /conductores/all and /conductores/disponibles endpoints
- Update router.py to include all new modules

## Frontend Changes
- Fix authentication token handling (snake_case vs camelCase)
- Update vehiculosApi.listAll to use /vehiculos/all
- Fix FuelGauge component usage in Combustible page
- Fix chart component exports (named + default exports)
- Update API client for proper token refresh

## Infrastructure
- Rename services from ADAN to ATLAS
- Configure Cloudflare tunnel for atlas.consultoria-as.com
- Update systemd service files
- Configure PostgreSQL with TimescaleDB
- Configure Redis, Mosquitto, Traccar, MediaMTX

## Documentation
- Update installation guides
- Update API reference
- Rename all ADAN references to ATLAS

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
ATLAS Admin
2026-01-25 03:04:23 +00:00
parent 0dfce3ce20
commit e59aa2a742
73 changed files with 4415 additions and 450 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# ============================================
# Sistema de ADAN - Estado del Sistema
# Sistema de ATLAS - Estado del Sistema
# ============================================
# Muestra informacion completa del estado
# ============================================
@@ -13,7 +13,7 @@ BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m'
INSTALL_DIR="${INSTALL_DIR:-/opt/adan}"
INSTALL_DIR="${INSTALL_DIR:-/opt/atlas}"
# Cargar variables
if [[ -f "$INSTALL_DIR/.env" ]]; then
@@ -24,7 +24,7 @@ clear
echo ""
echo -e "${CYAN}╔══════════════════════════════════════════════════════════════╗${NC}"
echo -e "${CYAN}║ SISTEMA DE ADAN - ESTADO DEL SISTEMA ║${NC}"
echo -e "${CYAN}║ SISTEMA DE ATLAS - ESTADO DEL SISTEMA ║${NC}"
echo -e "${CYAN}╚══════════════════════════════════════════════════════════════╝${NC}"
echo ""
@@ -84,8 +84,8 @@ check_service() {
printf "│ %-14s %s\n" "$name:" "$status"
}
check_service "adan-api" "API Backend" "${API_PORT:-8000}"
check_service "adan-web" "Frontend" "${FRONTEND_PORT:-3000}"
check_service "atlas-api" "API Backend" "${API_PORT:-8000}"
check_service "atlas-web" "Frontend" "${FRONTEND_PORT:-3000}"
check_service "postgresql" "PostgreSQL" "5432"
check_service "redis-server" "Redis" "6379"
check_service "traccar" "Traccar GPS" "${TRACCAR_PORT:-5055}"
@@ -103,15 +103,15 @@ echo -e "${BLUE}┌─ Base de Datos ──────────────
if systemctl is-active --quiet postgresql; then
# Tamanio de BD
DB_SIZE=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-adan}" -d "${POSTGRES_DB:-adan}" -t -c "SELECT pg_size_pretty(pg_database_size(current_database()));" 2>/dev/null | xargs)
DB_SIZE=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-atlas}" -d "${POSTGRES_DB:-atlas}" -t -c "SELECT pg_size_pretty(pg_database_size(current_database()));" 2>/dev/null | xargs)
echo -e "│ Tamanio BD: ${DB_SIZE:-N/A}"
# Conexiones activas
CONNECTIONS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-adan}" -d "${POSTGRES_DB:-adan}" -t -c "SELECT count(*) FROM pg_stat_activity WHERE datname = current_database();" 2>/dev/null | xargs)
CONNECTIONS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-atlas}" -d "${POSTGRES_DB:-atlas}" -t -c "SELECT count(*) FROM pg_stat_activity WHERE datname = current_database();" 2>/dev/null | xargs)
echo -e "│ Conexiones: ${CONNECTIONS:-N/A} activas"
# Posiciones (si existe la tabla)
POSITIONS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-adan}" -d "${POSTGRES_DB:-adan}" -t -c "SELECT COUNT(*) FROM positions;" 2>/dev/null | xargs)
POSITIONS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-atlas}" -d "${POSTGRES_DB:-atlas}" -t -c "SELECT COUNT(*) FROM positions;" 2>/dev/null | xargs)
if [[ -n "$POSITIONS" ]]; then
echo -e "│ Posiciones: ${POSITIONS} registros"
fi
@@ -150,10 +150,10 @@ echo -e "${BLUE}┌─ GPS / Unidades ──────────────
if systemctl is-active --quiet postgresql; then
# Total de unidades
TOTAL_UNITS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-adan}" -d "${POSTGRES_DB:-adan}" -t -c "SELECT COUNT(*) FROM units;" 2>/dev/null | xargs)
TOTAL_UNITS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-atlas}" -d "${POSTGRES_DB:-atlas}" -t -c "SELECT COUNT(*) FROM units;" 2>/dev/null | xargs)
# Unidades activas (con posicion en ultimos 5 min)
ACTIVE_UNITS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-adan}" -d "${POSTGRES_DB:-adan}" -t -c "SELECT COUNT(DISTINCT unit_id) FROM positions WHERE device_time > NOW() - INTERVAL '5 minutes';" 2>/dev/null | xargs)
ACTIVE_UNITS=$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -h localhost -U "${POSTGRES_USER:-atlas}" -d "${POSTGRES_DB:-atlas}" -t -c "SELECT COUNT(DISTINCT unit_id) FROM positions WHERE device_time > NOW() - INTERVAL '5 minutes';" 2>/dev/null | xargs)
echo -e "│ Total: ${TOTAL_UNITS:-0} unidades"
echo -e "│ Activas: ${ACTIVE_UNITS:-0} (ultimo 5 min)"
@@ -190,7 +190,7 @@ echo ""
# ---------------------------------------------
echo -e "${BLUE}┌─ Ultimos Errores (API) ────────────────────────────────────┐${NC}"
ERRORS=$(journalctl -u adan-api --since "1 hour ago" -p err --no-pager -q 2>/dev/null | tail -3)
ERRORS=$(journalctl -u atlas-api --since "1 hour ago" -p err --no-pager -q 2>/dev/null | tail -3)
if [[ -z "$ERRORS" ]]; then
echo -e "${GREEN}Sin errores en la ultima hora${NC}"