Merge branch 'Develop' of https://repositorio.acatlan.unam.mx/IO/front-Censo into Lino
This commit is contained in:
@@ -47,39 +47,39 @@ export default function Page() {
|
||||
};
|
||||
|
||||
return (
|
||||
<main className="forgot-password-page">
|
||||
<h1>Cambiar contraseña</h1>
|
||||
<p>Ingresa el nombre del usuario y su nueva contraseña.</p>
|
||||
<section className="forgot-password-page">
|
||||
<div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="forgot-form">
|
||||
<label htmlFor="nombre">Nombre de usuario</label>
|
||||
<input
|
||||
id="nombre"
|
||||
type="text"
|
||||
value={nombre}
|
||||
onChange={(e) => setNombre(e.target.value)}
|
||||
placeholder="Nombre de usuario"
|
||||
required
|
||||
/>
|
||||
<h1>Cambiar contraseña de operador</h1>
|
||||
<p>Ingresa el nombre del usuario y su nueva contraseña.</p>
|
||||
|
||||
<label htmlFor="contraseña">Nueva contraseña</label>
|
||||
<input
|
||||
id="contraseña"
|
||||
type="password"
|
||||
value={contraseña}
|
||||
onChange={(e) => setContraseña(e.target.value)}
|
||||
placeholder="Nueva contraseña"
|
||||
required
|
||||
/>
|
||||
<form onSubmit={handleSubmit} className="forgot-form">
|
||||
<label htmlFor="nombre">Nombre de usuario</label>
|
||||
<input
|
||||
id="nombre"
|
||||
type="text"
|
||||
value={nombre}
|
||||
onChange={(e) => setNombre(e.target.value)}
|
||||
placeholder="Nombre de usuario"
|
||||
required
|
||||
/>
|
||||
|
||||
<button type="submit" disabled={loading}>
|
||||
{loading ? "Actualizando..." : "Cambiar contraseña"}
|
||||
</button>
|
||||
<label htmlFor="contraseña">Nueva contraseña</label>
|
||||
<input
|
||||
id="contraseña"
|
||||
type="password"
|
||||
value={contraseña}
|
||||
onChange={(e) => setContraseña(e.target.value)}
|
||||
placeholder="Nueva contraseña"
|
||||
required
|
||||
/>
|
||||
|
||||
<div style={{ marginTop: 8 }}>
|
||||
<Link href="/">Regresar al inicio</Link>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
<button type="submit" disabled={loading}>
|
||||
{loading ? "Actualizando..." : "Cambiar contraseña"}
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export default function Page() {
|
||||
return (
|
||||
<section className="containerGrid">
|
||||
<div className="login-container">
|
||||
<h2>Crear cuenta</h2>
|
||||
<h2>Crear cuenta de Operador</h2>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div>
|
||||
<label>Nombre de usuario</label>
|
||||
@@ -86,17 +86,6 @@ export default function Page() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>Correo electrónico</label>
|
||||
<input
|
||||
type="email"
|
||||
placeholder="Tu correo"
|
||||
value={correo}
|
||||
onChange={(e) => setCorreo(e.target.value)}
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>Contraseña</label>
|
||||
<input
|
||||
@@ -123,7 +112,6 @@ export default function Page() {
|
||||
{loading ? "Creando cuenta..." : "Registrarse"}
|
||||
</button>
|
||||
|
||||
<Link href="/">¿Ya tienes cuenta? Inicia sesión</Link>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,161 +1,15 @@
|
||||
"use client";
|
||||
"use client"
|
||||
import React from "react";
|
||||
import Pregunta1 from "@/components/Preguanta1";
|
||||
import Pregunta2 from "@/components/Pregunta2";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import "../../styles/layout/pregunta1.scss";
|
||||
|
||||
// Tipos
|
||||
type OsEntry = {
|
||||
os: string;
|
||||
count: string; // o number si la API devuelve números
|
||||
isTotal?: boolean;
|
||||
};
|
||||
|
||||
type PlatformData = {
|
||||
[key: string]: OsEntry[];
|
||||
};
|
||||
|
||||
// === DATOS TEMPORALES (mock) ===
|
||||
const MOCK_DATA: PlatformData = {
|
||||
"pc-desktop": [
|
||||
{ os: "Windows 11", count: "408" },
|
||||
{ os: "Windows 10", count: "1171" },
|
||||
{ os: "Windows 7/8", count: "177" },
|
||||
{ os: "Windows XP/Vista", count: "43" },
|
||||
{ os: "Linux", count: "45" },
|
||||
{ os: "Total", count: "1844", isTotal: true },
|
||||
],
|
||||
"apple-desktop": [
|
||||
{ os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" },
|
||||
{
|
||||
os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)",
|
||||
count: "180",
|
||||
},
|
||||
{ os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" },
|
||||
{ os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" },
|
||||
{ os: "Total", count: "480", isTotal: true },
|
||||
],
|
||||
"pc-laptop": [
|
||||
{ os: "Windows 11", count: "40" },
|
||||
{ os: "Windows 10", count: "171" },
|
||||
{ os: "Windows 7/8", count: "17" },
|
||||
{ os: "Windows XP/Vista", count: "3" },
|
||||
{ os: "Linux", count: "5" },
|
||||
{ os: "Total", count: "144", isTotal: true },
|
||||
],
|
||||
"apple-laptop": [
|
||||
{ os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" },
|
||||
{
|
||||
os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)",
|
||||
count: "180",
|
||||
},
|
||||
{ os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" },
|
||||
{ os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" },
|
||||
{ os: "Total", count: "480", isTotal: true },
|
||||
],
|
||||
servers: [
|
||||
{
|
||||
os: "Linux (CentOs,Fedora,Ubuntu,Red Hat Enterprise,entre otros)",
|
||||
count: "120",
|
||||
},
|
||||
{ os: "Unix (AIX,MAC OS Server,Solaris,entre otros)", count: "80" },
|
||||
{ os: "Windows Server 2022/2023", count: "50" },
|
||||
{ os: "Windows Server 2016/2019", count: "80" },
|
||||
{ os: "Windows Server 2008/2012", count: "50" },
|
||||
{ os: "Windows Server 2000/2003", count: "12" },
|
||||
{ os: "Total", count: "250", isTotal: true },
|
||||
],
|
||||
};
|
||||
|
||||
const API_ENDPOINT = "/api/platform-stats"; // ← ¡Reemplaza esto cuando sepas la URL real!
|
||||
|
||||
const Page = () => {
|
||||
const [activeTab, setActiveTab] = useState<string>("pc-desktop");
|
||||
const [data, setData] = useState<PlatformData>(MOCK_DATA);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
// === DESCOMENTA ESTO CUANDO TENGAS LA API ===
|
||||
// const response = await fetch(API_ENDPOINT);
|
||||
// if (!response.ok) throw new Error('Error al cargar estadísticas');
|
||||
// const apiData: PlatformData = await response.json();
|
||||
// setData(apiData);
|
||||
// setLoading(false);
|
||||
|
||||
// === POR AHORA: usa datos simulados (y simula un retraso si quieres) ===
|
||||
// await new Promise(resolve => setTimeout(resolve, 300));
|
||||
setData(MOCK_DATA);
|
||||
setLoading(false);
|
||||
} catch (err) {
|
||||
console.error("Error al cargar datos:", err);
|
||||
setError(
|
||||
"No se pudieron cargar las estadísticas. Usando datos temporales."
|
||||
);
|
||||
setData(MOCK_DATA); // fallback en caso de error
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const currentData = data[activeTab] || [];
|
||||
|
||||
// Si quisieras mostrar un estado de carga (opcional)
|
||||
// if (loading) return <div className="dashboardContainer"><p>Cargando...</p></div>;
|
||||
// if (error) console.warn(error); // o muestra un toast, etc.
|
||||
|
||||
return (
|
||||
<div className="dashboardContainer">
|
||||
<div className="header">
|
||||
<h2>Estadísticas de Plataformas</h2>
|
||||
</div>
|
||||
|
||||
<div className="scanView">
|
||||
<div className="container">
|
||||
<div className="header">
|
||||
Presione cada pestaña para ver la información de las plataformas.
|
||||
</div>
|
||||
|
||||
<div className="main-content">
|
||||
<div className="tabs">
|
||||
{Object.entries({
|
||||
"pc-desktop": "Computadoras de escritorio Plataforma PC",
|
||||
"apple-desktop": "Computadoras de escritorio Plataforma Apple",
|
||||
"pc-laptop": "Computadoras portatiles Plataforma PC",
|
||||
"apple-laptop": "Computadoras portatiles Plataforma Apple",
|
||||
servers: "Servidores de alto rendimiento",
|
||||
}).map(([key, label]) => (
|
||||
<div
|
||||
key={key}
|
||||
className={`tab ${activeTab === key ? "active" : ""}`}
|
||||
onClick={() => setActiveTab(key)}
|
||||
>
|
||||
{label}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="data-table-wrapper">
|
||||
<div className="data-table">
|
||||
{currentData.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`data-row ${item.isTotal ? "total-row" : ""}`}
|
||||
>
|
||||
<div className="os-name">{item.os}</div>
|
||||
<div className="count-box">{item.count}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
export default function Page(){
|
||||
return(
|
||||
<>
|
||||
<h1>Reporte General de Preguntas</h1>
|
||||
<Pregunta1/>
|
||||
<Pregunta2/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
||||
|
||||
}
|
||||
@@ -159,7 +159,6 @@
|
||||
|
||||
.scanView .tab {
|
||||
flex: 1;
|
||||
padding: 14px 0;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
.contenedor-pregunta {
|
||||
padding: 20px;
|
||||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
||||
background-color: #f9fafc;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,92 +1,85 @@
|
||||
"use client";
|
||||
import { useState } from "react";
|
||||
import "./reporte.css";
|
||||
import axios from "axios";
|
||||
|
||||
export default function Page() {
|
||||
const [report, setReport] = useState();
|
||||
import React, { useState } from "react";
|
||||
import Pregunta1 from "@/components/Preguanta1"; // Asegúrate que el nombre del archivo sea correcto
|
||||
import Pregunta2 from "@/components/Pregunta2";
|
||||
import Pregunta9 from "@/components/Pregunta9";
|
||||
import "../../styles/layout/reporte.scss";
|
||||
|
||||
async function Report() {
|
||||
const res = await axios.get("https");
|
||||
setReport(res.data);
|
||||
}
|
||||
export default function Reporte() {
|
||||
const [isOpen1, setIsOpen1] = useState(true);
|
||||
const [isOpen2, setIsOpen2] = useState(true);
|
||||
const [isOpen9, setIsOpen9] = useState(true);
|
||||
|
||||
return (
|
||||
<div className="reporte-layout">
|
||||
{/* Panel izquierdo: título, buscador y tabla */}
|
||||
<div className="panel-izquierdo">
|
||||
<div className="titulo-reporte">
|
||||
<p>REPORTE</p>
|
||||
<div className="reporte-container">
|
||||
<div className="reporte-contenido">
|
||||
{/* Pregunta 1 */}
|
||||
<div className="bloque-pregunta">
|
||||
<div className="accordion-header-wrapper">
|
||||
<button
|
||||
className="accordion-header"
|
||||
onClick={() => setIsOpen1(!isOpen1)}
|
||||
aria-expanded={isOpen1}
|
||||
aria-controls="accordion-pregunta1"
|
||||
>
|
||||
<span>Estadísticas de Plataformas</span>
|
||||
<span className={`toggle-icon ${isOpen1 ? "open" : ""}`}>▼</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id="accordion-pregunta1"
|
||||
className={`accordion-content ${isOpen1 ? "open" : ""}`}
|
||||
aria-hidden={!isOpen1}
|
||||
>
|
||||
<Pregunta1 />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="/buscar" method="get">
|
||||
<input type="text" name="q" placeholder="Buscar equipo" />
|
||||
<button type="submit">Buscar</button>
|
||||
</form>
|
||||
|
||||
<div className="tabla-rec">
|
||||
{/* Aquí irá tu tabla real */}
|
||||
<p>Tabla de equipos...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Panel derecho: filtros + botón descargar */}
|
||||
<div className="panel-derecho">
|
||||
<div className="filtro-rec">
|
||||
<form className="editar">
|
||||
<p className="titulo-rec">Filtro</p>
|
||||
<div className="linea"></div>
|
||||
|
||||
<label htmlFor="adscripcion">Adscripción</label>
|
||||
<select id="adscripcion">
|
||||
<option value="">Seleccione la adscripción</option>
|
||||
<option value="informatica">CEDETEC</option>
|
||||
<option value="administracion">Administración</option>
|
||||
<option value="biblioteca">Biblioteca</option>
|
||||
<option value="direccion">Dirección</option>
|
||||
</select>
|
||||
|
||||
<label htmlFor="estado">Estado</label>
|
||||
<select id="estado">
|
||||
<option value="">Seleccione el estado del equipo</option>
|
||||
<option value="activo">Activo</option>
|
||||
<option value="mantenimiento">En Mantenimiento</option>
|
||||
<option value="baja">Dado de Baja</option>
|
||||
<option value="reparacion">En Reparación</option>
|
||||
</select>
|
||||
|
||||
<label htmlFor="tipo">Tipo de Equipo</label>
|
||||
<select id="tipo">
|
||||
<option value="">Seleccione el tipo de equipo</option>
|
||||
<option value="cpu">CPU</option>
|
||||
<option value="laptop">Laptop</option>
|
||||
<option value="monitor">Monitor</option>
|
||||
<option value="impresora">Impresora</option>
|
||||
<option value="servidor">Servidor</option>
|
||||
</select>
|
||||
|
||||
<label htmlFor="antiguedad">Antigüedad</label>
|
||||
<select id="antiguedad">
|
||||
<option value="">Seleccione la antigüedad del equipo</option>
|
||||
<option value="menos1">Menos de 1 año</option>
|
||||
<option value="1-3">1 a 3 años</option>
|
||||
<option value="3-5">3 a 5 años</option>
|
||||
<option value="mas5">Más de 5 años</option>
|
||||
</select>
|
||||
|
||||
<div className="botones-filtro">
|
||||
<button type="reset" className="limpiar">
|
||||
Limpiar filtros
|
||||
</button>
|
||||
<button type="submit" className="aplicar">
|
||||
Aplicar filtros
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{/* Pregunta 2 */}
|
||||
<div className="bloque-pregunta">
|
||||
<div className="accordion-header-wrapper">
|
||||
<button
|
||||
className="accordion-header"
|
||||
onClick={() => setIsOpen2(!isOpen2)}
|
||||
aria-expanded={isOpen2}
|
||||
aria-controls="accordion-pregunta2"
|
||||
>
|
||||
<span>Pregunta 2</span> {/* ← Cambia el título */}
|
||||
<span className={`toggle-icon ${isOpen2 ? "open" : ""}`}>▼</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id="accordion-pregunta2"
|
||||
className={`accordion-content ${isOpen2 ? "open" : ""}`}
|
||||
aria-hidden={!isOpen2}
|
||||
>
|
||||
<Pregunta2 />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button className="boton-descargar">Descargar</button>
|
||||
{/* Pregunta 9 */}
|
||||
<div className="bloque-pregunta">
|
||||
<div className="accordion-header-wrapper">
|
||||
<button
|
||||
className="accordion-header"
|
||||
onClick={() => setIsOpen9(!isOpen9)}
|
||||
aria-expanded={isOpen9}
|
||||
aria-controls="accordion-pregunta9"
|
||||
>
|
||||
<span>9. Calcule porcentualmente (%) la antigüedad que tienen los equipos de cómputo del área universitaria. *</span> {/* ← Título correcto */}
|
||||
<span className={`toggle-icon ${isOpen9 ? "open" : ""}`}>▼</span>
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
id="accordion-pregunta9"
|
||||
className={`accordion-content ${isOpen9 ? "open" : ""}`}
|
||||
aria-hidden={!isOpen9}
|
||||
>
|
||||
<Pregunta9 />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
"use client";
|
||||
import { useState } from "react";
|
||||
import "./reporte.css";
|
||||
import axios from "axios";
|
||||
import Pregunta9 from "../pregunta9/page";
|
||||
export default function Page() {
|
||||
const [report, setReport] = useState();
|
||||
|
||||
async function Report() {
|
||||
const res = await axios.get("https");
|
||||
setReport(res.data);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="reporte-layout">
|
||||
{/* Panel izquierdo: título, buscador y tabla */}
|
||||
<div className="panel-izquierdo">
|
||||
<div className="titulo-reporte">
|
||||
<p>REPORTE</p>
|
||||
</div>
|
||||
|
||||
<form action="/buscar" method="get">
|
||||
<input type="text" name="q" placeholder="Buscar equipo" />
|
||||
<button type="submit">Buscar</button>
|
||||
</form>
|
||||
|
||||
<div className="tabla-rec">
|
||||
{/* Aquí irá tu tabla real */}
|
||||
<p>Tabla de equipos...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Panel derecho: filtros + botón descargar */}
|
||||
<div className="panel-derecho">
|
||||
<div className="filtro-rec">
|
||||
<form className="editar">
|
||||
<p className="titulo-rec">Filtro</p>
|
||||
<div className="linea"></div>
|
||||
|
||||
<label htmlFor="adscripcion">Adscripción</label>
|
||||
<select id="adscripcion">
|
||||
<option value="">Seleccione la adscripción</option>
|
||||
<option value="informatica">CEDETEC</option>
|
||||
<option value="administracion">Administración</option>
|
||||
<option value="biblioteca">Biblioteca</option>
|
||||
<option value="direccion">Dirección</option>
|
||||
</select>
|
||||
|
||||
<label htmlFor="estado">Estado</label>
|
||||
<select id="estado">
|
||||
<option value="">Seleccione el estado del equipo</option>
|
||||
<option value="activo">Activo</option>
|
||||
<option value="mantenimiento">En Mantenimiento</option>
|
||||
<option value="baja">Dado de Baja</option>
|
||||
<option value="reparacion">En Reparación</option>
|
||||
</select>
|
||||
|
||||
<label htmlFor="tipo">Tipo de Equipo</label>
|
||||
<select id="tipo">
|
||||
<option value="">Seleccione el tipo de equipo</option>
|
||||
<option value="cpu">CPU</option>
|
||||
<option value="laptop">Laptop</option>
|
||||
<option value="monitor">Monitor</option>
|
||||
<option value="impresora">Impresora</option>
|
||||
<option value="servidor">Servidor</option>
|
||||
</select>
|
||||
|
||||
<label htmlFor="antiguedad">Antigüedad</label>
|
||||
<select id="antiguedad">
|
||||
<option value="">Seleccione la antigüedad del equipo</option>
|
||||
<option value="menos1">Menos de 1 año</option>
|
||||
<option value="1-3">1 a 3 años</option>
|
||||
<option value="3-5">3 a 5 años</option>
|
||||
<option value="mas5">Más de 5 años</option>
|
||||
</select>
|
||||
<Pregunta9/>
|
||||
<div className="botones-filtro">
|
||||
<button type="reset" className="limpiar">
|
||||
Limpiar filtros
|
||||
</button>
|
||||
<button type="submit" className="aplicar">
|
||||
Aplicar filtros
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button className="boton-descargar">Descargar</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -29,10 +29,11 @@ export default function Page() {
|
||||
if (data) {
|
||||
router.push(`/editar?equipoId=${data.inventario}`);
|
||||
} else {
|
||||
toast.error("Equipo no encontrado");
|
||||
router.push(`/agregarEquipo?equipoId=${data.inventario}`);
|
||||
}
|
||||
} catch (error) {
|
||||
toast.error(`Equipo no encontrado,${error}`);
|
||||
toast.error("Error No se encontro el equipo");
|
||||
router.push(`/agregarEquipo?equipoId=${search}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
// =====================================
|
||||
|
||||
.forgot-password-page {
|
||||
width: 90%;
|
||||
max-width: 520px;
|
||||
margin: 10rem auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding: 2rem;
|
||||
background: #ffffff;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
color: #222;
|
||||
transition: background 0.3s ease, color 0.3s ease;
|
||||
|
||||
@@ -128,10 +128,8 @@
|
||||
// --- Teléfonos pequeños ---
|
||||
@media (max-width: 480px) {
|
||||
.forgot-password-page {
|
||||
margin: 15rem auto;
|
||||
padding: 1.5rem;
|
||||
width: 92%;
|
||||
box-shadow: none;
|
||||
|
||||
h1 {
|
||||
font-size: 1.6rem;
|
||||
@@ -160,9 +158,7 @@
|
||||
// --- Tablets (iPad y similares) ---
|
||||
@media (min-width: 768px) and (max-width: 1024px) {
|
||||
.forgot-password-page {
|
||||
margin: 8rem auto;
|
||||
padding: 3rem 2.5rem;
|
||||
max-width: 600px;
|
||||
font-size: 1.05rem;
|
||||
|
||||
h1 {
|
||||
@@ -193,8 +189,6 @@
|
||||
// --- Escritorio grande ---
|
||||
@media (min-width: 1280px) {
|
||||
.forgot-password-page {
|
||||
margin: 12rem auto;
|
||||
padding: 3rem;
|
||||
max-width: 520px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,33 +7,12 @@
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px 24px;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
color: #0056b3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.scanView {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
@@ -55,9 +34,6 @@
|
||||
color: #0056b3;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
box-shadow: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
@@ -70,11 +46,11 @@
|
||||
background-color: #fafafa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 18px 16px;
|
||||
padding: auto 16px;
|
||||
cursor: pointer;
|
||||
border-right: 1px solid #e0e0e0;
|
||||
color: #555;
|
||||
@@ -82,6 +58,9 @@
|
||||
border-left: 4px solid transparent;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
background: none;
|
||||
border: none;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
@@ -141,7 +120,7 @@
|
||||
font-weight: bold;
|
||||
|
||||
.count-box {
|
||||
color:#0056b3;
|
||||
color: #0056b3;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,7 +138,6 @@
|
||||
|
||||
.scanView .tab {
|
||||
flex: 1;
|
||||
padding: 14px 0;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
.accordion-content {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.4s ease, opacity 0.4s ease;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.accordion-content.open {
|
||||
max-height: 1000px; /* Ajusta si tienes más contenido */
|
||||
opacity: 1;
|
||||
}
|
||||
.accordion-header-wrapper {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.accordion-header {
|
||||
background-color: #f5f5f5;
|
||||
border:none;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
border-left: 6px solid #001f3f;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: background-color 0.2s ease;
|
||||
|
||||
&:hover {
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
|
||||
.toggle-icon {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
transition: transform 0.3s ease;
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.toggle-icon.open {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
.reporte-page {
|
||||
.reporte-container {
|
||||
padding: 40px;
|
||||
background-color: #f9fafc;
|
||||
}
|
||||
|
||||
.titulo-reporte {
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #002855;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.reporte-contenido {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.bloque-pregunta {
|
||||
background-color: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||
padding: 25px;
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export default function Page() {
|
||||
const headers = { Authorization: `Bearer ${token}` };
|
||||
|
||||
const response = await axios.get(
|
||||
`${api_url}/equipos/procesador-tipo-equipos/${formData.id_tipo_equipo}`,
|
||||
`${api_url}/equipos/procesador-tipo-equipos`,
|
||||
{
|
||||
headers,
|
||||
}
|
||||
@@ -422,12 +422,13 @@ export default function Page() {
|
||||
<div className="formGroup">
|
||||
<label>Procesador</label>
|
||||
<select
|
||||
disabled={formData.id_tipo_equipo ==0}
|
||||
value={formData.id_procesador}
|
||||
onChange={(e) =>
|
||||
handleInputChange("id_procesador", e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Selecciona procesador</option>
|
||||
<option value="">{formData.id_tipo_equipo ? "Selecciona procesador":"Selecciona primero el tipo de equipo"}</option>
|
||||
{PROCESADORES_POR_EQUIPO[formData.id_tipo_equipo]?.map(
|
||||
(p) => (
|
||||
<option key={p.id_procesador} value={p.id_procesador}>
|
||||
@@ -441,6 +442,7 @@ export default function Page() {
|
||||
<div className="formGroup">
|
||||
<label>Sistema operativo</label>
|
||||
<select
|
||||
disabled={formData.id_tipo_equipo ==0}
|
||||
value={formData.id_sistema_operativo}
|
||||
onChange={(e) =>
|
||||
handleInputChange(
|
||||
@@ -449,7 +451,7 @@ export default function Page() {
|
||||
)
|
||||
}
|
||||
>
|
||||
<option value="">Selecciona sistema operativo</option>
|
||||
<option value="">{formData.id_tipo_equipo ? "Selecciona sistema operativo":"Selecciona primero el tipo de equipo"}</option>
|
||||
{SO_POR_EQUIPO[formData.id_tipo_equipo]?.map((so) => (
|
||||
<option
|
||||
key={so.id_sistema_operativo}
|
||||
|
||||
+19
-18
@@ -88,6 +88,7 @@ export default function Editar() {
|
||||
const [procesadores, setProcesadores] = useState<Procesador[]>([]);
|
||||
const [perifericos, setPerifericos] = useState<Perifericos[]>([]);
|
||||
const [adscripcionLabel, setAdscripcionLabel] = useState("");
|
||||
const [id, setId] = useState(0);
|
||||
|
||||
const [suggestions, setSuggestions] = useState({
|
||||
adscripcion: [] as string[],
|
||||
@@ -168,13 +169,10 @@ export default function Editar() {
|
||||
sistema_operativo: string;
|
||||
} | null;
|
||||
tipoEquipo: { id_tipo_de_equipo: number; tipo_equipo: string } | null;
|
||||
procesador_tipoequipo: {
|
||||
id: number;
|
||||
procesador: {
|
||||
id_procesador: number;
|
||||
procesador: string;
|
||||
};
|
||||
} | null;
|
||||
procesador: {
|
||||
id_procesador: number;
|
||||
procesador: string;
|
||||
};
|
||||
tipoUso: { id_uso: number; tipo_uso: string };
|
||||
marca: { id_marca: number; marca: string };
|
||||
periferico: { id_periferico: number; periferico: string };
|
||||
@@ -222,8 +220,7 @@ export default function Editar() {
|
||||
id_estado: equipo.estado?.id_estado || 0,
|
||||
id_sistema_operativo:
|
||||
equipo.sistemaOperativo?.id_sistema_operativo || 0,
|
||||
id_procesador:
|
||||
equipo.procesador_tipoequipo?.procesador?.id_procesador || 0,
|
||||
id_procesador:equipo.procesador?.id_procesador || 0,
|
||||
id_uso: equipo.tipoUso?.id_uso || 0,
|
||||
observaciones: equipo.observaciones || "",
|
||||
id_adscripcion: equipo.adscripcion?.id_adscripcion || 0,
|
||||
@@ -234,6 +231,7 @@ export default function Editar() {
|
||||
});
|
||||
|
||||
setAdscripcionLabel(equipo.adscripcion?.adscripcion);
|
||||
setId(equipo.id_equipo);
|
||||
} catch (error) {
|
||||
console.error("Error al obtener el equipo:", error);
|
||||
toast.error("No se pudo cargar la información del equipo.");
|
||||
@@ -249,7 +247,7 @@ export default function Editar() {
|
||||
const headers = { Authorization: `Bearer ${token}` };
|
||||
|
||||
const response = await axios.get(
|
||||
`${api_url}/equipos/procesador-tipo-equipos/${formData.id_tipo_equipo}`,
|
||||
`${api_url}/equipos/procesador-tipo-equipos`,
|
||||
{
|
||||
headers,
|
||||
}
|
||||
@@ -283,7 +281,7 @@ export default function Editar() {
|
||||
|
||||
const handleGuardar = async () => {
|
||||
|
||||
|
||||
|
||||
if (!formData.inventario) {
|
||||
toast.error("Inventario no encontrado");
|
||||
return;
|
||||
@@ -321,7 +319,7 @@ export default function Editar() {
|
||||
}
|
||||
}
|
||||
|
||||
if(formData.id_tipo_equipo != 8 && formData.id_tipo_equipo != 7 && formData.id_tipo_equipo != 9){
|
||||
if (formData.id_tipo_equipo != 8 && formData.id_tipo_equipo != 7 && formData.id_tipo_equipo != 9) {
|
||||
if (!formData.id_sistema_operativo) {
|
||||
toast.error("Sistema operativo no encontrado ");
|
||||
return;
|
||||
@@ -339,11 +337,12 @@ export default function Editar() {
|
||||
const headers = { Authorization: `Bearer ${token}` };
|
||||
|
||||
const data = {
|
||||
id_procesador: formData.id_procesador,
|
||||
id_estado: formData.id_estado,
|
||||
id_adscripcion: formData.id_adscripcion,
|
||||
lugar: formData.lugar,
|
||||
id_sistema_operativo: formData.id_sistema_operativo,
|
||||
id_uso: formData.id_uso,
|
||||
id_tipo_uso: formData.id_uso,
|
||||
serie: formData.serie,
|
||||
modelo: formData.modelo,
|
||||
id_marca: formData.id_marca,
|
||||
@@ -352,7 +351,7 @@ export default function Editar() {
|
||||
|
||||
try {
|
||||
await axios.patch(
|
||||
`${api_url}/equipos/update/${formData.inventario}`,
|
||||
`${api_url}/equipos/update/${id}`,
|
||||
data,
|
||||
{
|
||||
headers,
|
||||
@@ -426,9 +425,8 @@ export default function Editar() {
|
||||
const first = data[0];
|
||||
setFormData((prev) => ({
|
||||
...prev,
|
||||
responsable: `${first.nombre ?? ""} ${
|
||||
first.apellidos ?? ""
|
||||
}`.trim(),
|
||||
responsable: `${first.nombre ?? ""} ${first.apellidos ?? ""
|
||||
}`.trim(),
|
||||
}));
|
||||
} else {
|
||||
toast.error(
|
||||
@@ -513,6 +511,8 @@ export default function Editar() {
|
||||
<div className="formGroup">
|
||||
<label>Tipo de equipo</label>
|
||||
<select
|
||||
style={{ background: "#f6f7f9" }}
|
||||
disabled
|
||||
required
|
||||
value={formData.id_tipo_equipo}
|
||||
onChange={(e) =>
|
||||
@@ -578,7 +578,7 @@ export default function Editar() {
|
||||
handleInputChange("id_procesador", e.target.value)
|
||||
}
|
||||
>
|
||||
<option value="">Selecciona procesador</option>
|
||||
<option value="">{formData.id_tipo_equipo ? "Selecciona procesador" : "Selecciona primero el tipo de equipo"}</option>
|
||||
{PROCESADORES_POR_EQUIPO[formData.id_tipo_equipo]?.map(
|
||||
(p) => (
|
||||
<option key={p.id_procesador} value={p.id_procesador}>
|
||||
@@ -672,6 +672,7 @@ export default function Editar() {
|
||||
<div className="formGroup">
|
||||
<label>Responsable</label>
|
||||
<input
|
||||
style={{ background: "#f6f7f9" }}
|
||||
type="text"
|
||||
value={formData.responsable}
|
||||
disabled
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import "../app/styles/layout/pregunta1.scss";
|
||||
|
||||
type OsEntry = {
|
||||
os: string;
|
||||
count: string;
|
||||
isTotal?: boolean;
|
||||
};
|
||||
|
||||
const MOCK_DATA = {
|
||||
"pc-desktop": [
|
||||
{ os: "Windows 11", count: "408" },
|
||||
{ os: "Windows 10", count: "1171" },
|
||||
{ os: "Windows 7/8", count: "177" },
|
||||
{ os: "Windows XP/Vista", count: "43" },
|
||||
{ os: "Linux", count: "45" },
|
||||
{ os: "Total", count: "1844", isTotal: true },
|
||||
],
|
||||
"apple-desktop": [
|
||||
{ os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" },
|
||||
{
|
||||
os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)",
|
||||
count: "180",
|
||||
},
|
||||
{ os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" },
|
||||
{ os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" },
|
||||
{ os: "Total", count: "480", isTotal: true },
|
||||
],
|
||||
"pc-laptop": [
|
||||
{ os: "Windows 11", count: "40" },
|
||||
{ os: "Windows 10", count: "171" },
|
||||
{ os: "Windows 7/8", count: "17" },
|
||||
{ os: "Windows XP/Vista", count: "3" },
|
||||
{ os: "Linux", count: "5" },
|
||||
{ os: "Total", count: "236", isTotal: true }, // corregido
|
||||
],
|
||||
"apple-laptop": [
|
||||
{ os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" },
|
||||
{
|
||||
os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)",
|
||||
count: "180",
|
||||
},
|
||||
{ os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" },
|
||||
{ os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" },
|
||||
{ os: "Total", count: "480", isTotal: true },
|
||||
],
|
||||
servers: [
|
||||
{
|
||||
os: "Linux (CentOs,Fedora,Ubuntu,Red Hat Enterprise,entre otros)",
|
||||
count: "120",
|
||||
},
|
||||
{ os: "Unix (AIX,MAC OS Server,Solaris,entre otros)", count: "80" },
|
||||
{ os: "Windows Server 2022/2023", count: "50" },
|
||||
{ os: "Windows Server 2016/2019", count: "80" },
|
||||
{ os: "Windows Server 2008/2012", count: "50" },
|
||||
{ os: "Windows Server 2000/2003", count: "12" },
|
||||
{ os: "Total", count: "392", isTotal: true }, // corregido también
|
||||
],
|
||||
};
|
||||
|
||||
const PLATFORM_LABELS: Record<string, string> = {
|
||||
"pc-desktop": "Computadoras de escritorio Plataforma PC",
|
||||
"apple-desktop": "Computadoras de escritorio Plataforma Apple",
|
||||
"pc-laptop": "Computadoras portátiles Plataforma PC",
|
||||
"apple-laptop": "Computadoras portátiles Plataforma Apple",
|
||||
servers: "Servidores de alto rendimiento",
|
||||
};
|
||||
|
||||
const Pregunta1 = () => {
|
||||
const [activeTab, setActiveTab] =
|
||||
useState<keyof typeof MOCK_DATA>("pc-desktop");
|
||||
const currentData = MOCK_DATA[activeTab];
|
||||
|
||||
return (
|
||||
<div className="scanView">
|
||||
<div className="container">
|
||||
<div className="header">
|
||||
Presione cada pestaña para ver la información de las plataformas.
|
||||
</div>
|
||||
|
||||
<div className="main-content">
|
||||
<div className="tabs">
|
||||
{Object.entries(PLATFORM_LABELS).map(([key, label]) => (
|
||||
<button
|
||||
key={key}
|
||||
className={`tab ${activeTab === key ? "active" : ""}`}
|
||||
onClick={() => setActiveTab(key as keyof typeof MOCK_DATA)}
|
||||
aria-selected={activeTab === key}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="data-table-wrapper">
|
||||
<div className="data-table">
|
||||
{currentData.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`data-row ${item.isTotal ? "total-row" : ""}`}
|
||||
>
|
||||
<div className="os-name">{item.os}</div>
|
||||
<div className="count-box">{item.count}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Pregunta1;
|
||||
@@ -0,0 +1,158 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import "./pregunta2.scss";
|
||||
|
||||
// Tipos
|
||||
type OsEntry = {
|
||||
os: string;
|
||||
count: string; // o number si la API devuelve números
|
||||
isTotal?: boolean;
|
||||
};
|
||||
|
||||
type PlatformData = {
|
||||
[key: string]: OsEntry[];
|
||||
};
|
||||
|
||||
// === DATOS TEMPORALES (mock) ===
|
||||
const MOCK_DATA: PlatformData = {
|
||||
"pc-desktop": [
|
||||
{ os: "Windows 11", count: "408" },
|
||||
{ os: "Windows 10", count: "1171" },
|
||||
{ os: "Windows 7/8", count: "177" },
|
||||
{ os: "Windows XP/Vista", count: "43" },
|
||||
{ os: "Linux", count: "45" },
|
||||
{ os: "Total", count: "1844", isTotal: true },
|
||||
],
|
||||
"apple-desktop": [
|
||||
{ os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "205" },
|
||||
{
|
||||
os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)",
|
||||
count: "180",
|
||||
},
|
||||
{ os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "95" },
|
||||
{ os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "6" },
|
||||
{ os: "Total", count: "480", isTotal: true },
|
||||
],
|
||||
"pc-laptop": [
|
||||
{ os: "Windows 11", count: "40" },
|
||||
{ os: "Windows 10", count: "171" },
|
||||
{ os: "Windows 7/8", count: "17" },
|
||||
{ os: "Windows XP/Vista", count: "3" },
|
||||
{ os: "Linux", count: "5" },
|
||||
{ os: "Total", count: "144", isTotal: true },
|
||||
],
|
||||
"apple-laptop": [
|
||||
{ os: "Mac OS X(13 - Ventura, 14 - Sonoma)", count: "39" },
|
||||
{
|
||||
os: "Mac OS X(Mojave,Catalina,11 - Big Sur, 12 - Monterrey)",
|
||||
count: "23",
|
||||
},
|
||||
{ os: "Mac OS X(Yosemite,El Capitan,Sierra,High Sierra)", count: "0" },
|
||||
{ os: "Mac OS X(Snow Leopard,Mountain Lion,Mavericks)", count: "9" },
|
||||
{ os: "Total", count: "71", isTotal: true },
|
||||
],
|
||||
servers: [
|
||||
{
|
||||
os: "Linux (CentOs,Fedora,Ubuntu,Red Hat Enterprise,entre otros)",
|
||||
count: "21",
|
||||
},
|
||||
{ os: "Unix (AIX,MAC OS Server,Solaris,entre otros)", count: "2" },
|
||||
{ os: "Windows Server 2022/2023", count: "6" },
|
||||
{ os: "Windows Server 2016/2019", count: "3" },
|
||||
{ os: "Windows Server 2008/2012", count: "3" },
|
||||
{ os: "Windows Server 2000/2003", count: "2" },
|
||||
{ os: "Total", count: "37", isTotal: true },
|
||||
],
|
||||
};
|
||||
|
||||
const API_ENDPOINT = "/api/platform-stats"; // ← ¡Reemplaza esto cuando sepas la URL real!
|
||||
|
||||
const Pregunta2= () => {
|
||||
const [activeTab, setActiveTab] = useState<string>("pc-desktop");
|
||||
const [data, setData] = useState<PlatformData>(MOCK_DATA);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
// === DESCOMENTA ESTO CUANDO TENGAS LA API ===
|
||||
// const response = await fetch(API_ENDPOINT);
|
||||
// if (!response.ok) throw new Error('Error al cargar estadísticas');
|
||||
// const apiData: PlatformData = await response.json();
|
||||
// setData(apiData);
|
||||
// setLoading(false);
|
||||
|
||||
// === POR AHORA: usa datos simulados (y simula un retraso si quieres) ===
|
||||
// await new Promise(resolve => setTimeout(resolve, 300));
|
||||
setData(MOCK_DATA);
|
||||
setLoading(false);
|
||||
} catch (err) {
|
||||
console.error("Error al cargar datos:", err);
|
||||
setError(
|
||||
"No se pudieron cargar las estadísticas. Usando datos temporales."
|
||||
);
|
||||
setData(MOCK_DATA); // fallback en caso de error
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const currentData = data[activeTab] || [];
|
||||
|
||||
// Si quisieras mostrar un estado de carga (opcional)
|
||||
// if (loading) return <div className="dashboardContainer"><p>Cargando...</p></div>;
|
||||
// if (error) console.warn(error); // o muestra un toast, etc.
|
||||
|
||||
return (
|
||||
<div className="dashboardContainer">
|
||||
|
||||
<div className="scanView">
|
||||
<div className="container">
|
||||
<div className="header">
|
||||
Presione cada pestaña para ver la información de las plataformas.
|
||||
</div>
|
||||
|
||||
<div className="main-content">
|
||||
<div className="tabs">
|
||||
{Object.entries({
|
||||
"pc-desktop": "Computadoras de escritorio Plataforma PC",
|
||||
"apple-desktop": "Computadoras de escritorio Plataforma Apple",
|
||||
"pc-laptop": "Computadoras portátiles Plataforma PC",
|
||||
"apple-laptop": "Computadoras portátiles Plataforma Apple",
|
||||
servers: "Servidores de alto rendimiento",
|
||||
}).map(([key, label]) => (
|
||||
<div
|
||||
key={key}
|
||||
className={`tab ${activeTab === key ? "active" : ""}`}
|
||||
onClick={() => setActiveTab(key)}
|
||||
>
|
||||
{label}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="data-table-wrapper">
|
||||
<div className="data-table">
|
||||
{currentData.map((item, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={`data-row ${item.isTotal ? "total-row" : ""}`}
|
||||
>
|
||||
<div className="os-name">{item.os}</div>
|
||||
<div className="count-box">{item.count}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Pregunta2;
|
||||
@@ -0,0 +1,135 @@
|
||||
"use client";
|
||||
import React, { useState } from "react";
|
||||
import "./pregunta9.css";
|
||||
|
||||
export default function Pregunta9() {
|
||||
|
||||
const [datos, setDatos] = useState([
|
||||
{ nombre: "Computadoras de Escritorio", valores: ["", "", "", ""] },
|
||||
{ nombre: "Computadoras Portátiles", valores: ["", "", "", ""] },
|
||||
{ nombre: "Alto Rendimiento", valores: ["", "", "", ""] },
|
||||
]);
|
||||
|
||||
|
||||
const [garantia, setGarantia] = useState({
|
||||
escritorio: "",
|
||||
portatil: "",
|
||||
altoRendimiento: "",
|
||||
});
|
||||
|
||||
// Función para actualizar datos de Pregunta 9
|
||||
const handleChange = (filaIndex: number, colIndex: number, value: string) => {
|
||||
const nuevosDatos = [...datos];
|
||||
nuevosDatos[filaIndex].valores[colIndex] = value;
|
||||
setDatos(nuevosDatos);
|
||||
};
|
||||
|
||||
// Función para calcular total de cada fila en Pregunta 9
|
||||
const calcularTotal = (valores: string[]) =>
|
||||
valores.reduce((acc, val) => acc + (Number(val) || 0), 0);
|
||||
|
||||
return (
|
||||
<div className="contenedor-pregunta">
|
||||
{/* Pregunta 9 */}
|
||||
<div className="tabla-contenedor">
|
||||
<table className="tabla">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="azul-marino">% Antiguedad de los equipos</th>
|
||||
<th className="rosa-fuerte">Menor a 2 años</th>
|
||||
<th className="rosa-fuerte">Entre 2 y 3 años</th>
|
||||
<th className="rosa-fuerte">Entre 4 y 5 años</th>
|
||||
<th className="rosa-fuerte">Mayor a 6 años</th>
|
||||
<th className="azul-marino">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{datos.map((fila, filaIndex) => {
|
||||
const total = calcularTotal(fila.valores);
|
||||
return (
|
||||
<tr key={filaIndex}>
|
||||
<td>{fila.nombre}</td>
|
||||
{fila.valores.map((valor, colIndex) => (
|
||||
<td key={colIndex}>
|
||||
<div className="input-contenedor">
|
||||
<input
|
||||
type="number"
|
||||
value={valor}
|
||||
onChange={(e) =>
|
||||
handleChange(filaIndex, colIndex, e.target.value)
|
||||
}
|
||||
/>
|
||||
<span className="porcentaje">%</span>
|
||||
</div>
|
||||
</td>
|
||||
))}
|
||||
<td
|
||||
className={`total-celda ${
|
||||
total > 100 ? "total-error" : ""
|
||||
}`}
|
||||
>
|
||||
{total.toFixed(2)}%
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{/* Pregunta 10 */}
|
||||
<div className="pregunta-cuadro" style={{ marginTop: "30px" }}>
|
||||
10. ¿Cuántos equipos de cómputo tienen garantía de proveedor?. *
|
||||
</div>
|
||||
|
||||
<div className="tabla-contenedor">
|
||||
<table className="tabla">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="azul-marino">Computadoras de Escritorio (247)</th>
|
||||
<th className="azul-marino">Computadoras Portátiles (767)</th>
|
||||
<th className="azul-marino">Alto Rendimiento (17)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div className="input-contenedor input-sp">
|
||||
<input
|
||||
type="number"
|
||||
value={garantia.escritorio}
|
||||
onChange={(e) =>
|
||||
setGarantia({ ...garantia, escritorio: e.target.value })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div className="input-contenedor input-sp">
|
||||
<input
|
||||
type="number"
|
||||
value={garantia.portatil}
|
||||
onChange={(e) =>
|
||||
setGarantia({ ...garantia, portatil: e.target.value })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div className="input-contenedor input-sp">
|
||||
<input
|
||||
type="number"
|
||||
value={garantia.altoRendimiento}
|
||||
onChange={(e) =>
|
||||
setGarantia({ ...garantia, altoRendimiento: e.target.value })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
.dashboardContainer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16px 24px;
|
||||
background-color: #ffffff;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
color: #0056b3;
|
||||
}
|
||||
}
|
||||
|
||||
.scanView {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
max-width: 900px;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 16px 20px;
|
||||
background: #f7f7f7;
|
||||
border-bottom: 1px solid #e0e0e0;
|
||||
font-size: 15px;
|
||||
color: #0056b3;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
box-shadow: none;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
display: flex;
|
||||
min-height: 420px;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
height: 100%;
|
||||
width: 230px;
|
||||
background-color: #fafafa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 5%;
|
||||
cursor: pointer;
|
||||
color: #555;
|
||||
transition: all 0.3s ease;
|
||||
border-left: 4px solid transparent;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tab:hover {
|
||||
background-color: #f0f0f0;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.tab.active {
|
||||
background-color: #fff;
|
||||
border-left: 4px solid #0056b3;
|
||||
border-right: none;
|
||||
border-bottom: 1px solid #0056b3;
|
||||
color: #0056b3;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.data-table-wrapper {
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.data-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.data-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 12px 16px;
|
||||
background: #f9f9f9;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.data-row:hover {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
.os-name {
|
||||
flex: 1;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.count-box {
|
||||
background: #ffffff;
|
||||
border: 1px solid #0056b3;
|
||||
padding: 6px 14px;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
min-width: 70px;
|
||||
}
|
||||
|
||||
.total-row {
|
||||
background: #eaf4ff;
|
||||
font-weight: bold;
|
||||
|
||||
.count-box {
|
||||
color:#0056b3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ======== RESPONSIVE ======== */
|
||||
@media (max-width: 700px) {
|
||||
.scanView .main-content {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.scanView .tabs {
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scanView .tab {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
.contenedor-pregunta {
|
||||
padding: 20px;
|
||||
background-color: #f9fafc;
|
||||
}
|
||||
|
||||
|
||||
.pregunta-cuadro {
|
||||
background-color: #f5f5f5;
|
||||
border-left: 6px solid #001f3f;
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
font-size: 16px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
|
||||
.tabla-contenedor {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
/* Tabla */
|
||||
.tabla {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
text-align: center;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.tabla th,
|
||||
.tabla td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 12px;
|
||||
|
||||
}
|
||||
|
||||
.tabla th {
|
||||
color: white;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.tabla td {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Colores personalizados */
|
||||
.azul-marino {
|
||||
background-color: #002855;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.rosa-fuerte {
|
||||
background-color: #dc1557;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Contenedor input */
|
||||
.input-contenedor {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Input */
|
||||
.input-contenedor input {
|
||||
width: 40%;
|
||||
padding: 6px 25px 6px 6px;
|
||||
border: 2px solid #002855;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
outline: none;
|
||||
background-color: rgb(232, 226, 226);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
.input-contenedor input::-webkit-inner-spin-button,
|
||||
.input-contenedor input::-webkit-outer-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Focus del input */
|
||||
.input-contenedor input:focus {
|
||||
border-color: #001f3f;
|
||||
box-shadow: 0 0 6px rgba(0, 47, 95, 0.3);
|
||||
}
|
||||
|
||||
/* Placeholder gris claro */
|
||||
.input-contenedor input::placeholder {
|
||||
color: #bbb;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.input-contenedor .porcentaje {
|
||||
position: absolute;
|
||||
|
||||
right: 8px;
|
||||
color: #555;
|
||||
font-weight: bold;
|
||||
pointer-events: none;
|
||||
font-size: 14px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
/* Celda del total */
|
||||
.total-celda {
|
||||
font-weight: bold;
|
||||
color: #002855;
|
||||
background-color: #eef2f6;
|
||||
}
|
||||
|
||||
/* Total > 100% */
|
||||
.total-error {
|
||||
background-color: #ffcccc;
|
||||
color: #a80000;
|
||||
}
|
||||
|
||||
|
||||
.input-sp input {
|
||||
width: 38%;
|
||||
padding: 6px 6px 6px 6px;
|
||||
}
|
||||
Reference in New Issue
Block a user