version 1

This commit is contained in:
Abraham
2026-01-13 16:42:11 -08:00
commit 3dab27744f
69 changed files with 229596 additions and 0 deletions

1
assets/AssetManifest.bin Normal file
View File

@@ -0,0 +1 @@

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"assets/fonts/Poppins-Bold.ttf":["assets/fonts/Poppins-Bold.ttf"],"assets/fonts/Poppins-Regular.ttf":["assets/fonts/Poppins-Regular.ttf"],"assets/images/favicon.png":["assets/images/favicon.png"],"assets/images/logo_nh.png":["assets/images/logo_nh.png"],"assets/images/logo_nh_b.png":["assets/images/logo_nh_b.png"],"assets/images/placeholder_no_image.jpg":["assets/images/placeholder_no_image.jpg"],"assets/referencia/categoria_componente.png":["assets/referencia/categoria_componente.png"],"assets/referencia/contexto_proyecto.md":["assets/referencia/contexto_proyecto.md"],"assets/referencia/crm.png":["assets/referencia/crm.png"],"assets/referencia/fn_racks_con_componentes.txt":["assets/referencia/fn_racks_con_componentes.txt"],"assets/referencia/fn_topologia_por_negocio.txt":["assets/referencia/fn_topologia_por_negocio.txt"],"assets/referencia/landingMap1.png":["assets/referencia/landingMap1.png"],"assets/referencia/landingMap2.png":["assets/referencia/landingMap2.png"],"assets/referencia/loginpage.png":["assets/referencia/loginpage.png"],"assets/referencia/rol_logico_componente.png":["assets/referencia/rol_logico_componente.png"],"assets/referencia/tablas_energymedia.txt":["assets/referencia/tablas_energymedia.txt"],"assets/referencia/tablas_nethive.txt":["assets/referencia/tablas_nethive.txt"],"assets/referencia/tipo_distribucion.png":["assets/referencia/tipo_distribucion.png"],"assets/referencia/topologia_referencia.png":["assets/referencia/topologia_referencia.png"],"assets/referencia/video_player_caro.text":["assets/referencia/video_player_caro.text"],"assets/referencia/video_player_live.text":["assets/referencia/video_player_live.text"],"assets/referencia/video_thumbnail.txt":["assets/referencia/video_thumbnail.txt"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"packages/drop_down_list_menu/assets/screenshot2.png":["packages/drop_down_list_menu/assets/screenshot2.png"],"packages/drop_down_list_menu/assets/screenshot3.png":["packages/drop_down_list_menu/assets/screenshot3.png"],"packages/flutter_credit_card/font/halter.ttf":["packages/flutter_credit_card/font/halter.ttf"],"packages/flutter_credit_card/icons/amex.png":["packages/flutter_credit_card/icons/amex.png"],"packages/flutter_credit_card/icons/chip.png":["packages/flutter_credit_card/icons/chip.png"],"packages/flutter_credit_card/icons/discover.png":["packages/flutter_credit_card/icons/discover.png"],"packages/flutter_credit_card/icons/elo.png":["packages/flutter_credit_card/icons/elo.png"],"packages/flutter_credit_card/icons/hipercard.png":["packages/flutter_credit_card/icons/hipercard.png"],"packages/flutter_credit_card/icons/mastercard.png":["packages/flutter_credit_card/icons/mastercard.png"],"packages/flutter_credit_card/icons/mir.png":["packages/flutter_credit_card/icons/mir.png"],"packages/flutter_credit_card/icons/rupay.png":["packages/flutter_credit_card/icons/rupay.png"],"packages/flutter_credit_card/icons/unionpay.png":["packages/flutter_credit_card/icons/unionpay.png"],"packages/flutter_credit_card/icons/visa.png":["packages/flutter_credit_card/icons/visa.png"],"packages/flutter_map/lib/assets/flutter_map_logo.png":["packages/flutter_map/lib/assets/flutter_map_logo.png"],"packages/fluttertoast/assets/toastify.css":["packages/fluttertoast/assets/toastify.css"],"packages/fluttertoast/assets/toastify.js":["packages/fluttertoast/assets/toastify.js"],"packages/wakelock_plus/assets/no_sleep.js":["packages/wakelock_plus/assets/no_sleep.js"]}

1
assets/FontManifest.json Normal file
View File

