Update favicon and connector pages last connection time

- Replace Vite favicon with GRH logo (white background)
- Update SHMetersPage and XMetersPage to show dynamic last connection time
  - Today (Feb 4, 2026): 2:32 PM
  - After today: 2:00 AM

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Exteban08
2026-02-04 23:59:25 +00:00
parent a79dcc82ea
commit 14e7f8d743
4 changed files with 37 additions and 11 deletions

View File

@@ -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() {
<span className="text-gray-900 dark:text-white">{stats?.meterType || 'LORA'}</span>
</div>
<div className="flex justify-between py-2 border-b border-gray-100 dark:border-zinc-800 items-center">
<span className="text-gray-500 dark:text-zinc-400">Horario de Conexion</span>
<span className="text-gray-500 dark:text-zinc-400">Ultima Conexion</span>
<div className="flex items-center gap-2">
<Calendar className="w-4 h-4 text-blue-500" />
<span className="text-gray-900 dark:text-white font-semibold">Todos los dias a las 2:00 AM</span>
<span className="text-gray-900 dark:text-white font-semibold">Hoy a las {getLastConnectionTime()}</span>
</div>
</div>
<div className="flex justify-between py-2">
@@ -148,9 +161,9 @@ export default function SHMetersPage() {
</h3>
<div className="space-y-3">
{[
{ 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) => (
<div
key={i}

View File

@@ -7,6 +7,19 @@ export default function XMetersPage() {
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);
@@ -129,10 +142,10 @@ export default function XMetersPage() {
<span className="text-gray-900 dark:text-white">Residencial Reforma</span>
</div>
<div className="flex justify-between py-2 border-b border-gray-100 dark:border-zinc-800 items-center">
<span className="text-gray-500 dark:text-zinc-400">Horario de Conexion</span>
<span className="text-gray-500 dark:text-zinc-400">Ultima Conexion</span>
<div className="flex items-center gap-2">
<Calendar className="w-4 h-4 text-purple-500" />
<span className="text-gray-900 dark:text-white font-semibold">Todos los dias a las 2:00 AM</span>
<span className="text-gray-900 dark:text-white font-semibold">Hoy a las {getLastConnectionTime()}</span>
</div>
</div>
<div className="flex justify-between py-2">
@@ -150,9 +163,9 @@ export default function XMetersPage() {
</h3>
<div className="space-y-3">
{[
{ 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) => (
<div
key={i}