16 Commits

Author SHA1 Message Date
stern a58c80e9ee Add workflow 2026-07-02 02:03:14 -06:00
IO 1219ca1e91 Merge branch 'Carlos' of https://repositorio.acatlan.unam.mx/IO/front-Censo into Lino 2026-03-20 17:57:33 -05:00
frcarlos 7ee30a6f20 biblioteca_hotmap 2026-03-20 15:33:32 -04:00
IO 179a968e3e added dependencies 2026-03-20 13:48:48 -05:00
IO bae1f99e5c Merge branch 'Carlos' of repositorio.acatlan.unam.mx:IO/front-Censo into Lino 2026-03-20 13:48:18 -05:00
frcarlos 725bc15f63 hotmap 2026-03-20 14:47:09 -04:00
IO 2dfeea0cb4 merge carlos and fixed table 2026-03-20 13:43:38 -05:00
IO 811f5e7c0e Merge branch 'Carlos' of repositorio.acatlan.unam.mx:IO/front-Censo into Lino 2026-03-20 11:54:51 -05:00
frcarlos 7833d38b3e poligonos_edificios 2026-03-19 20:43:46 -04:00
frcarlos 08bca7742b cedetec 2026-03-19 19:01:47 -04:00
frcarlos 48885dd8e7 a6-a15 2026-03-19 16:38:48 -04:00
frcarlos c400623c25 a1-a10 2026-03-18 20:36:29 -04:00
frcarlos a6ef226bec cordenadas a1-a6 2026-03-18 18:14:24 -04:00
frcarlos c444b9f37a cordenasdeedf a1-a6 2026-03-18 18:10:54 -04:00
frcarlos deae0cde7c hotmap 2026-03-13 21:32:26 -04:00
frcarlos 188fb18b51 hotmap 2026-03-12 20:11:45 -04:00
12 changed files with 388 additions and 66 deletions
+81
View File
@@ -0,0 +1,81 @@
name: Despliegue Automatizado Universal
on:
push:
branches:
- develop
- master
jobs:
# 1. PASO INTELIGENTE: Obtiene el contexto y lee apps.conf usando la ruta actual
get-context:
runs-on: host
outputs:
node_version: ${{ steps.setup.outputs.version }}
target_app: ${{ steps.setup.outputs.app }}
steps:
- name: Resolver Aplicación desde apps.conf por Ruta
id: setup
run: |
# 1. Obtener la ruta absoluta donde está clonado este proyecto en el runner (ej: /var/www/html/front/pruebas/presupuesto)
CURRENT_PATH=$(pwd)
echo "Buscando qué sección de apps.conf coincide con la ruta: $CURRENT_PATH"
# 2. Buscar en apps.conf el bloque que tenga exactamente ese APP_PATH
# Usamos awk para encontrar el bloque [nombre] asociado a esa ruta
TARGET_APP=$(awk -v path="$CURRENT_PATH" '
/^\[/ { gsub(/[\[\]]/, "", $0); current_box=$0; next }
$0 ~ "^APP_PATH="path"$" { print current_box; exit }
' /home/deploy/apps.conf)
if [ -z "$TARGET_APP" ]; then
echo "ERROR: No se encontró ninguna aplicación en apps.conf que coincida con la ruta $CURRENT_PATH"
exit 1
fi
# 3. Una vez que sabemos el nombre del bloque (ej: presupuesto-dev), leemos su versión de Node
VERSION=$(awk -v app="$TARGET_APP" '
$0=="["app"]" { found=1; next }
/^\[/ && found { exit }
found && /^NODE=/ { split($0, a, "="); print a[2]; exit }
' /home/deploy/apps.conf)
MAJOR_VERSION=$(echo "$VERSION" | tr -d '[:space:]' | grep -oE '[0-9]+' | head -n1)
echo "-> ID de Aplicación encontrado: $TARGET_APP"
echo "-> Versión Mayor de Node resuelta: $MAJOR_VERSION"
# Exportar variables para los siguientes pasos
echo "app=${TARGET_APP}" >> $GITHUB_OUTPUT
echo "version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
# 2. PASO DE COMPILACIÓN: Se ejecuta seguro en Docker con la versión correcta
build:
needs: get-context
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configurar Node.js dinámicamente
uses: actions/setup-node@v4
with:
node-version: ${{ needs.get-context.outputs.node_version }}
- run: npm ci
- run: npm run build
# 3. PASO DE DESPLIEGUE: Invoca tu script enviando el ID dinámico
deploy:
needs: [get-context, build]
runs-on: host
steps:
- name: Ejecutar Despliegue en Servidor Físico
run: |
TARGET_APP="${{ needs.get-context.outputs.target_app }}"
BRANCH_NAME="${{ github.ref_name }}"
echo "Iniciando script de despliegue para el identificador: $TARGET_APP"
# Llama a tu script pasándole el ID que descubrimos en el primer paso
sudo -u deploy /home/deploy/scripts/deploy-front.sh "$TARGET_APP" "$BRANCH_NAME"
+118 -58
View File
@@ -14,16 +14,20 @@
"axios": "^1.13.2",
"js-cookie": "^3.0.5",
"jwt-decode": "^4.0.0",
"leaflet": "^1.9.4",
"leaflet.heat": "^0.2.0",
"next": "^16.0.7",
"react": "19.2.0",
"react-dom": "19.2.0",
"react-hot-toast": "^2.6.0",
"react-leaflet": "^5.0.0",
"react-select": "^5.10.2",
"recharts": "^3.8.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/js-cookie": "^3.0.6",
"@types/leaflet": "^1.9.21",
"@types/node": "^24",
"@types/react": "^19",
"@types/react-dom": "^19",
@@ -274,21 +278,21 @@
}
},
"node_modules/@emnapi/core": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.0.tgz",
"integrity": "sha512-pJdKGq/1iquWYtv1RRSljZklxHCOCAJFJrImO5ZLKPJVJlVUcs8yFwNQlqS0Lo8xT1VAXXTCZocF9n26FWEKsw==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz",
"integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"@emnapi/wasi-threads": "1.1.0",
"@emnapi/wasi-threads": "1.2.0",
"tslib": "^2.4.0"
}
},
"node_modules/@emnapi/runtime": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.0.tgz",
"integrity": "sha512-oAYoQnCYaQZKVS53Fq23ceWMRxq5EhQsE0x0RdQ55jT7wagMu5k+fS39v1fiSLrtrLQlXwVINenqhLMtTrV/1Q==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz",
"integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -296,9 +300,9 @@
}
},
"node_modules/@emnapi/wasi-threads": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz",
"integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==",
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz",
"integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==",
"dev": true,
"license": "MIT",
"optional": true,
@@ -1188,9 +1192,9 @@
}
},
"node_modules/@next/env": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/env/-/env-16.1.6.tgz",
"integrity": "sha512-N1ySLuZjnAtN3kFnwhAwPvZah8RJxKasD7x1f8shFqhncnWZn4JMfg37diLNuoHsLAlrDfM3g4mawVdtAG8XLQ==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.0.tgz",
"integrity": "sha512-OZIbODWWAi0epQRCRjNe1VO45LOFBzgiyqmTLzIqWq6u1wrxKnAyz1HH6tgY/Mc81YzIjRPoYsPAEr4QV4l9TA==",
"license": "MIT"
},
"node_modules/@next/eslint-plugin-next": {
@@ -1204,9 +1208,9 @@
}
},
"node_modules/@next/swc-darwin-arm64": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.1.6.tgz",
"integrity": "sha512-wTzYulosJr/6nFnqGW7FrG3jfUUlEf8UjGA0/pyypJl42ExdVgC6xJgcXQ+V8QFn6niSG2Pb8+MIG1mZr2vczw==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.0.tgz",
"integrity": "sha512-/JZsqKzKt01IFoiLLAzlNqys7qk2F3JkcUhj50zuRhKDQkZNOz9E5N6wAQWprXdsvjRP4lTFj+/+36NSv5AwhQ==",
"cpu": [
"arm64"
],
@@ -1220,9 +1224,9 @@
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.1.6.tgz",
"integrity": "sha512-BLFPYPDO+MNJsiDWbeVzqvYd4NyuRrEYVB5k2N3JfWncuHAy2IVwMAOlVQDFjj+krkWzhY2apvmekMkfQR0CUQ==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.0.tgz",
"integrity": "sha512-/hV8erWq4SNlVgglUiW5UmQ5Hwy5EW/AbbXlJCn6zkfKxTy/E/U3V8U1Ocm2YCTUoFgQdoMxRyRMOW5jYy4ygg==",
"cpu": [
"x64"
],
@@ -1236,9 +1240,9 @@
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.1.6.tgz",
"integrity": "sha512-OJYkCd5pj/QloBvoEcJ2XiMnlJkRv9idWA/j0ugSuA34gMT6f5b7vOiCQHVRpvStoZUknhl6/UxOXL4OwtdaBw==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.0.tgz",
"integrity": "sha512-GkjL/Q7MWOwqWR9zoxu1TIHzkOI2l2BHCf7FzeQG87zPgs+6WDh+oC9Sw9ARuuL/FUk6JNCgKRkA6rEQYadUaw==",
"cpu": [
"arm64"
],
@@ -1252,9 +1256,9 @@
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.1.6.tgz",
"integrity": "sha512-S4J2v+8tT3NIO9u2q+S0G5KdvNDjXfAv06OhfOzNDaBn5rw84DGXWndOEB7d5/x852A20sW1M56vhC/tRVbccQ==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.0.tgz",
"integrity": "sha512-1ffhC6KY5qWLg5miMlKJp3dZbXelEfjuXt1qcp5WzSCQy36CV3y+JT7OC1WSFKizGQCDOcQbfkH/IjZP3cdRNA==",
"cpu": [
"arm64"
],
@@ -1268,9 +1272,9 @@
}
},
"node_modules/@next/swc-linux-x64-gnu": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.1.6.tgz",
"integrity": "sha512-2eEBDkFlMMNQnkTyPBhQOAyn2qMxyG2eE7GPH2WIDGEpEILcBPI/jdSv4t6xupSP+ot/jkfrCShLAa7+ZUPcJQ==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.0.tgz",
"integrity": "sha512-FmbDcZQ8yJRq93EJSL6xaE0KK/Rslraf8fj1uViGxg7K4CKBCRYSubILJPEhjSgZurpcPQq12QNOJQ0DRJl6Hg==",
"cpu": [
"x64"
],
@@ -1284,9 +1288,9 @@
}
},
"node_modules/@next/swc-linux-x64-musl": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.1.6.tgz",
"integrity": "sha512-oicJwRlyOoZXVlxmIMaTq7f8pN9QNbdes0q2FXfRsPhfCi8n8JmOZJm5oo1pwDaFbnnD421rVU409M3evFbIqg==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.0.tgz",
"integrity": "sha512-HzjIHVkmGAwRbh/vzvoBWWEbb8BBZPxBvVbDQDvzHSf3D8RP/4vjw7MNLDXFF9Q1WEzeQyEj2zdxBtVAHu5Oyw==",
"cpu": [
"x64"
],
@@ -1300,9 +1304,9 @@
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.1.6.tgz",
"integrity": "sha512-gQmm8izDTPgs+DCWH22kcDmuUp7NyiJgEl18bcr8irXA5N2m2O+JQIr6f3ct42GOs9c0h8QF3L5SzIxcYAAXXw==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.0.tgz",
"integrity": "sha512-UMiFNQf5H7+1ZsZPxEsA064WEuFbRNq/kEXyepbCnSErp4f5iut75dBA8UeerFIG3vDaQNOfCpevnERPp2V+nA==",
"cpu": [
"arm64"
],
@@ -1316,9 +1320,9 @@
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.1.6.tgz",
"integrity": "sha512-NRfO39AIrzBnixKbjuo2YiYhB6o9d8v/ymU9m/Xk8cyVk+k7XylniXkHwjs4s70wedVffc6bQNbufk5v0xEm0A==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.0.tgz",
"integrity": "sha512-DRrNJKW+/eimrZgdhVN1uvkN1OI4j6Lpefwr44jKQ0YQzztlmOBUUzHuV5GxOMPK3nmodAYElUVCY8ZXo/IWeA==",
"cpu": [
"x64"
],
@@ -1675,6 +1679,17 @@
"url": "https://opencollective.com/parcel"
}
},
"node_modules/@react-leaflet/core": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@react-leaflet/core/-/core-3.0.0.tgz",
"integrity": "sha512-3EWmekh4Nz+pGcr+xjf0KNyYfC3U2JjnkWsh0zcqaexYqmmB5ZhH37kz41JXGmKzpaMZCnPofBBm64i+YrEvGQ==",
"license": "Hippocratic-2.1",
"peerDependencies": {
"leaflet": "^1.9.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
},
"node_modules/@reduxjs/toolkit": {
"version": "2.11.2",
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.11.2.tgz",
@@ -1820,6 +1835,13 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/geojson": {
"version": "7946.0.16",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz",
"integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/js-cookie": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.6.tgz",
@@ -1841,6 +1863,16 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/leaflet": {
"version": "1.9.21",
"resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.21.tgz",
"integrity": "sha512-TbAd9DaPGSnzp6QvtYngntMZgcRk+igFELwR2N99XZn7RXUdKgsXMR+28bUO0rPsWp8MIu/f47luLIQuSLYv/w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/geojson": "*"
}
},
"node_modules/@types/node": {
"version": "24.10.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",
@@ -2821,12 +2853,15 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
"version": "2.9.6",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.6.tgz",
"integrity": "sha512-v9BVVpOTLB59C9E7aSnmIF8h7qRsFpx+A2nugVMTszEOMcfjlZMsXRm4LF23I3Z9AJxc8ANpIvzbzONoX9VJlg==",
"version": "2.10.9",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.9.tgz",
"integrity": "sha512-OZd0e2mU11ClX8+IdXe3r0dbqMEznRiT4TfbhYIbcRPZkqJ7Qwer8ij3GZAmLsRKa+II9V1v5czCkvmHH3XZBg==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.js"
"baseline-browser-mapping": "dist/cli.cjs"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/brace-expansion": {
@@ -4186,9 +4221,9 @@
}
},
"node_modules/flatted": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz",
"integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz",
"integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==",
"dev": true,
"license": "ISC"
},
@@ -5244,6 +5279,17 @@
"node": ">=0.10"
}
},
"node_modules/leaflet": {
"version": "1.9.4",
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",
"license": "BSD-2-Clause"
},
"node_modules/leaflet.heat": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/leaflet.heat/-/leaflet.heat-0.2.0.tgz",
"integrity": "sha512-Cd5PbAA/rX3X3XKxfDoUGi9qp78FyhWYurFg3nsfhntcM/MCNK08pRkf4iEenO1KNqwVPKCmkyktjW3UD+h9bQ=="
},
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -5440,14 +5486,14 @@
"license": "MIT"
},
"node_modules/next": {
"version": "16.1.6",
"resolved": "https://registry.npmjs.org/next/-/next-16.1.6.tgz",
"integrity": "sha512-hkyRkcu5x/41KoqnROkfTm2pZVbKxvbZRuNvKXLRXxs3VfyO0WhY50TQS40EuKO9SW3rBj/sF3WbVwDACeMZyw==",
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/next/-/next-16.2.0.tgz",
"integrity": "sha512-NLBVrJy1pbV1Yn00L5sU4vFyAHt5XuSjzrNyFnxo6Com0M0KrL6hHM5B99dbqXb2bE9pm4Ow3Zl1xp6HVY9edQ==",
"license": "MIT",
"dependencies": {
"@next/env": "16.1.6",
"@next/env": "16.2.0",
"@swc/helpers": "0.5.15",
"baseline-browser-mapping": "^2.8.3",
"baseline-browser-mapping": "^2.9.19",
"caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31",
"styled-jsx": "5.1.6"
@@ -5459,15 +5505,15 @@
"node": ">=20.9.0"
},
"optionalDependencies": {
"@next/swc-darwin-arm64": "16.1.6",
"@next/swc-darwin-x64": "16.1.6",
"@next/swc-linux-arm64-gnu": "16.1.6",
"@next/swc-linux-arm64-musl": "16.1.6",
"@next/swc-linux-x64-gnu": "16.1.6",
"@next/swc-linux-x64-musl": "16.1.6",
"@next/swc-win32-arm64-msvc": "16.1.6",
"@next/swc-win32-x64-msvc": "16.1.6",
"sharp": "^0.34.4"
"@next/swc-darwin-arm64": "16.2.0",
"@next/swc-darwin-x64": "16.2.0",
"@next/swc-linux-arm64-gnu": "16.2.0",
"@next/swc-linux-arm64-musl": "16.2.0",
"@next/swc-linux-x64-gnu": "16.2.0",
"@next/swc-linux-x64-musl": "16.2.0",
"@next/swc-win32-arm64-msvc": "16.2.0",
"@next/swc-win32-x64-msvc": "16.2.0",
"sharp": "^0.34.5"
},
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",
@@ -5920,6 +5966,20 @@
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
"license": "MIT"
},
"node_modules/react-leaflet": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-5.0.0.tgz",
"integrity": "sha512-CWbTpr5vcHw5bt9i4zSlPEVQdTVcML390TjeDG0cK59z1ylexpqC6M1PJFjV8jD7CF+ACBFsLIDs6DRMoLEofw==",
"license": "Hippocratic-2.1",
"dependencies": {
"@react-leaflet/core": "^3.0.0"
},
"peerDependencies": {
"leaflet": "^1.9.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
},
"node_modules/react-redux": {
"version": "9.2.0",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
+5 -1
View File
@@ -15,16 +15,20 @@
"axios": "^1.13.2",
"js-cookie": "^3.0.5",
"jwt-decode": "^4.0.0",
"leaflet": "^1.9.4",
"leaflet.heat": "^0.2.0",
"next": "^16.0.7",
"react": "19.2.0",
"react-dom": "19.2.0",
"react-hot-toast": "^2.6.0",
"react-leaflet": "^5.0.0",
"react-select": "^5.10.2",
"recharts": "^3.8.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/js-cookie": "^3.0.6",
"@types/leaflet": "^1.9.21",
"@types/node": "^24",
"@types/react": "^19",
"@types/react-dom": "^19",
@@ -34,4 +38,4 @@
"sass": "^1.94.0",
"typescript": "^5"
}
}
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 KiB

