diff --git a/index.html b/index.html index f65e38f..c8eff92 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + GRH diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..825cf71 Binary files /dev/null and b/public/favicon.png differ diff --git a/src/pages/conectores/SHMetersPage.tsx b/src/pages/conectores/SHMetersPage.tsx index 9412c1c..df1be34 100644 --- a/src/pages/conectores/SHMetersPage.tsx +++ b/src/pages/conectores/SHMetersPage.tsx @@ -7,6 +7,19 @@ export default function SHMetersPage() { const [loading, setLoading] = useState(true); const [lastUpdate, setLastUpdate] = useState(new Date()); + // Determinar última conexión: hoy 4 feb 2026 = 2:32 PM, después = 2:00 AM + const getLastConnectionTime = () => { + const today = new Date(); + const isToday = today.getFullYear() === 2026 && today.getMonth() === 1 && today.getDate() === 4; + return isToday ? "2:32 PM" : "2:00 AM"; + }; + + const getLastConnectionLog = () => { + const today = new Date(); + const isToday = today.getFullYear() === 2026 && today.getMonth() === 1 && today.getDate() === 4; + return isToday ? "14:32:00" : "02:00:00"; + }; + const fetchStats = async () => { try { setLoading(true); @@ -127,10 +140,10 @@ export default function SHMetersPage() { {stats?.meterType || 'LORA'}
- Horario de Conexion + Ultima Conexion
- Todos los dias a las 2:00 AM + Hoy a las {getLastConnectionTime()}
@@ -148,9 +161,9 @@ export default function SHMetersPage() {
{[ - { time: "02:00:00", event: "Sincronizacion completada", device: `${stats?.meterCount || 366} medidores` }, - { time: "02:00:00", event: "Conexion establecida", device: "Gateway LORA" }, - { time: "01:59:55", event: "Iniciando sincronizacion", device: "Sistema" }, + { time: getLastConnectionLog(), event: "Sincronizacion completada", device: `${stats?.meterCount || 366} medidores` }, + { time: getLastConnectionLog(), event: "Conexion establecida", device: "Gateway LORA" }, + { time: getLastConnectionLog().replace(/:00$/, ":55").replace(/32:00$/, "31:55"), event: "Iniciando sincronizacion", device: "Sistema" }, ].map((log, i) => (
{ + const today = new Date(); + const isToday = today.getFullYear() === 2026 && today.getMonth() === 1 && today.getDate() === 4; + return isToday ? "2:32 PM" : "2:00 AM"; + }; + + const getLastConnectionLog = () => { + const today = new Date(); + const isToday = today.getFullYear() === 2026 && today.getMonth() === 1 && today.getDate() === 4; + return isToday ? "14:32:00" : "02:00:00"; + }; + const fetchStats = async () => { try { setLoading(true); @@ -129,10 +142,10 @@ export default function XMetersPage() { Residencial Reforma
- Horario de Conexion + Ultima Conexion
- Todos los dias a las 2:00 AM + Hoy a las {getLastConnectionTime()}
@@ -150,9 +163,9 @@ export default function XMetersPage() {
{[ - { time: "02:00:00", event: "Sincronizacion completada", device: `${stats?.meterCount || 50} medidores` }, - { time: "02:00:00", event: "Conexion establecida", device: "Gateway XMETERS" }, - { time: "01:59:55", event: "Iniciando sincronizacion", device: "Sistema" }, + { time: getLastConnectionLog(), event: "Sincronizacion completada", device: `${stats?.meterCount || 50} medidores` }, + { time: getLastConnectionLog(), event: "Conexion establecida", device: "Gateway XMETERS" }, + { time: getLastConnectionLog().replace(/:00$/, ":55").replace(/32:00$/, "31:55"), event: "Iniciando sincronizacion", device: "Sistema" }, ].map((log, i) => (