feat(v1.5.1): Funcionalidad de edición en configuración avanzada
✨ Nuevo: - Botón "✏️ Editar" en tabla de segmentos del editor avanzado - Modo de edición visual con título y botón dinámicos - Campo de segmento se deshabilita durante edición (no se puede cambiar ID) - CRUD completo: Create, Read, Update, Delete 🔧 Mejoras: - Función addSegmentToTable() maneja creación y actualización - 5 nuevas funciones helper para gestión de rangos: * clearRangeContainers() * addInitialRangeWithData() / addFinalRangeWithData() * resetForm() * editSegment() - Scroll automático al inicio del formulario al editar - Validación de duplicados solo en modo creación - Mensajes diferenciados ("agregado" vs "actualizado") 🎨 Interfaz: - Botón editar con estilo azul distintivo - Indicadores visuales claros de modo edición vs agregar - Formulario se pre-llena automáticamente con datos del segmento Completa la funcionalidad CRUD del panel de administración de IPs.
This commit is contained in:
parent
6a0e15447c
commit
ab8a60f556
24
CHANGELOG.md
24
CHANGELOG.md
@ -7,6 +7,30 @@ y este proyecto adhiere a [Semantic Versioning](https://semver.org/lang/es/).
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [1.5.1] - 2025-12-01
|
||||||
|
|
||||||
|
### ✨ Añadido
|
||||||
|
- **Funcionalidad de Edición en Editor Avanzado**: Completado el CRUD con la capacidad de editar segmentos existentes.
|
||||||
|
- Botón "✏️ Editar" en cada fila de la tabla de segmentos
|
||||||
|
- Formulario se pre-llena con datos del segmento seleccionado
|
||||||
|
- Modo visual de edición con título y botón dinámicos
|
||||||
|
- Campo de número de segmento se deshabilita durante edición (no se puede cambiar el ID)
|
||||||
|
|
||||||
|
### 🔧 Mejorado
|
||||||
|
- **Función `addSegmentToTable()`**: Ahora maneja tanto creación como actualización de segmentos.
|
||||||
|
- **Funciones Helper**: Agregadas funciones auxiliares para gestión de rangos:
|
||||||
|
- `clearRangeContainers()` - Limpia contenedores de rangos
|
||||||
|
- `addInitialRangeWithData()` / `addFinalRangeWithData()` - Agregan rangos con datos pre-cargados
|
||||||
|
- `resetForm()` - Resetea formulario al modo agregar
|
||||||
|
- `editSegment()` - Carga datos del segmento en el formulario
|
||||||
|
- **UX del Editor**: Scroll automático al inicio del formulario al editar.
|
||||||
|
- **Validación**: Verificación de duplicados solo en modo creación, no en edición.
|
||||||
|
|
||||||
|
### 🎨 Interfaz
|
||||||
|
- Botón de editar con estilo azul distintivo
|
||||||
|
- Indicadores visuales claros de modo edición vs. agregar
|
||||||
|
- Mensajes de éxito diferenciados ("agregado" vs. "actualizado")
|
||||||
|
|
||||||
## [1.5.0] - 2025-11-27
|
## [1.5.0] - 2025-11-27
|
||||||
|
|
||||||
### ✨ Añadido
|
### ✨ Añadido
|
||||||
|
|||||||
18
README.md
18
README.md
@ -1,6 +1,6 @@
|
|||||||
# SIIP - Buscador de IP's Disponibles UISP
|
# SIIP - Buscador de IP's Disponibles UISP
|
||||||
|
|
||||||
[](manifest.json)
|
[](manifest.json)
|
||||||
[](https://uisp.com/)
|
[](https://uisp.com/)
|
||||||
[](https://uisp.com/)
|
[](https://uisp.com/)
|
||||||
|
|
||||||
@ -195,6 +195,16 @@ A partir de la versión 1.5.0, puedes definir rangos de IPs administrativas espe
|
|||||||
- **Múltiples rangos**: Define varios rangos iniciales y finales por segmento
|
- **Múltiples rangos**: Define varios rangos iniciales y finales por segmento
|
||||||
- **Validación automática**: El sistema valida que los rangos sean correctos
|
- **Validación automática**: El sistema valida que los rangos sean correctos
|
||||||
- **Indicador de modo**: Badge visual que muestra si los rangos personalizados están activos
|
- **Indicador de modo**: Badge visual que muestra si los rangos personalizados están activos
|
||||||
|
- **CRUD Completo** (v1.5.1):
|
||||||
|
- ✅ **Crear**: Agregar nuevos segmentos
|
||||||
|
- ✅ **Leer**: Ver segmentos en tabla
|
||||||
|
- ✅ **Actualizar**: Editar segmentos existentes con botón "✏️ Editar"
|
||||||
|
- ✅ **Eliminar**: Borrar segmentos con botón "🗑️ Eliminar"
|
||||||
|
|
||||||
|
**Gestión de Segmentos:**
|
||||||
|
1. **Agregar**: Completa el formulario y haz clic en "✅ Agregar Segmento"
|
||||||
|
2. **Editar**: Haz clic en "✏️ Editar" en la tabla, modifica los rangos y haz clic en "💾 Actualizar Segmento"
|
||||||
|
3. **Eliminar**: Haz clic en "🗑️ Eliminar" y confirma la acción
|
||||||
|
|
||||||
**Ejemplo de Configuración:**
|
**Ejemplo de Configuración:**
|
||||||
- **Segmento 13**: IPs administrativas del 2 al 60 y del 253 al 255
|
- **Segmento 13**: IPs administrativas del 2 al 60 y del 253 al 255
|
||||||
@ -622,8 +632,10 @@ Para ver el historial completo de cambios y versiones, consulta el archivo **[CH
|
|||||||
|
|
||||||
### Contacto
|
### Contacto
|
||||||
|
|
||||||
- **Sitio web**: [https://siip.mx](https://siip.mx)
|
---
|
||||||
- **Autor**: SIIP Internet
|
|
||||||
|
**Versión 1.5.1** - Diciembre 2025
|
||||||
|
Desarrollado por [SIIP Internet](https://siip.mx)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@ -1 +1,15 @@
|
|||||||
{"ipserver":"sistema.siip.mx","apitoken":"393eb3d0-9b46-4a47-b9b4-473e4e24a89c","unmsApiToken":"393eb3d0-9b46-4a47-b9b4-473e4e24a89c","debugMode":true,"logging_level":true,"enablePingVerification":true,"adminRangeStart":"2","adminRangeEnd":"50","adminRangeFinalStart":"254","adminRangeFinalEnd":"255","useCustomAdminRanges":true,"customAdminRangesJson":"{\"segmentos\":[{\"segmento\":\"13\",\"administrativas_iniciales\":[{\"inicio\":2,\"hasta\":50}],\"administrativas_finales\":[{\"inicio\":253,\"hasta\":254}]}]}","adminPassword":"Siip.2963"}
|
{
|
||||||
|
"ipserver": "sistema.siip.mx",
|
||||||
|
"apitoken": "393eb3d0-9b46-4a47-b9b4-473e4e24a89c",
|
||||||
|
"unmsApiToken": "393eb3d0-9b46-4a47-b9b4-473e4e24a89c",
|
||||||
|
"debugMode": true,
|
||||||
|
"logging_level": true,
|
||||||
|
"enablePingVerification": true,
|
||||||
|
"adminRangeStart": "2",
|
||||||
|
"adminRangeEnd": "50",
|
||||||
|
"adminRangeFinalStart": "254",
|
||||||
|
"adminRangeFinalEnd": "255",
|
||||||
|
"useCustomAdminRanges": true,
|
||||||
|
"customAdminRangesJson": "{\"segmentos\":[{\"segmento\":\"13\",\"administrativas_iniciales\":[{\"inicio\":2,\"hasta\":50}],\"administrativas_finales\":[{\"inicio\":253,\"hasta\":254}]},{\"segmento\":\"100\",\"administrativas_iniciales\":[{\"inicio\":2,\"hasta\":50}],\"administrativas_finales\":[{\"inicio\":254,\"hasta\":254}]}]}",
|
||||||
|
"adminPassword": "Siip.2963"
|
||||||
|
}
|
||||||
423
data/plugin.log
423
data/plugin.log
@ -7505,3 +7505,426 @@ Verificando lote de 1 IPs
|
|||||||
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
Procesando lote 1/1 (1 IPs)
|
Procesando lote 1/1 (1 IPs)
|
||||||
Lote completado: 0/1 IPs responden (1.11s)
|
Lote completado: 0/1 IPs responden (1.11s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: []
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"search","segment":"12","verify_ping":"false"}
|
||||||
|
GET data: []
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarybd8272a3349c8efbbaed012943fbb091
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de búsqueda AJAX
|
||||||
|
Configuración cargada: {"ipserver":"sistema.siip.mx","hasUnmsToken":true,"hasApiToken":true}
|
||||||
|
Buscando IPs en segmento: 12 (Búsqueda inicial rápida)
|
||||||
|
URL de API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Iniciando conexión a API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Respuesta HTTP: 200
|
||||||
|
Longitud de respuesta: 48939 bytes
|
||||||
|
IPs obtenidas exitosamente: 3107 direcciones
|
||||||
|
Búsqueda de IPs en segmento 172.16.12.x - Disponibles: 134, En uso: 120
|
||||||
|
Resultado de búsqueda: {"success":true,"ipsDisponibles":134,"ipsEnUso":120}
|
||||||
|
<<< Finalizando handler de búsqueda AJAX
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.12.54\"]"}
|
||||||
|
GET data: []
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary85be65a5d55d0cdb7f76fa56d2ede785
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.12.59\"]"}
|
||||||
|
GET data: []
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarye3e9370d54f82fbbb8f990ddfb1b27cf
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.12.62\"]"}
|
||||||
|
GET data: []
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary39c1e1ef57e68ced8b93ca59ea26c4b7
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.12.63\"]"}
|
||||||
|
GET data: []
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary188872d75d3f6de8e31ddac02bb1c6c9
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.12.66\"]"}
|
||||||
|
GET data: []
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary74e5cee744dab688aba6da8d9b07f3ff
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"search","segment":"58","verify_ping":"false"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary5de336a314126311a016679cbdf6490a
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de búsqueda AJAX
|
||||||
|
Configuración cargada: {"ipserver":"sistema.siip.mx","hasUnmsToken":true,"hasApiToken":true}
|
||||||
|
Buscando IPs en segmento: 58 (Búsqueda inicial rápida)
|
||||||
|
URL de API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Iniciando conexión a API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Respuesta HTTP: 200
|
||||||
|
Longitud de respuesta: 48970 bytes
|
||||||
|
IPs obtenidas exitosamente: 3109 direcciones
|
||||||
|
Búsqueda de IPs en segmento 172.16.58.x - Disponibles: 58, En uso: 196
|
||||||
|
Resultado de búsqueda: {"success":true,"ipsDisponibles":58,"ipsEnUso":196}
|
||||||
|
<<< Finalizando handler de búsqueda AJAX
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.56\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarye37fae410348132280a180b93bd7a227
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.59\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundaryc8e65b74e6536dbbf2d57bbe533aa246
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.95\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundaryf4da50616d413bc1bba2588826681060
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.103\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarydb470455cd29afa784c24b576840e6b1
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.105\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundaryc3d649954bf5ef9bdf46da90d26b72
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"search","segment":"58","verify_ping":"false"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary2c342b46d37362e78f4fc06ec7e8020c
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de búsqueda AJAX
|
||||||
|
Configuración cargada: {"ipserver":"sistema.siip.mx","hasUnmsToken":true,"hasApiToken":true}
|
||||||
|
Buscando IPs en segmento: 58 (Búsqueda inicial rápida)
|
||||||
|
URL de API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Iniciando conexión a API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Respuesta HTTP: 200
|
||||||
|
Longitud de respuesta: 48968 bytes
|
||||||
|
IPs obtenidas exitosamente: 3109 direcciones
|
||||||
|
Búsqueda de IPs en segmento 172.16.58.x - Disponibles: 57, En uso: 197
|
||||||
|
Resultado de búsqueda: {"success":true,"ipsDisponibles":57,"ipsEnUso":197}
|
||||||
|
<<< Finalizando handler de búsqueda AJAX
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.56\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarycbfb0a158a4e5358a601edc003b4e297
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.59\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarybd917ab8ee0f07628167d84a75baec3
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.95\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary58b2539b8103a91915cbb583f6d768d6
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.103\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary64d93b48d78c2fd9cc7b181e2d3c2d3
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.58.105\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary8187dbe9dbbb010bc555e154af6760d5
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"search","segment":"100","verify_ping":"false"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary66eaa49becf074a2efab28efa6190b7c
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de búsqueda AJAX
|
||||||
|
Configuración cargada: {"ipserver":"sistema.siip.mx","hasUnmsToken":true,"hasApiToken":true}
|
||||||
|
Buscando IPs en segmento: 100 (Búsqueda inicial rápida)
|
||||||
|
URL de API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Iniciando conexión a API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Respuesta HTTP: 200
|
||||||
|
Longitud de respuesta: 48984 bytes
|
||||||
|
IPs obtenidas exitosamente: 3110 direcciones
|
||||||
|
Búsqueda de IPs en segmento 172.16.100.x - Disponibles: 123, En uso: 131
|
||||||
|
Resultado de búsqueda: {"success":true,"ipsDisponibles":123,"ipsEnUso":131}
|
||||||
|
<<< Finalizando handler de búsqueda AJAX
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.55\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary59770e227ca7bebbb9d31ac9eb17c6cd
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.57\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary5bfdf75e7db643dfa705de5835164b60
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.58\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundaryf9dd8be35ef2af819f4e396e55ca554e
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.59\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary8e13fb488884de4e784f3a1f86c92ea3
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.69\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary7a5518b653c8b853f151206af23c8b7a
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"search","segment":"100","verify_ping":"false"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary95c02a8b6cd2acabb820ecb1881577b
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de búsqueda AJAX
|
||||||
|
Configuración cargada: {"ipserver":"sistema.siip.mx","hasUnmsToken":true,"hasApiToken":true}
|
||||||
|
Buscando IPs en segmento: 100 (Búsqueda inicial rápida)
|
||||||
|
URL de API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Iniciando conexión a API: https://sistema.siip.mx/nms/api/v2.1/devices/ips?suspended=false&management=true&includeObsolete=true
|
||||||
|
Respuesta HTTP: 200
|
||||||
|
Longitud de respuesta: 48984 bytes
|
||||||
|
IPs obtenidas exitosamente: 3110 direcciones
|
||||||
|
Búsqueda de IPs en segmento 172.16.100.x - Disponibles: 123, En uso: 131
|
||||||
|
Resultado de búsqueda: {"success":true,"ipsDisponibles":123,"ipsEnUso":131}
|
||||||
|
<<< Finalizando handler de búsqueda AJAX
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.69\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarycd70269185ebb122a3cf31abecffa585
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.11s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.70\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundarye723c45d141748e51d9b7c3b006a9769
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.82\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundary83bc3d192d14de284e1f8ae608bdf5e
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.83\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundaryd3ab89f3d3722c26c9d5ef3b9ec1fb98
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: POST
|
||||||
|
POST data: {"action":"verify_batch","ips":"[\"172.16.100.84\"]"}
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type: multipart/form-data; boundary=----geckoformboundaryf6f700fc0d15dc9830ced87ece539e41
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
>>> Entrando al handler de verificación por lotes (verify_batch)
|
||||||
|
Verificando lote de 1 IPs
|
||||||
|
Iniciando verificación por ping de 1 IPs (lotes de 1)
|
||||||
|
Procesando lote 1/1 (1 IPs)
|
||||||
|
Lote completado: 0/1 IPs responden (1.10s)
|
||||||
|
=== NUEVA PETICIÓN ===
|
||||||
|
Método: GET
|
||||||
|
POST data: []
|
||||||
|
GET data: {"success":"1"}
|
||||||
|
Content-Type:
|
||||||
|
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:145.0) Gecko/20100101 Firefox/145.0
|
||||||
|
Acceso a la interfaz pública de búsqueda de IPs
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
"displayName": "SIIP - Buscador de IP's Disponibles UISP",
|
"displayName": "SIIP - Buscador de IP's Disponibles UISP",
|
||||||
"description": "Este plugin permite buscar IP's disponibles en UISP (UNMS) y asignarlas a los clientes en UCRM. Evitando así la asignación de IP's duplicadas y mejorando la gestión de direcciones IP en la red.",
|
"description": "Este plugin permite buscar IP's disponibles en UISP (UNMS) y asignarlas a los clientes en UCRM. Evitando así la asignación de IP's duplicadas y mejorando la gestión de direcciones IP en la red.",
|
||||||
"url": "https://siip.mx",
|
"url": "https://siip.mx",
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"ucrmVersionCompliancy": {
|
"ucrmVersionCompliancy": {
|
||||||
"min": "1.0.0",
|
"min": "1.0.0",
|
||||||
"max": null
|
"max": null
|
||||||
|
|||||||
162
public.php
162
public.php
@ -1359,6 +1359,7 @@ $pingEnabled = !empty($config['enablePingVerification']) && ($config['enablePing
|
|||||||
}
|
}
|
||||||
|
|
||||||
let hasUnsavedChanges = false;
|
let hasUnsavedChanges = false;
|
||||||
|
let editingIndex = null; // Track which segment is being edited
|
||||||
const adminPassword = <?php echo json_encode($config['adminPassword'] ?? ''); ?>;
|
const adminPassword = <?php echo json_encode($config['adminPassword'] ?? ''); ?>;
|
||||||
|
|
||||||
// Event listener para botón de configuración avanzada
|
// Event listener para botón de configuración avanzada
|
||||||
@ -1449,6 +1450,9 @@ $pingEnabled = !empty($config['enablePingVerification']) && ($config['enablePing
|
|||||||
<td>${iniciales || '-'}</td>
|
<td>${iniciales || '-'}</td>
|
||||||
<td>${finales || '-'}</td>
|
<td>${finales || '-'}</td>
|
||||||
<td>
|
<td>
|
||||||
|
<button class="btn-small" onclick="editSegment(${index})" style="background: rgba(79, 172, 254, 0.2); color: #4facfe; border-color: rgba(79, 172, 254, 0.3); margin-right: 8px;">
|
||||||
|
✏️ Editar
|
||||||
|
</button>
|
||||||
<button class="btn-small" onclick="deleteSegment(${index})" style="background: rgba(245, 87, 108, 0.2); color: #ff6b6b; border-color: rgba(245, 87, 108, 0.3);">
|
<button class="btn-small" onclick="deleteSegment(${index})" style="background: rgba(245, 87, 108, 0.2); color: #ff6b6b; border-color: rgba(245, 87, 108, 0.3);">
|
||||||
🗑️ Eliminar
|
🗑️ Eliminar
|
||||||
</button>
|
</button>
|
||||||
@ -1489,6 +1493,125 @@ $pingEnabled = !empty($config['enablePingVerification']) && ($config['enablePing
|
|||||||
container.appendChild(newRange);
|
container.appendChild(newRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper function: Clear all range containers
|
||||||
|
function clearRangeContainers() {
|
||||||
|
document.getElementById('initialRangesContainer').innerHTML = '';
|
||||||
|
document.getElementById('finalRangesContainer').innerHTML = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function: Add initial range with data
|
||||||
|
function addInitialRangeWithData(start, end) {
|
||||||
|
const container = document.getElementById('initialRangesContainer');
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'range-input-group';
|
||||||
|
div.innerHTML = `
|
||||||
|
<input type="number" class="range-start" value="${start}" min="1" max="254" />
|
||||||
|
<span>hasta</span>
|
||||||
|
<input type="number" class="range-end" value="${end}" min="1" max="254" />
|
||||||
|
<button class="btn-small" onclick="this.parentElement.remove()" style="background: rgba(245, 87, 108, 0.2); color: #ff6b6b;">
|
||||||
|
✖ Quitar
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
container.appendChild(div);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function: Add final range with data
|
||||||
|
function addFinalRangeWithData(start, end) {
|
||||||
|
const container = document.getElementById('finalRangesContainer');
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.className = 'range-input-group';
|
||||||
|
div.innerHTML = `
|
||||||
|
<input type="number" class="range-start" value="${start}" min="1" max="254" />
|
||||||
|
<span>hasta</span>
|
||||||
|
<input type="number" class="range-end" value="${end}" min="1" max="254" />
|
||||||
|
<button class="btn-small" onclick="this.parentElement.remove()" style="background: rgba(245, 87, 108, 0.2); color: #ff6b6b;">
|
||||||
|
✖ Quitar
|
||||||
|
</button>
|
||||||
|
`;
|
||||||
|
container.appendChild(div);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset form to add mode
|
||||||
|
function resetForm() {
|
||||||
|
const segmentInput = document.getElementById('newSegment');
|
||||||
|
segmentInput.value = '';
|
||||||
|
segmentInput.disabled = false;
|
||||||
|
|
||||||
|
clearRangeContainers();
|
||||||
|
|
||||||
|
// Add default empty ranges
|
||||||
|
document.getElementById('initialRangesContainer').innerHTML = `
|
||||||
|
<div class="range-input-group">
|
||||||
|
<input type="number" class="range-start" placeholder="Desde" min="1" max="254" />
|
||||||
|
<span>hasta</span>
|
||||||
|
<input type="number" class="range-end" placeholder="Hasta" min="1" max="254" />
|
||||||
|
<button class="btn-small" onclick="addInitialRange()">+ Agregar Rango</button>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
document.getElementById('finalRangesContainer').innerHTML = `
|
||||||
|
<div class="range-input-group">
|
||||||
|
<input type="number" class="range-start" placeholder="Desde" min="1" max="254" />
|
||||||
|
<span>hasta</span>
|
||||||
|
<input type="number" class="range-end" placeholder="Hasta" min="1" max="254" value="254" />
|
||||||
|
<button class="btn-small" onclick="addFinalRange()">+ Agregar Rango</button>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Reset UI text
|
||||||
|
document.querySelector('#advancedEditor .card h3').textContent = 'Agregar Nuevo Segmento';
|
||||||
|
const submitBtn = document.querySelector('button[onclick="addSegmentToTable()"]');
|
||||||
|
if (submitBtn) {
|
||||||
|
submitBtn.textContent = '✅ Agregar Segmento';
|
||||||
|
}
|
||||||
|
|
||||||
|
editingIndex = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Edit existing segment
|
||||||
|
function editSegment(index) {
|
||||||
|
editingIndex = index;
|
||||||
|
const segment = editorData.segmentos[index];
|
||||||
|
|
||||||
|
// Populate segment number
|
||||||
|
const segmentInput = document.getElementById('newSegment');
|
||||||
|
segmentInput.value = segment.segmento;
|
||||||
|
segmentInput.disabled = true; // Can't change segment number when editing
|
||||||
|
|
||||||
|
// Clear and populate ranges
|
||||||
|
clearRangeContainers();
|
||||||
|
|
||||||
|
// Populate initial ranges
|
||||||
|
if (segment.administrativas_iniciales && segment.administrativas_iniciales.length > 0) {
|
||||||
|
segment.administrativas_iniciales.forEach(rango => {
|
||||||
|
addInitialRangeWithData(rango.inicio, rango.hasta);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Add empty range if none exist
|
||||||
|
addInitialRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Populate final ranges
|
||||||
|
if (segment.administrativas_finales && segment.administrativas_finales.length > 0) {
|
||||||
|
segment.administrativas_finales.forEach(rango => {
|
||||||
|
addFinalRangeWithData(rango.inicio, rango.hasta);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Add empty range if none exist
|
||||||
|
addFinalRange();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update UI
|
||||||
|
document.querySelector('#advancedEditor .card h3').textContent = `Editar Segmento ${segment.segmento}`;
|
||||||
|
const submitBtn = document.querySelector('button[onclick="addSegmentToTable()"]');
|
||||||
|
if (submitBtn) {
|
||||||
|
submitBtn.textContent = '💾 Actualizar Segmento';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Scroll to top of editor
|
||||||
|
document.getElementById('advancedEditor').scrollTop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
function addSegmentToTable() {
|
function addSegmentToTable() {
|
||||||
const segmentInput = document.getElementById('newSegment');
|
const segmentInput = document.getElementById('newSegment');
|
||||||
const segment = segmentInput.value;
|
const segment = segmentInput.value;
|
||||||
@ -1498,8 +1621,8 @@ $pingEnabled = !empty($config['enablePingVerification']) && ($config['enablePing
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verificar si el segmento ya existe
|
// Verificar si el segmento ya existe (solo en modo CREATE)
|
||||||
if (editorData.segmentos.some(s => s.segmento == segment)) {
|
if (editingIndex === null && editorData.segmentos.some(s => s.segmento == segment)) {
|
||||||
alert('⚠️ Este segmento ya está configurado');
|
alert('⚠️ Este segmento ya está configurado');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1532,35 +1655,26 @@ $pingEnabled = !empty($config['enablePingVerification']) && ($config['enablePing
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Agregar segmento
|
const newSegment = {
|
||||||
editorData.segmentos.push({
|
|
||||||
segmento: segment,
|
segmento: segment,
|
||||||
administrativas_iniciales: initialRanges,
|
administrativas_iniciales: initialRanges,
|
||||||
administrativas_finales: finalRanges
|
administrativas_finales: finalRanges
|
||||||
});
|
};
|
||||||
|
|
||||||
// Limpiar formulario
|
if (editingIndex !== null) {
|
||||||
segmentInput.value = '';
|
// UPDATE mode
|
||||||
initialContainer.innerHTML = `
|
editorData.segmentos[editingIndex] = newSegment;
|
||||||
<div class="range-input-group">
|
alert('✅ Segmento actualizado correctamente');
|
||||||
<input type="number" class="range-start" placeholder="Desde" min="1" max="254" />
|
} else {
|
||||||
<span>hasta</span>
|
// CREATE mode
|
||||||
<input type="number" class="range-end" placeholder="Hasta" min="1" max="254" />
|
editorData.segmentos.push(newSegment);
|
||||||
<button class="btn-small" onclick="addInitialRange()">+ Agregar Rango</button>
|
alert('✅ Segmento agregado correctamente');
|
||||||
</div>
|
}
|
||||||
`;
|
|
||||||
finalContainer.innerHTML = `
|
|
||||||
<div class="range-input-group">
|
|
||||||
<input type="number" class="range-start" placeholder="Desde" min="1" max="254" />
|
|
||||||
<span>hasta</span>
|
|
||||||
<input type="number" class="range-end" placeholder="Hasta" min="1" max="254" value="255" />
|
|
||||||
<button class="btn-small" onclick="addFinalRange()">+ Agregar Rango</button>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
|
// Reset form and update table
|
||||||
|
resetForm();
|
||||||
hasUnsavedChanges = true;
|
hasUnsavedChanges = true;
|
||||||
renderSegmentsTable();
|
renderSegmentsTable();
|
||||||
alert('✅ Segmento agregado correctamente');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteSegment(index) {
|
function deleteSegment(index) {
|
||||||
|
|||||||
Binary file not shown.
1
vendor/composer/autoload_classmap.php
vendored
1
vendor/composer/autoload_classmap.php
vendored
@ -110,6 +110,7 @@ return array(
|
|||||||
'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php',
|
'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php',
|
||||||
'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php',
|
'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php',
|
||||||
'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php',
|
'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php',
|
||||||
|
'SiipAvailableIps\\AdminRangeHelper' => $baseDir . '/src/AdminRangeHelper.php',
|
||||||
'SiipAvailableIps\\IpSearchService' => $baseDir . '/src/IpSearchService.php',
|
'SiipAvailableIps\\IpSearchService' => $baseDir . '/src/IpSearchService.php',
|
||||||
'SiipAvailableIps\\PingService' => $baseDir . '/src/PingService.php',
|
'SiipAvailableIps\\PingService' => $baseDir . '/src/PingService.php',
|
||||||
'Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/filesystem/Exception/ExceptionInterface.php',
|
'Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/filesystem/Exception/ExceptionInterface.php',
|
||||||
|
|||||||
1
vendor/composer/autoload_static.php
vendored
1
vendor/composer/autoload_static.php
vendored
@ -188,6 +188,7 @@ class ComposerStaticInita8750288fc198a75aec345f4f4b7fd12
|
|||||||
'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php',
|
'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php',
|
||||||
'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php',
|
'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php',
|
||||||
'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php',
|
'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php',
|
||||||
|
'SiipAvailableIps\\AdminRangeHelper' => __DIR__ . '/../..' . '/src/AdminRangeHelper.php',
|
||||||
'SiipAvailableIps\\IpSearchService' => __DIR__ . '/../..' . '/src/IpSearchService.php',
|
'SiipAvailableIps\\IpSearchService' => __DIR__ . '/../..' . '/src/IpSearchService.php',
|
||||||
'SiipAvailableIps\\PingService' => __DIR__ . '/../..' . '/src/PingService.php',
|
'SiipAvailableIps\\PingService' => __DIR__ . '/../..' . '/src/PingService.php',
|
||||||
'Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/filesystem/Exception/ExceptionInterface.php',
|
'Symfony\\Component\\Filesystem\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/filesystem/Exception/ExceptionInterface.php',
|
||||||
|
|||||||
4
vendor/composer/installed.php
vendored
4
vendor/composer/installed.php
vendored
@ -5,7 +5,7 @@
|
|||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '99d283dd3d70dde73fbcfd497ea5e9f562448847',
|
'reference' => '6a0e15447c24c73c605ede44786666c39c39c60f',
|
||||||
'name' => '__root__',
|
'name' => '__root__',
|
||||||
'dev' => false,
|
'dev' => false,
|
||||||
),
|
),
|
||||||
@ -16,7 +16,7 @@
|
|||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'reference' => '99d283dd3d70dde73fbcfd497ea5e9f562448847',
|
'reference' => '6a0e15447c24c73c605ede44786666c39c39c60f',
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'guzzlehttp/guzzle' => array(
|
'guzzlehttp/guzzle' => array(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user