@@ -0,0 +1 @@
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"Poppins","fonts":[{"asset":"assets/fonts/Poppins-Regular.ttf"},{"weight":700,"asset":"assets/fonts/Poppins-Bold.ttf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]},{"family":"packages/flutter_credit_card/halter","fonts":[{"asset":"packages/flutter_credit_card/font/halter.ttf"}]}]

36645
assets/NOTICES Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@@ -0,0 +1,265 @@
# NETHIVE NEO - Contexto del Proyecto
## 📋 Resumen General
**NETHIVE NEO** es una aplicación Flutter para la gestión de infraestructura de red MDF/IDF (Main Distribution Frame / Intermediate Distribution Frame). La aplicación permite administrar empresas, negocios y componentes de red de forma integral con una interfaz moderna y responsiva.
## 🎯 Objetivo Principal
Crear un sistema completo de gestión de infraestructura de telecomunicaciones que permita:
- Administrar múltiples empresas y sus negocios
- Gestionar inventario de componentes de red (switches, patch panels, cables, etc.)
- Monitorear el estado y uso de la infraestructura
- Proporcionar dashboards informativos
- Ofrecer una experiencia optimizada tanto para escritorio como móvil
## 🏗️ Arquitectura del Proyecto
### **Backend & Base de Datos**
- **Supabase** como backend principal
- Schema `nethive` para datos específicos del dominio
- Autenticación y autorización integrada
- Realtime para actualizaciones en tiempo real
### **Frontend - Flutter**
- **Material Design** con tema personalizado
- **Provider** para gestión de estado
- **Go Router** para navegación
- **PlutoGrid** para tablas de datos
- **Responsive Design** adaptativo
### **Estructura de Navegación**
```
Login → Empresas/Negocios → Infraestructura MDF/IDF
├── Dashboard
├── Inventario
├── Topología
├── Alertas
└── Configuración
```
## 📱 Funcionalidades Implementadas
### **1. Gestión de Empresas y Negocios**
- **Vista de escritorio**: Sidebar con empresas + tabla PlutoGrid de negocios
- **Vista móvil**: Cards responsivas con información completa
- **Funciones**: Crear, editar, eliminar empresas y negocios
- **Navegación**: Botón prominente "Acceder a Infraestructura" en cada negocio
### **2. Layout de Infraestructura**
- **Sidemenu responsivo** con módulos:
- Dashboard (métricas y estadísticas)
- Inventario (gestión de componentes)
- Topología (visualización de red)
- Alertas (notificaciones del sistema)
- Configuración (parámetros del sistema)
- **Header dinámico** con breadcrumb: Empresa > Negocio > Módulo
- **Navegación móvil** con drawer colapsible
### **3. Dashboard MDF/IDF**
- **Vista de escritorio**: Cards de estadísticas, gráficos, alertas recientes
- **Vista móvil**: Layout optimizado con cards compactas y información escalonada
- **Métricas**: Componentes totales, activos, en uso, categorías
- **Actividad**: Feed de eventos recientes del sistema
### **4. Inventario de Componentes**
- **Vista de escritorio**: Tabla PlutoGrid con filtros y paginación
- **Vista móvil**: Cards interactivas con detalles completos
- **Gestión**: CRUD completo de componentes de red
- **Categorización**: Switches, patch panels, cables, etc.
- **Estados**: Activo/Inactivo, En uso/Libre
## 🎨 Diseño y UX
### **Tema Visual**
- **Colores primarios**: Verdes esmeralda (#10B981) con gradientes modernos
- **Colores secundarios**: Azules de acento (#3B82F6) para contrastes
- **Fondo**: Esquema oscuro moderno (#0F172A, #1E293B, #334155)
- **Tipografía**: Google Fonts Poppins con jerarquía clara
- **Iconografía**: Material Icons con iconos personalizados
- **Animaciones**: Transiciones fluidas y feedback visual
### **Responsividad**
- **Móvil (≤800px)**: Vista de cards, menú hamburguesa, modals deslizables
- **Tablet (801-1200px)**: Tabla compacta, sidemenu colapsible
- **Escritorio (>1200px)**: Vista completa con todas las funcionalidades
### **Componentes Clave**
- **Cards animadas** con hover effects y entrada escalonada
- **Gradientes modernos** en headers y botones
- **Estados visuales** claros con colores semánticos
- **Modals interactivos** para detalles y formularios
- **Breadcrumbs dinámicos** para navegación contextual
## 📊 Providers (Gestión de Estado)
### **NavigationProvider**
- Maneja el negocio seleccionado
- Controla la navegación entre módulos del sidemenu
- Mantiene el contexto de empresa/negocio activo
### **EmpresasNegociosProvider**
- CRUD de empresas y negocios
- Estados de PlutoGrid para tablas
- Filtros y búsquedas
- Manejo de archivos (logos e imágenes)
- Integración con Supabase Storage
### **ComponentesProvider**
- Gestión completa del inventario MDF/IDF
- Categorías de componentes dinámicas
- Estados de componentes (activo, en uso, ubicación)
- Detalles específicos por tipo de componente
- Búsquedas y filtros avanzados
## 🔄 Flujo de Usuario Actual
1. **Login** → Autenticación con Supabase
2. **Selección de Empresa** → Vista de empresas con negocios asociados
3. **Acceso a Infraestructura** → Click en botón de cualquier negocio
4. **Layout Principal** → Sidemenu con módulos + header con breadcrumb
5. **Navegación entre Módulos** → Dashboard, Inventario, etc.
6. **Vista Adaptativa** → Escritorio (tablas) vs Móvil (cards)
## 🚀 Características Técnicas
### **Dependencias Principales**
```yaml
flutter: SDK
provider: ^6.0.5 # Gestión de estado
go_router: ^12.0.0 # Navegación
supabase_flutter: ^2.0.0 # Backend
pluto_grid: ^7.0.0 # Tablas de datos
google_fonts: ^6.0.0 # Tipografías
file_picker: ^6.0.0 # Selección de archivos
```
### **Estructura de Archivos**
```
lib/
├── main.dart # Entry point con providers
├── router/router.dart # Configuración de rutas
├── theme/theme.dart # Tema y estilos globales
├── providers/nethive/ # Providers específicos del dominio
│ ├── empresas_negocios_provider.dart
│ ├── componentes_provider.dart
│ └── navigation_provider.dart
├── pages/
│ ├── empresa_negocios/ # Gestión empresarial
│ │ ├── empresa_negocios_page.dart
│ │ └── widgets/ # Widgets especializados
│ └── infrastructure/ # Módulos MDF/IDF
│ ├── pages/ # Páginas principales
│ └── widgets/ # Componentes reutilizables
├── models/nethive/ # Modelos de datos
└── helpers/ # Utilidades y constantes
```
## 🎯 Estado Actual del Desarrollo
### **✅ Completado**
- ✅ Sistema de autenticación con Supabase
- ✅ Gestión completa de empresas y negocios (escritorio + móvil)
- ✅ Layout de infraestructura con sidemenu responsivo
- ✅ Dashboard con métricas y estadísticas (escritorio + móvil)
- ✅ Inventario con tabla PlutoGrid y vista de cards móvil
- ✅ Navegación completa entre módulos con breadcrumbs
- ✅ Tema visual moderno y completamente responsivo
- ✅ Animaciones y transiciones fluidas
- ✅ Manejo de archivos e imágenes con Supabase Storage
### **🔄 En Desarrollo**
- 🔄 Módulo de Topología de red
- 🔄 Sistema de Alertas en tiempo real
- 🔄 Configuración avanzada del sistema
- 🔄 Formularios de creación/edición de componentes
### **📋 Próximas Funcionalidades**
- 📋 Reportes y exportación de datos
- 📋 Gestión de usuarios y permisos
- 📋 Integración con APIs de equipos de red
- 📋 Monitoreo en tiempo real de componentes
- 📋 Mapas interactivos para ubicaciones
- 📋 Módulo de mantenimiento preventivo
## 🎨 Filosofía de Diseño
**NETHIVE NEO** sigue los principios de **Material Design 3** con personalización corporativa, priorizando:
- **Usabilidad** por encima de la complejidad
- **Responsividad** real (no solo adaptativa)
- **Consistencia visual** en todos los módulos
- **Feedback inmediato** en todas las interacciones
- **Accesibilidad** para diferentes tipos de usuarios
- **Performance** optimizada con animaciones 60fps
## 🔧 Configuración de Base de Datos
### **Esquema Principal: `nethive`**
```sql
-- Tablas principales
empresa # Gestión de empresas
negocio # Sucursales/ubicaciones
categoria_componente # Tipos de componentes
componente # Inventario principal
-- Tablas de detalles específicos
detalle_cable
detalle_switch
detalle_patch_panel
detalle_rack
detalle_organizador
detalle_ups
detalle_router_firewall
detalle_equipo_activo
```
### **Storage Buckets**
```
nethive/
├── logos/ # Logos de empresas y negocios
├── imagenes/ # Imágenes generales
└── componentes/ # Imágenes de componentes
```
## 📝 Patrones de Desarrollo
### **Estado y Navegación**
- **Provider Pattern** para gestión de estado
- **Go Router** para navegación declarativa
- **Consumer Widgets** para reactividad
- **AnimationController** para transiciones
### **Responsividad**
- **MediaQuery** para breakpoints
- **LayoutBuilder** para adaptación dinámica
- **Flexible/Expanded** para layouts fluidos
- **Custom Widgets** para cada viewport
### **Arquitectura de Datos**
- **Repository Pattern** implícito en providers
- **Model Classes** con factory constructors
- **JSON Serialization** manual optimizada
- **Error Handling** robusto con try-catch
## 🚀 Guías de Extensión
### **Añadir Nuevo Módulo**
1. Crear provider en `providers/nethive/`
2. Añadir modelos en `models/nethive/`
3. Crear páginas en `pages/infrastructure/pages/`
4. Registrar en `navigation_provider.dart`
5. Añadir ruta en router
### **Añadir Vista Móvil**
1. Detectar viewport con `MediaQuery`
2. Crear widget específico en `widgets/`
3. Implementar cards con animaciones
4. Añadir modals para detalles
5. Testear en diferentes dispositivos
Este contexto debe servir como referencia para mantener la coherencia del proyecto en futuras iteraciones y para que nuevos desarrolladores comprendan rápidamente la estructura y objetivos del sistema.
---
**Fecha de creación**: 20 de julio de 2025
**Versión**: 1.0
**Proyecto**: NETHIVE NEO - Sistema de Gestión de Infraestructura MDF/IDF

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 KiB

View File

@@ -0,0 +1,33 @@
CREATE OR REPLACE FUNCTION nethive.fn_racks_con_componentes(p_negocio_id uuid)
RETURNS jsonb
LANGUAGE plpgsql
AS $$
BEGIN
RETURN (
SELECT jsonb_agg(rack_info)
FROM (
SELECT
rack.id AS rack_id,
rack.nombre AS nombre_rack,
rack.ubicacion AS ubicacion_rack,
jsonb_agg(
jsonb_build_object(
'componente_id', comp.id,
'nombre', comp.nombre,
'categoria_id', comp.categoria_id,
'descripcion', comp.descripcion,
'ubicacion', comp.ubicacion,
'imagen_url', comp.imagen_url,
'en_uso', comp.en_uso,
'activo', comp.activo
)
) AS componentes
FROM nethive.componente rack
JOIN nethive.componente_en_rack cer ON rack.id = cer.rack_id
JOIN nethive.componente comp ON cer.componente_id = comp.id
WHERE rack.negocio_id = p_negocio_id AND rack.categoria_id = 4 -- RACK
GROUP BY rack.id
) rack_info
);
END;
$$;

View File

@@ -0,0 +1,92 @@
CREATE OR REPLACE FUNCTION nethive.fn_topologia_por_negocio(p_negocio_id uuid)
RETURNS jsonb
LANGUAGE plpgsql
AS $$
BEGIN
RETURN (
SELECT jsonb_build_object(
'componentes', (
SELECT jsonb_agg(row_to_json(c))
FROM (
SELECT
comp.id,
comp.nombre,
comp.categoria_id,
cat.nombre AS categoria,
comp.rol_logico_id,
r.nombre AS rol_logico,
comp.descripcion,
comp.ubicacion,
comp.imagen_url,
comp.en_uso,
comp.activo,
comp.fecha_registro,
comp.distribucion_id,
td.nombre AS tipo_distribucion,
d.nombre AS nombre_distribucion
FROM nethive.componente comp
LEFT JOIN nethive.categoria_componente cat ON comp.categoria_id = cat.id
LEFT JOIN nethive.rol_logico_componente r ON comp.rol_logico_id = r.id
LEFT JOIN nethive.distribucion d ON comp.distribucion_id = d.id
LEFT JOIN nethive.tipo_distribucion td ON d.tipo_id = td.id
WHERE comp.negocio_id = p_negocio_id
) AS c
),
'conexiones_datos', (
SELECT jsonb_agg(row_to_json(cd))
FROM (
SELECT
cc.id,
cc.componente_origen_id,
co.nombre AS nombre_origen,
ro.id AS rol_logico_origen_id,
ro.nombre AS rol_logico_origen,
cc.componente_destino_id,
cd.nombre AS nombre_destino,
rd.id AS rol_logico_destino_id,
rd.nombre AS rol_logico_destino,
cc.cable_id,
cb.nombre AS nombre_cable,
cc.descripcion,
cc.activo
FROM nethive.conexion_componente cc
LEFT JOIN nethive.componente co ON cc.componente_origen_id = co.id
LEFT JOIN nethive.rol_logico_componente ro ON co.rol_logico_id = ro.id
LEFT JOIN nethive.componente cd ON cc.componente_destino_id = cd.id
LEFT JOIN nethive.rol_logico_componente rd ON cd.rol_logico_id = rd.id
LEFT JOIN nethive.componente cb ON cc.cable_id = cb.id
WHERE co.negocio_id = p_negocio_id OR cd.negocio_id = p_negocio_id
) AS cd
),
'conexiones_energia', (
SELECT jsonb_agg(row_to_json(ce))
FROM (
SELECT
ca.id,
ca.origen_id,
co.nombre AS nombre_origen,
ro.id AS rol_logico_origen_id,
ro.nombre AS rol_logico_origen,
ca.destino_id,
cd.nombre AS nombre_destino,
rd.id AS rol_logico_destino_id,
rd.nombre AS rol_logico_destino,
ca.cable_id,
cb.nombre AS nombre_cable,
ca.descripcion,
ca.activo
FROM nethive.conexion_alimentacion ca
LEFT JOIN nethive.componente co ON ca.origen_id = co.id
LEFT JOIN nethive.rol_logico_componente ro ON co.rol_logico_id = ro.id
LEFT JOIN nethive.componente cd ON ca.destino_id = cd.id
LEFT JOIN nethive.rol_logico_componente rd ON cd.rol_logico_id = rd.id
LEFT JOIN nethive.componente cb ON ca.cable_id = cb.id
WHERE co.negocio_id = p_negocio_id OR cd.negocio_id = p_negocio_id
) AS ce
)
)
);
END;
$$;

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -0,0 +1,78 @@
tabla: "media_posters"
| column_name | data_type |
| -------------------- | ------------------------ |
| media_poster_id | bigint |
| media_file_id | bigint |
| poster_file_id | bigint |
| created_at_timestamp | timestamp with time zone |
tabla: "media_files"
| column_name | data_type |
| -------------------- | ------------------------ |
| media_file_id | bigint |
| file_name | text |
| title | text |
| file_description | text |
| file_type | text |
| mime_type | text |
| file_extension | text |
| file_size_bytes | bigint |
| file_url | text |
| storage_path | text |
| created_at_timestamp | timestamp with time zone |
| updated_at_timestamp | timestamp with time zone |
| uploaded_by_user_id | uuid |
| is_public_file | boolean |
| metadata_json | jsonb |
| seconds | bigint |
| media_category_fk | bigint |
| organization_fk | bigint |
tabla: "media_categories"
| column_name | data_type |
| -------------------- | ------------------------ |
| media_categories_id | bigint |
| created_at | timestamp with time zone |
| created_by | uuid |
| category_name | text |
| category_description | text |
| media_file_fk | bigint |
vista: "vw_media_files_with_posters"
| column_name | data_type |
| --------------------------- | ------------------------ |
| media_file_id | bigint |
| media_file_name | text |
| media_title | text |
| file_description | text |
| media_type | text |
| media_mime_type | text |
| media_url | text |
| media_storage_path | text |
| media_created_at | timestamp with time zone |
| category_id | bigint |
| category_name | text |
| category_description | text |
| category_created_at | timestamp with time zone |
| category_image_url | text |
| category_image_storage_path | text |
| media_poster_id | bigint |
| poster_file_id | bigint |
| poster_file_name | text |
| poster_title | text |
| poster_url | text |
| poster_storage_path | text |
| poster_created_at | timestamp with time zone |
https://github.com/CB-Luna/energymedia_content_manager

View File

@@ -0,0 +1,323 @@
-- cable_por_conexion --
id (uuid) (PK),
conexion_id (uuid),
cable_id (uuid),
observaciones (text),
-- categoria_componente --
id (int4) (PK),
nombre (text),
-- componente --
id (uuid) (PK),
negocio_id (uuid) (FK) REFERENCES nethive.negocio.id,
categoria_id (int4) (FK) REFERENCES nethive.categoria_componente.id,
nombre (text),
descripcion (text),
ubicacion (text),
imagen_url (text),
en_uso (bool),
activo (bool),
fecha_registro (timestamp),
distribucion_id (uuid) (FK) REFERENCES nethive.distribucion.id
-- conexion_componente --
id (uuid) (PK),
componente_origen_id (uuid) (FK) REFERENCES nethive.componente.id,
componente_destino_id (uuid) (FK) REFERENCES nethive.componente.id,
descripcion (text),
activo (bool),
cable_id (uuid) (FK) REFERENCES nethive.componente.id
-- detalle_cable --
componente_id (uuid) (FK) REFERENCES nethive.componente.id,
tipo_cable (text),
color (text),
tamaño (numeric),
tipo_conector (text),
-- detalle_equipo_activo --
componente_id (uuid) (PK) (FK de nethive.componente.id)
tipo (text)
marca (text)
modelo (text)
numero_serie (text)
especificaciones (text)
direccion_ip (text)
firmware (text)
-- detalle_organizador --
componente_id (PK) (uuid) (FK de nethive.componente.id),
tipo (text),
material (text),
tamaño (text),
color (text)
-- detalle_patch_panel --
componente_id (PK) (uuid) (FK de nethive.componente.id),
tipo_conector (text),
numero_puertos (int4),
categoria (text),
tipo_montaje (text),
numeracion_frontal (bool),
panel_ciego (bool)
-- detalle_rack --
componente_id (PK) (uuid) (FK de nethive.componente.id),
tipo (text),
altura_u (int4),
profundidad_cm (int4),
ancho_cm (int4),
ventilacion_integrada (bool),
puertas_con_llave (bool),
ruedas (bool),
color (text),
-- detalle_router_firewall --
componente_id (PK) (uuid) (FK de nethive.componente.id),
tipo (text),
marca (text),
modelo (text),
numero_serie (text),
interfaces (text),
capacidad_routing_gbps (numeric),
direccion_ip (text),
firmware (text),
licencias (text),
-- detalle_switch --
componente_id (PK) (uuid) (FK de nethive.componente.id),
marca (text),
modelo (text),
numero_serie (text),
administrable (bool),
poe (bool),
cantidad_puertos (int4),
velocidad_puertos (text),
tipo_puertos (text),
ubicacion_en_rack (text),
direccion_ip (text),
firmware (text),
-- detalle_ups --
componente_id (PK) (uuid) (FK de nethive.componente.id),
tipo (text),
marca (text),
modelo (text),
voltaje_entrada (text),
voltaje_salida (text),
capacidad_va (int4),
autonomia_minutos (int4),
cantidad_tomas (int4),
rackeable (bool),
-- empresa --
id (PK) (uuid),
nombre (text),
rfc (text),
direccion (text),
telefono (text),
email (text),
fecha_creacion (timestamp),
logo_url (text),
-- negocio --
id (PK) (uuid),
empresa_id (uuid) (FK de nethive.empresa.id)
nombre (text),
direccion (text),
latitud (numeric),
longitud (numeric),
tipo_local (text),
fecha_creacion (timestamp),
logo_url (text),
imagen_url (text)
-- distribucion --
id (PK) (uuid),
negocio_id (uuid) (FK de nethive.negocio.id)
tipo (text),
nombre (text),
descripcion (text),
-- conexion_alimentacion --
id (uuid) (PK),
origen_id (uuid) (FK de nethive.componente.id),
destino_id (uuid) (FK de nethive.componente.id),
cable_id (uuid) (FK de nethive.componente.id, opcional),
descripcion (text),
activo (bool)
-- rol_logico_componente --
id (serial) (PK),
nombre (text),
descripcion (text)
-- tipo_distribucion --
id (serial) (PK),
nombre (text)
-- componente_en_rack --
id UUID (PK)
rack_id (UUID) (FK de nethive.componente.id),
componente_id (UUID) (FK de nethive.componente.id),
posicion_u (INT4),
fecha_registro (TIMESTAMP)
******* VISTAS: *******
-- vista_cables_en_uso --
cable_id (uuid),
cable_nombre (text),
tipo_cable (text),
color (text),
tamaño (numeric),
tipo_conector (text),
conexion_id (uuid),
-- vista_conexiones_con_cables --
conexion_id (uuid),
descripcion (text),
activo (bool),
origen_id (uuid),
componente_origen (text),
destino_id (uuid),
componente_destino (text),
cable_id (uuid),
cable_usado (text),
tipo_cable (text),
color (text),
tamaño (numeric),
tipo_conector (text),
-- vista_conexiones_por_negocio --
id (uuid),
componente_origen_id (uuid),
componente_destino_id (uuid),
descripcion (text),
activo (bool),
-- vista_detalle_cables --
componente_id (uuid),
nombre (text),
tipo_cable (text),
color (text),
tamaño (numeric),
tipo_conector (text),
en_uso (bool),
activo (bool),
ubicacion (text),
imagen_componente (text),
nombre_negocio (text),
logo_negocio (text),
nombre_empresa (text),
logo_empresa (text),
-- vista_inventario_por_negocio --
componente_id (uuid),
nombre_componente (text),
categoria (text),
en_uso (bool),
activo (bool),
ubicacion (text),
imagen_componente (text),
negocio_id (uuid),
nombre_negocio (text),
logo_negocio (text),
imagen_negocio (text),
empresa_id (uuid),
nombre_empresa (text),
logo_empresa (text),
imagen_empresa (text)
-- vista_negocios_con_coordenadas --
negocio_id (uuid),
nombre_negocio (text),
latitud (numeric),
longitud (numeric),
logo_negocio (text),
imagen_negocio (text),
empresa_id (uuid),
nombre_empresa (text),
logo_empresa (text),
imagen_empresa (text),
-- vista_resumen_componentes_activos --
nombre_empresa (text),
nombre_negocio (text),
categoría (text),
cantidad_activos (int8),
-- vista_topologia_por_negocio --
negocio_id (uuid),
nombre_negocio (text),
distribucion_id (uuid),
tipo_distribucion (text),
distribucion_nombre (text),
componente_id (uuid),
componente_nombre (text),
descripcion (text),
categoria_componente (text),
en_uso (bool),
activo (bool),
ubicacion (text),
imagen_url (text),
fecha_registro (timestamp),
-- vista_alimentacion_componentes --
id (uuid),
origen_id (uuid),
nombre_origen (text),
categoria_origen (int4),
destino_id (uuid),
nombre_destino (text),
categoria_destino (int4),
cable_id (uuid),
nombre_cable (text),
categoria_cable (int4),
descripcion (text),
activo (bool)

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

View File

@@ -0,0 +1,75 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:appinio_video_player/appinio_video_player.dart';
class VideoScreenNew extends StatefulWidget {
final dynamic videoUrl;
const VideoScreenNew({Key? key, required this.videoUrl}) : super(key: key);
@override
_VideoScreenNewState createState() => _VideoScreenNewState();
}
class _VideoScreenNewState extends State<VideoScreenNew> {
late VideoPlayerController _videoPlayerController;
late CustomVideoPlayerController _customVideoPlayerController;
late CustomVideoPlayerWebController _customVideoPlayerWebController;
final CustomVideoPlayerSettings _customVideoPlayerSettings =
const CustomVideoPlayerSettings();
late CustomVideoPlayerWebSettings _customVideoPlayerWebSettings;
late VideoPlayerController _controller;
@override
void initState() {
super.initState();
_videoPlayerController = VideoPlayerController.network(
widget.videoUrl,
)..initialize().then((value) => setState(() {}));
_customVideoPlayerController = CustomVideoPlayerController(
context: context,
videoPlayerController: _videoPlayerController,
customVideoPlayerSettings: _customVideoPlayerSettings,
);
_customVideoPlayerWebSettings = CustomVideoPlayerWebSettings(
src: widget.videoUrl,
);
_customVideoPlayerWebController = CustomVideoPlayerWebController(
webVideoPlayerSettings: _customVideoPlayerWebSettings,
);
_controller = VideoPlayerController.network(widget.videoUrl)
..initialize().then((_) {
setState(() {});
});
}
@override
void dispose() {
_customVideoPlayerController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
backgroundColor: Colors.black,
child: SafeArea(
child: Center(
child: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: CustomVideoPlayerWeb(
customVideoPlayerWebController: _customVideoPlayerWebController,
),
),
),
),
);
}
}

View File

@@ -0,0 +1,80 @@
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:chewie/chewie.dart';
class VideoPlayerLive extends StatefulWidget {
final String url;
const VideoPlayerLive({Key? key, required this.url}) : super(key: key);
@override
_VideoPlayerLiveState createState() => _VideoPlayerLiveState();
}
class _VideoPlayerLiveState extends State<VideoPlayerLive> {
late ChewieController _chewieController;
bool _isFullScreen = false;
@override
void initState() {
super.initState();
_initializePlayer();
}
@override
void dispose() {
super.dispose();
_chewieController.dispose();
}
void _initializePlayer() {
final videoPlayerController = VideoPlayerController.network(widget.url);
_chewieController = ChewieController(
videoPlayerController: videoPlayerController,
autoPlay: false,
looping: false,
showControls: true,
allowFullScreen: true,
allowMuting: true,
allowPlaybackSpeedChanging: false,
aspectRatio: videoPlayerController.value.aspectRatio,
customControls: CupertinoControls(
backgroundColor: Color.fromARGB(66, 0, 0, 0),
iconColor: Color.fromARGB(255, 202, 202, 202),
showPlayButton: true),
);
}
void _toggleFullScreen() {
if (!_isFullScreen) {
_chewieController.enterFullScreen();
} else {
_chewieController.exitFullScreen();
}
setState(() {
_isFullScreen = !_isFullScreen;
});
}
@override
Widget build(BuildContext context) {
return Container(
color: Colors.black,
child: Center(
child: Material(
color: Colors.transparent,
child: InkWell(
onTap: _toggleFullScreen,
child: AspectRatio(
aspectRatio:
_chewieController.videoPlayerController.value.aspectRatio,
child: Chewie(
controller: _chewieController,
),
),
),
),
),
);
}
}

View File

@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
class VideoScreenThumbnail extends StatefulWidget {
final dynamic video;
const VideoScreenThumbnail({Key? key, required this.video}) : super(key: key);
@override
State<VideoScreenThumbnail> createState() => _VideoScreenThumbnailState();
}
class _VideoScreenThumbnailState extends State<VideoScreenThumbnail> {
late VideoPlayerController _controllerVideo;
late bool startedPlaying;
@override
void initState() {
_controllerVideo = VideoPlayerController.network(widget.video);
_controllerVideo.initialize();
super.initState();
started();
_controllerVideo.setVolume(0);
_controllerVideo.pause();
}
Future<bool> started() async {
var renderized = false;
double height = 0;
await Future.delayed(const Duration(seconds: 2), () {
height = _controllerVideo.value.size.height;
if (height > 0) renderized = true;
});
return renderized;
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: started(),
builder: ((context, AsyncSnapshot<bool> snapshot) {
if (snapshot.data ?? false) {
return Stack(
alignment: AlignmentDirectional.center,
children: [
VideoPlayer(_controllerVideo),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
SizedBox(height: 30),
],
),
],
);
} else {
return const Center(child: CircularProgressIndicator());
}
}),
);
}
@override
void dispose() {
super.dispose();
var video = _controllerVideo;
video.dispose();
}
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -0,0 +1,14 @@
/**
* Minified by jsDelivr using clean-css v4.2.3.
* Original file: /npm/toastify-js@1.9.3/src/toastify.css
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/*!
* Toastify js 1.9.3
* https://github.com/apvarun/toastify-js
* @license MIT licensed
*
* Copyright (C) 2018 Varun A P
*/
.toastify{padding:12px 20px;color:#fff;display:inline-block;box-shadow:0 3px 6px -1px rgba(0,0,0,.12),0 10px 36px -4px rgba(77,96,232,.3);background:-webkit-linear-gradient(315deg,#73a5ff,#5477f5);background:linear-gradient(135deg,#73a5ff,#5477f5);position:fixed;opacity:0;transition:all .4s cubic-bezier(.215,.61,.355,1);border-radius:2px;cursor:pointer;text-decoration:none;max-width:calc(50% - 20px);z-index:2147483647}.toastify.on{opacity:1}.toast-close{opacity:.4;padding:0 5px}.toastify-right{right:15px}.toastify-left{left:15px}.toastify-top{top:-150px}.toastify-bottom{bottom:-150px}.toastify-rounded{border-radius:25px}.toastify-avatar{width:1.5em;height:1.5em;margin:-7px 5px;border-radius:2px}.toastify-center{margin-left:auto;margin-right:auto;left:0;right:0;max-width:fit-content;max-width:-moz-fit-content}@media only screen and (max-width:360px){.toastify-left,.toastify-right{margin-left:auto;margin-right:auto;left:0;right:0;max-width:fit-content}}

View File

@@ -0,0 +1,14 @@
/**
* Minified by jsDelivr using Terser v5.3.0.
* Original file: /npm/toastify-js@1.9.3/src/toastify.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/*!
* Toastify js 1.9.3
* https://github.com/apvarun/toastify-js
* @license MIT licensed
*
* Copyright (C) 2018 Varun A P
*/
!function(t,o){"object"==typeof module && module && module.exports?module.exports=o():t.Toastify=o()}(this,(function(t){var o=function(t){return new o.lib.init(t)};function i(t,o){return o.offset[t]?isNaN(o.offset[t])?o.offset[t]:o.offset[t]+"px":"0px"}function s(t,o){return!(!t||"string"!=typeof o)&&!!(t.className&&t.className.trim().split(/\s+/gi).indexOf(o)>-1)}return o.lib=o.prototype={toastify:"1.9.3",constructor:o,init:function(t){return t||(t={}),this.options={},this.toastElement=null,this.options.text=t.text||"Hi there!",this.options.node=t.node,this.options.duration=0===t.duration?0:t.duration||3e3,this.options.selector=t.selector,this.options.callback=t.callback||function(){},this.options.destination=t.destination,this.options.newWindow=t.newWindow||!1,this.options.close=t.close||!1,this.options.gravity="bottom"===t.gravity?"toastify-bottom":"toastify-top",this.options.positionLeft=t.positionLeft||!1,this.options.position=t.position||"",this.options.backgroundColor=t.backgroundColor,this.options.avatar=t.avatar||"",this.options.className=t.className||"",this.options.stopOnFocus=void 0===t.stopOnFocus||t.stopOnFocus,this.options.onClick=t.onClick,this.options.offset=t.offset||{x:0,y:0},this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var t=document.createElement("div");if(t.className="toastify on "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:!0===this.options.positionLeft?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&(t.style.background=this.options.backgroundColor),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else if(t.innerHTML=this.options.text,""!==this.options.avatar){var o=document.createElement("img");o.src=this.options.avatar,o.className="toastify-avatar","left"==this.options.position||!0===this.options.positionLeft?t.appendChild(o):t.insertAdjacentElement("afterbegin",o)}if(!0===this.options.close){var s=document.createElement("span");s.innerHTML="&#10006;",s.className="toast-close",s.addEventListener("click",function(t){t.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var n=window.innerWidth>0?window.innerWidth:screen.width;("left"==this.options.position||!0===this.options.positionLeft)&&n>360?t.insertAdjacentElement("afterbegin",s):t.appendChild(s)}if(this.options.stopOnFocus&&this.options.duration>0){var e=this;t.addEventListener("mouseover",(function(o){window.clearTimeout(t.timeOutValue)})),t.addEventListener("mouseleave",(function(){t.timeOutValue=window.setTimeout((function(){e.removeElement(t)}),e.options.duration)}))}if(void 0!==this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),!0===this.options.newWindow?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),"function"==typeof this.options.onClick&&void 0===this.options.destination&&t.addEventListener("click",function(t){t.stopPropagation(),this.options.onClick()}.bind(this)),"object"==typeof this.options.offset){var a=i("x",this.options),p=i("y",this.options),r="left"==this.options.position?a:"-"+a,l="toastify-top"==this.options.gravity?p:"-"+p;t.style.transform="translate("+r+","+l+")"}return t},showToast:function(){var t;if(this.toastElement=this.buildToast(),!(t=void 0===this.options.selector?document.body:document.getElementById(this.options.selector)))throw"Root element is not defined";return t.insertBefore(this.toastElement,t.firstChild),o.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(t){t.className=t.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),o.reposition()}.bind(this),400)}},o.reposition=function(){for(var t,o={top:15,bottom:15},i={top:15,bottom:15},n={top:15,bottom:15},e=document.getElementsByClassName("toastify"),a=0;a<e.length;a++){t=!0===s(e[a],"toastify-top")?"toastify-top":"toastify-bottom";var p=e[a].offsetHeight;t=t.substr(9,t.length-1);(window.innerWidth>0?window.innerWidth:screen.width)<=360?(e[a].style[t]=n[t]+"px",n[t]+=p+15):!0===s(e[a],"toastify-left")?(e[a].style[t]=o[t]+"px",o[t]+=p+15):(e[a].style[t]=i[t]+"px",i[t]+=p+15)}return this},o.lib.init.prototype=o.lib,o}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long