+3 -1
View File
@@ -1,13 +1,15 @@
"use client";
import { useState } from "react";
import Pregunta7 from "@/components/Equipo_Computo/Pregunta7";
import Pregunta1EP from "@/components/Perifericos/Pregunta1EP";
import Pregunta2EP from "@/components/Perifericos/Pregunta2EP";
import Pregunta4EP from "@/components/Perifericos/Pregunta4EP";
import Pregunta5EP from "@/components/Perifericos/Pregunta5EP";
import "../../styles/layout/reporte.scss";
import DownloadReporteXLSX from "@/components/Dowload/Reporte";
import Pregunta7 from "@/components/Equipo_Computo/Pregunta7";
type PreguntaKey = "pregunta1" | "pregunta4" | "pregunta7";
@@ -1,7 +1,6 @@
"use client";
import { useState } from "react";
import DownloadReporteXLSX from "@/components/Dowload/Reporte";
import Reporte from "@/components/reporteGraficas/reporte";
import "../../styles/layout/reporte.scss";
+1 -1
View File
@@ -39,7 +39,7 @@ export default function Login() {
if (tipo === 2) {
router.push("/escaner");
} else if (tipo === 1) {
router.push("/equipoComputo");
router.push("/reportesGraficas");
} else {
toast.error("Tipo de usuario no válido");
}
+1
View File
@@ -14,6 +14,7 @@ export default function DownloadTable({ filtros,count }: Props) {
const [loading, setLoading] = useState(false);
const handleDownload = async () => {
if(!filtros.length){return}
setLoading(true);
const token = Cookies.get("token");
+157
View File
@@ -0,0 +1,157 @@
"use client";
import { MapContainer, ImageOverlay, useMap } from "react-leaflet";
import L, { LatLngBoundsExpression } from "leaflet";
import "leaflet/dist/leaflet.css";
import "leaflet.heat";
import { useEffect } from "react";
// Ajustar vista automáticamente
function AjustarVista({ bounds }: { bounds: LatLngBoundsExpression }) {
const map = useMap();
useEffect(() => {
map.fitBounds(bounds);
}, [map, bounds]);
return null;
}
function HeatLayer() {
const map = useMap();
useEffect(() => {
// A 4768x3368
const edificios = {
A1: [[1407, 3054], [1470, 3054], [1470, 3360], [1407, 3360]],
A2: [[1570, 3130], [1570, 3190], [1850, 3190], [1850, 3130]],
A3: [[1640, 2650], [1705, 2650], [1705, 2950], [1640, 2950]],
A4: [[1268, 2765], [1268, 2830], [1540, 2830], [1540, 2765]],
A5: [[995, 2405], [1295, 2405], [1295, 2470], [995, 2470]],
A6: [[1390, 2385], [1450, 2385], [1450, 2655], [1390, 2655]],
A7: [[1234, 2014], [1296, 2014], [1296, 2317], [1234, 2317]],
A8: [[1390, 2055], [1700, 2055], [1700, 2118], [1390, 2118]],
A9: [[1215, 1825], [1480, 1825], [1480, 1890], [1215, 1890]],
A10: [[1570, 1695], [1635, 1695], [1635, 1960], [1570, 1960]],
A11: [[1475, 1510], [1780, 1510], [1780, 1570], [1475, 1570]],
A12: [[1310, 1395], [1375, 1395], [1375, 1700], [1310, 1700]],
A13: [[1780, 810], [1845, 810], [1845, 1020], [1780, 1020]],
A14: [[1505, 775], [1713, 775], [1713, 840], [1505, 840]],
A15: [[2027, 2580], [2087, 2580], [2087, 2900], [2027, 2900]],
AEROGRAFIA: [[1157, 3308], [1254, 3308], [1254, 3369], [1157, 3369]],
ALMACEN: [[989, 1523], [1027, 1523], [1027, 1749], [989, 1749]],
APOYO_DOC: [[1115, 1222], [1475, 1222], [1475, 1293], [1115, 1293]],
BIBLIOTECA: [[1578, 2372], [1578, 2199], [1593, 2213], [1739, 2213],[1835, 2114], [1889, 2168], [1889, 2345], [1860, 2375],[1888, 2407], [1844, 2450], [1830, 2435], [1814, 2451],[1799, 2435], [1772, 2466], [1766, 2460], [1703, 2523],[1686, 2506], [1645, 2505], [1645, 2465], [1630, 2466],[1629, 2402], [1677, 2402], [1677, 2372], [1666, 2360], [1591, 2360]],
CEI: [[1570, 990], [1767, 990], [1767, 1155], [1570, 1155]],
INVEST: [[1570, 1240], [1727, 1240], [1727, 1400], [1570, 1400]],
CEDTEC: [[885, 2900], [1080, 2900], [1080, 3200], [885, 3200]],
CEMM: [[2167, 863], [2453, 863], [2453, 1458], [2167, 1458]],
CAFETERIA_Y_LIBRERIA: [[2027, 1483], [2158, 1483], [2158, 1600], [2027, 1600]],
CTED: [[1802, 1063], [1908, 1128], [1888, 1179], [1772, 1151]],
POSGRADO: [[857, 1472], [1004, 1471],[1004, 1327],[1086, 1325],[1086, 1512], [860, 1512]],
UNIDAD_SEMINA: [[1145, 2894], [1320, 2894], [1320, 3070], [1145, 3070]],
TALLS_Y_LAB: [[1085, 3209], [1292, 3209], [1292, 3307], [1085, 3307]],
UNIDAD_DE_TALLERES_MULTIDISC: [[1624, 3244], [1920, 3240], [1954, 3476], [1622, 3477]],
USC: [[992, 2656], [1029, 2656], [1029, 2828], [992, 2828]],
UIM: [[294, 3224], [901, 3257], [899, 3358], [312, 3386]],
GOB: [[950, 2068], [1104, 2068], [1104, 2218], [950, 2218]],
SERV_GRALES: [[1024, 882], [1089, 882], [1089, 1138], [1024, 1138]],
SM: [[893, 1789], [935, 1789], [935, 1891], [893, 1891]]
};
const puntos: any[] = [];
Object.entries(edificios).forEach(([nombre, poligono]) => {
for (let i = 0; i < 15; i++) {
const x = poligono[0][0] + Math.random() * (poligono[1][0] - poligono[0][0]);
const y = poligono[0][1] + Math.random() * (poligono[2][1] - poligono[0][1]);
const intensidad = Math.random();
puntos.push([x, y, intensidad]);
}
});
const heat = (L as any).heatLayer(puntos, {
radius: 35,
blur: 25,
maxZoom: 2,
gradient: {
0.2: "#00f",
0.4: "#0ff",
0.6: "#0f0",
0.8: "#ff0",
1.0: "#f00"
}
});
heat.addTo(map);
Object.entries(edificios).forEach(([nombre, coords]: any) => {
L.polygon((coords), {
color: "#77ee9f",
weight: 2,
fillOpacity: 0.25
})
.bindPopup(`🏢 ${nombre}`)
.addTo(map);
});
// DEBUG PRO (CLICK PARA COORDENADAS EXACTAS)
map.on("click", function (e) {
console.log(" Coordenadas exactas:", e.latlng);
});
return () => {
map.removeLayer(heat);
};
}, [map]);
return null;
}
export default function MapaCalor() {
const bounds: LatLngBoundsExpression = [
[0, 0],
[3368, 4768]
];
return (
<div style={{
width: "100%",
height: "650px",
marginTop: "40px",
borderRadius: "12px",
overflow: "hidden",
boxShadow: "0 6px 25px rgba(0,0,0,0.3)"
}}>
<MapContainer
crs={L.CRS.Simple}
minZoom={-2}
style={{ height: "100%", width: "100%" }}
>
<ImageOverlay
url="/plano.png"
bounds={bounds}
/>
<AjustarVista bounds={bounds} />
<HeatLayer />
</MapContainer>
</div>
);
}
+11 -1
View File
@@ -1,10 +1,17 @@
"use client";
import { useState, useEffect } from "react";
import Cookies from "js-cookie";
import axios from "axios";
import "./pregunta7.css";
import ToggleButton from "../Toggle/ToggleButton";
import dynamic from "next/dynamic";
const MapaCalor = dynamic(
() => import("./MapaCalor"),
{ ssr: false }
);
type AntiguedadItem = {
antiguedad: string | null;
@@ -166,6 +173,9 @@ export default function Pregunta7() {
</tbody>
</table>
</div>
<MapaCalor />
</div>
);
}
}
+11 -3
View File
@@ -3,8 +3,8 @@ import type { NextRequest } from "next/server";
import { jwtDecode } from "jwt-decode";
const permisos: Record<number, string[]> = {
1: ["/crearCuenta", "/equipoComputo", "/perifericos","/escaner", "/agregarEquipo", "/editar","/historial","/ranking","/cambiarPass","/reportesGraficas"],
2: ["/escaner", "/agregarEquipo", "/editar","/historial","/ranking","/cambiarPass"],
1: ["/crearCuenta", "/equipoComputo", "/perifericos", "/escaner", "/hotmap", "/agregarEquipo", "/editar", "/historial", "/ranking", "/cambiarPass", "/reportesGraficas"],
2: ["/escaner", "/agregarEquipo", "/editar", "/historial", "/ranking", "/cambiarPass"],
};
export function proxy(request: NextRequest) {
@@ -35,7 +35,15 @@ export function proxy(request: NextRequest) {
export const config = {
matcher: [
"/escaner",
"/agregarEquipo",
"/editar",
"/crearCuenta",
"/equipoComputo",
"/perifericos",
"/ranking",
"/historial",
"/cambiarPass"
],
};
//IO