From d8e37b5475086e00494b3c5e811b13cb5a61d196 Mon Sep 17 00:00:00 2001 From: IO420 <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 9 Dec 2025 17:00:41 -0600 Subject: [PATCH] added skeleton --- src/app/styles/base/globales.scss | 18 +++++++ src/components/Equipo_Computo/Pregunta1.tsx | 53 ++++++++++++------- src/components/Equipo_Computo/Pregunta2.tsx | 4 +- .../Equipo_Computo/pregunta1_1.module.scss | 1 + .../Equipo_Computo/pregunta2.module.scss | 17 +----- src/data/procesadores.ts | 1 + 6 files changed, 56 insertions(+), 38 deletions(-) diff --git a/src/app/styles/base/globales.scss b/src/app/styles/base/globales.scss index e49d5ee..cff0e80 100644 --- a/src/app/styles/base/globales.scss +++ b/src/app/styles/base/globales.scss @@ -108,3 +108,21 @@ select { top: 8px !important; } } + +.skeleton { + background: linear-gradient(90deg, #e0e0e0 0%, #f5f5f5 50%, #e0e0e0 100%); + background-size: 200% 100%; + animation: shimmer 1.5s infinite; + border-radius: 8px; + height: 32px; + width: 100%; +} + +@keyframes shimmer { + 0% { + background-position: -200% 0; + } + 100% { + background-position: 200% 0; + } +} diff --git a/src/components/Equipo_Computo/Pregunta1.tsx b/src/components/Equipo_Computo/Pregunta1.tsx index 3b28c7b..d1ab5e0 100644 --- a/src/components/Equipo_Computo/Pregunta1.tsx +++ b/src/components/Equipo_Computo/Pregunta1.tsx @@ -24,7 +24,7 @@ const USO_INDEX: Record = { const CATEGORIA_MAP: Record = { "ESCRITORIO PC": { tabla: 0 }, "ESCRITORIO MAC OS": { tabla: 0 }, - "ESCRITORIO MAC OS ": { tabla: 0 }, // tiene espacio al final + "ESCRITORIO MAC OS ": { tabla: 0 }, "ESCRITORIO LINUX": { tabla: 0 }, @@ -61,7 +61,6 @@ function normalizarSO(soRaw: string): string { if (so.includes("CHROME")) return "Chrome OS"; if (so.includes("IOS") || so.includes("IPAD")) return "iPad OS"; - // Servidores if (so.includes("SERVER") || so.includes("UNIX")) return "Servidor"; return "Otro"; @@ -80,6 +79,7 @@ export default function Pregunta1() { const [loading, setLoading] = useState(true); const cargarDatos = async (baja: boolean) => { + setLoading(true); const token = Cookies.get("token"); if (!token) { console.error("Token no encontrado"); @@ -109,9 +109,8 @@ export default function Pregunta1() { let soIndex = -1; - // 🟦 Caso especial: SERVIDOR → siempre a la fila "Servidor" if (tabla === 3) { - soIndex = 0; // único SO disponible en SISTEMAS_POR_TABLA[3] + soIndex = 0; } else { const soNormalizado = normalizarSO(item.sistema_operativo); soIndex = SISTEMAS_POR_TABLA[tabla].indexOf(soNormalizado); @@ -123,7 +122,6 @@ export default function Pregunta1() { const total = parseInt(item.total) || 0; - // 🔥 Corrección importante → SUMAR, no reemplazar nuevaTablas[tabla][soIndex][usoIndex] += total; } @@ -141,7 +139,7 @@ export default function Pregunta1() { const datosSO = tablas[tablaIndex]; const totalesColumnas = Array(5).fill(0); - for (let soIndex = 0; soIndex < 3; soIndex++) { + for (let soIndex = 0; soIndex < datosSO.length; soIndex++) { for (let col = 0; col < 5; col++) { totalesColumnas[col] += datosSO[soIndex][col]; } @@ -176,12 +174,24 @@ export default function Pregunta1() { {so} {valores.map((valor, colIndex) => ( -
- +
+ {!loading ? ( + + ) : ( + " " + )}
))} - {totalFila} + +
+ {!loading && totalFila} +
+ ); })} @@ -189,9 +199,21 @@ export default function Pregunta1() { Total {totalesColumnas.map((t, i) => ( - {t} + +
+ {!loading && t} +
+ ))} - {totalGeneral} + +
+ {!loading && totalGeneral} +
+ @@ -199,15 +221,6 @@ export default function Pregunta1() { ); }; - if (loading) { - return ( -
-
Censo de equipos
-
Cargando datos...
-
- ); - } - return (
diff --git a/src/components/Equipo_Computo/Pregunta2.tsx b/src/components/Equipo_Computo/Pregunta2.tsx index abbe420..528c5f0 100644 --- a/src/components/Equipo_Computo/Pregunta2.tsx +++ b/src/components/Equipo_Computo/Pregunta2.tsx @@ -43,7 +43,7 @@ const PLATFORM_OS_LIST: Record = { ], "apple-desktop": [ - "MAC OS (SEQUOIA)", + "MAC OS(15 - Sequoia)", "Mac OS (13 - Ventura, 14 - Sonoma)", "Mac OS X (Mojave, Catalina, 11 - Big Sur, 12 - Monterrey)", "Mac OS X (Snow Leopard, Lion, Mountain Lion, Mavericks)", @@ -205,7 +205,7 @@ export default function Pregunta2() {
{item.os}
{loading ? " " : item.count} diff --git a/src/components/Equipo_Computo/pregunta1_1.module.scss b/src/components/Equipo_Computo/pregunta1_1.module.scss index 5553f07..d540ce6 100644 --- a/src/components/Equipo_Computo/pregunta1_1.module.scss +++ b/src/components/Equipo_Computo/pregunta1_1.module.scss @@ -74,6 +74,7 @@ display: flex; justify-content: center; align-items: center; + height: 32px; input { width: 100%; diff --git a/src/components/Equipo_Computo/pregunta2.module.scss b/src/components/Equipo_Computo/pregunta2.module.scss index 4408499..d6201ba 100644 --- a/src/components/Equipo_Computo/pregunta2.module.scss +++ b/src/components/Equipo_Computo/pregunta2.module.scss @@ -138,7 +138,7 @@ text-align: center; border-radius: 5px; min-height: 33px; - min-width: 70px; + width: 70px; } .total-row_P1 { @@ -151,21 +151,6 @@ } } -.skeleton { - background: linear-gradient(90deg, - #e0e0e0 0%, - #f5f5f5 50%, - #e0e0e0 100%); - background-size: 200% 100%; - animation: shimmer 1.5s infinite; - border-radius: 8px; -} - -@keyframes shimmer { - 0% { background-position: -200% 0; } - 100% { background-position: 200% 0; } -} - @media (max-width: 700px) { .scanView_P1 .tabs_P1 { width: 160px; diff --git a/src/data/procesadores.ts b/src/data/procesadores.ts index 0c1189c..46b5712 100644 --- a/src/data/procesadores.ts +++ b/src/data/procesadores.ts @@ -61,6 +61,7 @@ export const PROCESADORES_POR_EQUIPO: Record< { id_procesador: 8, procesador: "i5 o equivalentes (1a - 4a generación)" }, { id_procesador: 12, procesador: "i3 o equivalentes (1a - 4a generación)" }, { id_procesador: 22, procesador: "Core2 Mac, Quad Core o anteriores" }, + { id_procesador: 22, procesador: "MAC OS(15 - Sequoia)" }, ], /*"ESCRITORIO LINUX"*/ 3: [ {