diff --git a/app/(private)/ActivosMantenimiento/Page.module.css b/app/(private)/ActivosMantenimiento/Page.module.css index d2c7bc7..6b7acb8 100644 --- a/app/(private)/ActivosMantenimiento/Page.module.css +++ b/app/(private)/ActivosMantenimiento/Page.module.css @@ -76,7 +76,7 @@ .checkbox-grid label { display: inline-flex; align-items: center; - font-size: 13px; + font-size: 1.4rem; cursor: pointer; } diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 66332ee..6385ec0 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -2,17 +2,19 @@ import Areas from "@/app/Components/ActivosMantenimiento/Areas"; import MesasDisponibles from "@/app/Components/ActivosMantenimiento/MesasDisponibles"; import TableEquipos from "@/app/Components/Equipos/tableequipos"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "ActivosMantenimiento", +}; export default async function Page(props: { searchParams?: Promise<{ key?: string; - numAcount?: string; - machine?: string; }>; }) { const params = await props.searchParams; const key = params?.key && params.key; - const numAcount = params?.numAcount ? params.numAcount : null; return (
diff --git a/app/(private)/AgregarTiempo/Addtime.tsx b/app/(private)/AgregarTiempo/Addtime.tsx index 70f4b77..7f4b6f7 100644 --- a/app/(private)/AgregarTiempo/Addtime.tsx +++ b/app/(private)/AgregarTiempo/Addtime.tsx @@ -2,12 +2,13 @@ import { useState } from "react"; import { useRouter } from "next/navigation"; +import { envConfig } from "@/app/lib/config"; import SelectionCo from "@/app/Components/Selection/SelectionCo"; import axios from "axios"; -import { envConfig } from "@/app/lib/config"; import Cookies from "js-cookie"; import Swal from "sweetalert2"; + import "./addTime.css"; const PLATAFORMA_MAP: Record = { @@ -42,11 +43,16 @@ export default function AddTime({ const month = day.getMonth(); const today = day.getDate(); - const minFecha = new Date(year, month, 1).toISOString().split("T")[0]; + let minMount = month + if (!lock) { + minMount = month - 1 + } + + const minFecha = new Date(year, minMount, 1).toISOString().split("T")[0]; const maxFecha = new Date(year, month, today).toISOString().split("T")[0]; const handleSaveReceipt = async () => { - if (!numAcount) { + if (numAcount == null) { Swal.fire({ title: "Busca de nuevo al estudiante!", diff --git a/app/(private)/AgregarTiempo/addTime.css b/app/(private)/AgregarTiempo/addTime.css index aaf7820..6b40142 100644 --- a/app/(private)/AgregarTiempo/addTime.css +++ b/app/(private)/AgregarTiempo/addTime.css @@ -23,21 +23,21 @@ width: 100%; } -.buttonLock{ +.buttonLock { padding: 0.8rem; position: absolute; - right: 0; + right: 100px; background-color: #d32f2f; } -.buttonOpenLock{ +.buttonOpenLock { padding: 0.8rem; position: absolute; - right: 0; + right: 100px; background-color: #8cd32f; } -.buttonOpenLock:hover{ +.buttonOpenLock:hover { background-color: #78b32c; } @@ -63,6 +63,24 @@ background-repeat: no-repeat; } +@media(max-height:800px) { + .addTime { + margin-top: 0.5rem; + padding: 0.5rem; + max-width: 320px; + } + + .firstPartInformationTime { + max-width: 320px; + } +} + +@media(max-height:800px) { + .buttonLock { + padding: 0.5rem; + } +} + @media (max-width: 800px) { .containeInformationTime { flex-direction: column; diff --git a/app/(private)/AgregarTiempo/page.tsx b/app/(private)/AgregarTiempo/page.tsx index 45ddd9c..db7354c 100644 --- a/app/(private)/AgregarTiempo/page.tsx +++ b/app/(private)/AgregarTiempo/page.tsx @@ -8,9 +8,14 @@ import AddTime from "./Addtime"; import Table from "@/app/Components/Global/table"; import "./addTime.css"; +import { Metadata } from "next"; const headers = ["Inscrito", "Tiempo", "Confirmó"]; +export const metadata: Metadata = { + title: "AgregarTiempo", +}; + export default async function Page(props: { searchParams?: Promise<{ numAcount: string }>; }) { diff --git a/app/(private)/Alta/page.tsx b/app/(private)/Alta/page.tsx index 0ad2646..cde9d8b 100644 --- a/app/(private)/Alta/page.tsx +++ b/app/(private)/Alta/page.tsx @@ -1,6 +1,11 @@ import RegisterAlta from "@/app/Components/Alta/registerAlta"; import "./style.css"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Alta", +}; export default async function Page(props: { searchParams?: Promise<{ diff --git a/app/(private)/AsignacionEquipo/PlaticaGate.tsx b/app/(private)/AsignacionEquipo/PlaticaGate.tsx index e8fb0ae..46a0750 100644 --- a/app/(private)/AsignacionEquipo/PlaticaGate.tsx +++ b/app/(private)/AsignacionEquipo/PlaticaGate.tsx @@ -6,9 +6,11 @@ import { envConfig } from "@/app/lib/config"; import { getEquipoByCount } from "@/app/lib/getEquipoByCount"; import { getMesaByCount } from "@/app/lib/getMesaByCount"; -import "./asignacion.css"; import Swal from "sweetalert2"; import axios from "axios"; +import Cookies from "js-cookie"; + +import "./asignacion.css"; type Props = { inscripcion: any[]; @@ -23,7 +25,10 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) { const [open, setOpen] = useState(false); const [tiempo, setTiempo] = useState(15); const [bitacora, setBitacora] = useState<[] | null>([]); - const [error, setError] = useState(); + const [error, setError] = useState("Equipo"); + + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; const fetchByCuenta = async (idCuenta: number) => { const [result, resultMesa] = await Promise.all([ @@ -35,8 +40,15 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) { setBitacora(null); } else { setBitacora([]); - if (!result?.error) setError("Equipo"); - if (!resultMesa?.error) setError("Mesa"); + if (!result?.error) { + setError("Equipo"); + return; + } + + if (!resultMesa?.error) { + setError("Mesa"); + return; + } } }; @@ -68,14 +80,16 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) { }, [inscripcion]); useEffect(() => { - if (!puedeContinuar || !numAcount || error === "Equipo" || error === "Mesa") return; + if (!puedeContinuar || !numAcount || !(error === "Equipo" || error === "Mesa")) return; const fetchEquipos = async () => { try { + setLoadingEquipos(true); const res = await axios.get( - `${envConfig.apiUrl}/equipo/student/${numAcount}` + `${envConfig.apiUrl}/equipo/student/${numAcount}`, + { headers }, ); setEquipos(res.data); @@ -115,7 +129,8 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) { id_alumno_inscrito: inscripcion[0].id_alumno_inscrito, }; - await axios.post(`${envConfig.apiUrl}/bitacora`, body); + await axios.post(`${envConfig.apiUrl}/bitacora`, body, { headers } + ); setBitacora([]); @@ -154,6 +169,8 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) { + + diff --git a/app/(private)/AsignacionEquipo/asignacion.css b/app/(private)/AsignacionEquipo/asignacion.css index ddd2fcc..51f3312 100644 --- a/app/(private)/AsignacionEquipo/asignacion.css +++ b/app/(private)/AsignacionEquipo/asignacion.css @@ -4,7 +4,7 @@ position: relative; flex: 1; width: 100%; - font-size: 14px; + font-size: 1.4rem; max-width: 500px; } diff --git a/app/(private)/AsignacionEquipo/page.tsx b/app/(private)/AsignacionEquipo/page.tsx index eee36b4..dfc839e 100644 --- a/app/(private)/AsignacionEquipo/page.tsx +++ b/app/(private)/AsignacionEquipo/page.tsx @@ -10,9 +10,14 @@ import { GetRegisterStudent } from "@/app/lib/getRegisterStudent"; import PlaticaGate from "./PlaticaGate"; import "@/app/globals.css"; import { GetRegisterStudentSancion } from "@/app/lib/GetRegisterStudentSancion"; +import { Metadata } from "next"; const headers = ["Inscrito", "Tiempo", "Confirmó"]; +export const metadata: Metadata = { + title: "AsignacionEquipo", +}; + export default async function Page(props: { searchParams?: Promise<{ key?: string; diff --git a/app/(private)/AsignacionMesas/TableMesas.tsx b/app/(private)/AsignacionMesas/TableMesas.tsx new file mode 100644 index 0000000..eeaf1aa --- /dev/null +++ b/app/(private)/AsignacionMesas/TableMesas.tsx @@ -0,0 +1,62 @@ +"use client"; + +import { useEffect, useState } from "react"; +import styles from "../Monitor/Page.module.css"; +import axios from "axios"; +import Cookies from "js-cookie"; + +type Mesa = { + id_mesa: number; + ocupado: number; +}; + +export default function TableMesas() { + const [mesas, setMesas] = useState([]); + const [loading, setLoading] = useState(true); + + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + + const fetchMesas = async () => { + try { + const res = await axios.get( + `${process.env.NEXT_PUBLIC_API_URL}/mesa/usoWhitout`, + { headers }, + ); + + setMesas(res.data); + } catch (error) { + console.error("Error cargando mesas:", error); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + fetchMesas(); + }, []); + + if (loading) { + return

Cargando mesas...

; + } + + return ( +
+ + + + + + + + + {mesas.map((mesa) => ( + + + + ))} + +
ID Mesa
{mesa.id_mesa}
+
+ ); +} \ No newline at end of file diff --git a/app/(private)/AsignacionMesas/asignacion.css b/app/(private)/AsignacionMesas/asignacion.css new file mode 100644 index 0000000..4643e33 --- /dev/null +++ b/app/(private)/AsignacionMesas/asignacion.css @@ -0,0 +1,10 @@ +.tableTable{ + margin: 0.1rem; + width: 100%; + max-width: 250px; +} +.asignacion{ + display: flex; + flex-wrap: wrap; + gap: 1rem; +} \ No newline at end of file diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 0cd3305..6cb4a08 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -4,15 +4,23 @@ import Information from "@/app/Components/Global/Information/information"; import SearchUser from "@/app/Components/Global/SearchUser/searchUser"; import ShowError from "@/app/Components/Global/ShowError"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import TableMesas from "./TableMesas"; import { GetRegisterStudent } from "@/app/lib/getRegisterStudent"; import { GetRegisterStudentSancion } from "@/app/lib/GetRegisterStudentSancion"; +import { Metadata } from "next"; + +import './asignacion.css' + +export const metadata: Metadata = { + title: "AsignacionMesas", +}; export default async function Page(props: { searchParams?: Promise<{ key?: string; numAcount?: string; - table?:number + table?: string }>; }) { const params = await props.searchParams; @@ -20,7 +28,6 @@ export default async function Page(props: { const numAcount = params?.numAcount ?? null; const table = params?.table ?? null; - let student: any = null; let platica: any = null; let inscripcion: any[] = []; @@ -40,7 +47,7 @@ export default async function Page(props: { ? Boolean(rawPlatica.data[0]) : Boolean(rawPlatica); } - + const inscResult = await GetRegisterStudent(idCuenta); if (!inscResult.error && Array.isArray(inscResult)) { @@ -56,41 +63,46 @@ export default async function Page(props: {

ASIGNACIÓN DE MESAS

- - +
+ + - {student && ( - <> -
- +
+ +
+ + -
- - - - )} - - ), - }, - { - key: "Liberar", - label: "Cancelar mesa", - content: , - }, - ]} - /> + + )} + + ), + }, + { + key: "Liberar", + label: "Cancelar mesa", + content: , + }, + ]} + /> +
+ +
+
); } diff --git a/app/(private)/BitacoraSanciones/page.tsx b/app/(private)/BitacoraSanciones/page.tsx index 47dc437..b606d06 100644 --- a/app/(private)/BitacoraSanciones/page.tsx +++ b/app/(private)/BitacoraSanciones/page.tsx @@ -8,6 +8,11 @@ import ShowError from "@/app/Components/Global/ShowError"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; import QuitarSancion from "@/app/Components/QuitarSancion/QuitarSancion"; import { GetStudentWhitoutSancion } from "@/app/lib/getStudentWhitoutSancion"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "BitacoraSanciones", +}; export default async function Page(props: { searchParams?: Promise<{ diff --git a/app/(private)/CambiarPass/page.tsx b/app/(private)/CambiarPass/page.tsx index c6388ad..f6c330f 100644 --- a/app/(private)/CambiarPass/page.tsx +++ b/app/(private)/CambiarPass/page.tsx @@ -1,4 +1,9 @@ import ChangePassword from "@/app/Components/auth/ChangePassword/changePassword"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "CambiarPass", +}; export default async function Page(props: { searchParams?: Promise<{ diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 221e05b..4e7b133 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -6,12 +6,15 @@ import Impressions from "@/app/Components/Impressions/impressions"; import ShowError from "@/app/Components/Global/ShowError"; import { cookies } from "next/headers"; +import { getCost } from "@/app/lib/getCost"; import { GetStudentWhitoutSancion } from "@/app/lib/getStudentWhitoutSancion"; -import axios from "axios"; - import "@/app/globals.css"; -import { envConfig } from "@/app/lib/config"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Impresiones", +}; export default async function Page(props: { searchParams?: Promise<{ @@ -33,7 +36,6 @@ export default async function Page(props: { if (numAcount) { const result = await GetStudentWhitoutSancion(parseInt(numAcount)); - if (result.error) { errorMessage = `${result.error}`; } else { @@ -41,14 +43,35 @@ export default async function Page(props: { } } + let id_servicio: number; + + switch (key) { + case "B/N": + id_servicio = 1; + break; + + case "color": + id_servicio = 2; + break; + + case "Plotter": + id_servicio = 3; + break; + + case "Escaner": + id_servicio = 6; + break; + } + try { - const response = await axios.get(`${envConfig.apiUrl}/costo`); - costos = response.data; + + const response = await getCost(); + costos = response; + } catch (error) { console.error("Error obteniendo costos:", error); } - const getCostsByService = (id_servicio: number) => { return costos .filter((c) => c.id_servicio === id_servicio) @@ -84,6 +107,7 @@ export default async function Page(props: { label: "Impresiones color", content: ( option.key === "Recibo" || option.key === "B/N" - ) + (option) => option.key === "Recibo" || option.key === "B/N" + ) : options; return ( diff --git a/app/(private)/InformacionEquipo/informacionequipo.css b/app/(private)/InformacionEquipo/informacionequipo.css index ca568ed..eb43c8b 100644 --- a/app/(private)/InformacionEquipo/informacionequipo.css +++ b/app/(private)/InformacionEquipo/informacionequipo.css @@ -15,16 +15,17 @@ .form-container { gap: 10px; + margin-bottom: 1rem; } .form-container label { - font-size: 14px; + font-size: 1.4rem; display: inline-block; vertical-align: middle; } .form-container select { - font-size: 13px; + font-size: 1.4rem; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; @@ -57,7 +58,7 @@ .checkbox-grid label { display: flex; align-items: center; - font-size: 13px; + font-size: 1.4rem; cursor: pointer; white-space: nowrap; width: fit-content; diff --git a/app/(private)/InformacionEquipo/page.tsx b/app/(private)/InformacionEquipo/page.tsx index fa06736..a704fcd 100644 --- a/app/(private)/InformacionEquipo/page.tsx +++ b/app/(private)/InformacionEquipo/page.tsx @@ -1,7 +1,12 @@ +import { Metadata } from "next"; import InformacionEquipo from "./InformacionEquipo"; import "./informacionequipo.css"; +export const metadata: Metadata = { + title: "InformacionEquipo", +}; + export default async function Page(props: { searchParams?: Promise<{ key?: string; diff --git a/app/(private)/Inscripcion/inscripcion.css b/app/(private)/Inscripcion/inscripcion.css index 325829e..0084d45 100644 --- a/app/(private)/Inscripcion/inscripcion.css +++ b/app/(private)/Inscripcion/inscripcion.css @@ -3,7 +3,7 @@ top: 0; background-color: #ffffff; width: 100%; - max-width: 700px; + max-width: 600px; border-radius: 4px; padding: 1rem; margin-top: 1rem; @@ -23,18 +23,35 @@ max-width: 450px; } -.restarPass{ - margin-top: 2rem; +.restarPass { + margin-top: 3rem; height: fit-content; } +@media(max-height:800px) { + .firstPartInformation { + max-width: 320px; + } + + .inscripcion { + max-width: 400px; + padding: 0.5rem; + margin-top: 0.5rem; + } + + .restarPass { + margin-top: 2rem; + } +} + @media (max-width: 800px) { .containeInformation { flex-direction: column; justify-content: center; align-items: center; } - .restarPass{ + + .restarPass { margin-top: 0; } } \ No newline at end of file diff --git a/app/(private)/Inscripcion/page.tsx b/app/(private)/Inscripcion/page.tsx index 43f902d..ce07a7e 100644 --- a/app/(private)/Inscripcion/page.tsx +++ b/app/(private)/Inscripcion/page.tsx @@ -9,9 +9,14 @@ import { GetRegisterStudent } from "@/app/lib/getRegisterStudent"; import { GetStudentWhitoutSancion } from "@/app/lib/getStudentWhitoutSancion"; import "./inscripcion.css"; +import { Metadata } from "next"; const headers = ["Inscrito", "Tiempo", "Confirmó"]; +export const metadata: Metadata = { + title: "Inscripcion", +}; + export default async function Page(props: { searchParams?: Promise<{ numAcount: string; diff --git a/app/(private)/Inscritos/Inscripciones.tsx b/app/(private)/Inscritos/Inscripciones.tsx index 1c759dc..24b2a16 100644 --- a/app/(private)/Inscritos/Inscripciones.tsx +++ b/app/(private)/Inscritos/Inscripciones.tsx @@ -2,6 +2,7 @@ import { envConfig } from "@/app/lib/config"; import { useEffect, useState } from "react"; import axios from "axios"; +import Cookies from "js-cookie"; import "./inscripciones.css" @@ -34,9 +35,13 @@ export default function Inscripciones() { const [selectedPeriodo, setSelectedPeriodo] = useState(null); const [tablaData, setTablaData] = useState([]); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { const getPeriodo = async () => { - const response = await axios.get(`${envConfig.apiUrl}/periodo`); + const response = await axios.get(`${envConfig.apiUrl}/periodo`, { headers } + ); setPeriodo(response.data); }; getPeriodo(); @@ -48,7 +53,9 @@ export default function Inscripciones() { if (!selectedPeriodo) return; const response = await axios.get( - `${envConfig.apiUrl}/alumno-inscrito/inscritos/${selectedPeriodo}` + `${envConfig.apiUrl}/alumno-inscrito/inscritos/${selectedPeriodo}`, + { headers } + ); const data: ApiResponse[] = response.data; diff --git a/app/(private)/Inscritos/page.tsx b/app/(private)/Inscritos/page.tsx index 1181c94..9da4770 100644 --- a/app/(private)/Inscritos/page.tsx +++ b/app/(private)/Inscritos/page.tsx @@ -1,5 +1,10 @@ +import { Metadata } from "next"; import Inscripciones from "./Inscripciones"; +export const metadata: Metadata = { + title: "Inscritos", +}; + export default async function Page(props: { searchParams?: Promise<{ period: string; diff --git a/app/(private)/Mensajes/mensaje.css b/app/(private)/Mensajes/mensaje.css index 648daf6..b41dc9c 100644 --- a/app/(private)/Mensajes/mensaje.css +++ b/app/(private)/Mensajes/mensaje.css @@ -28,7 +28,7 @@ background: none; border: none; padding: 10px; - font-size: 14px; + font-size: 1.4rem; cursor: pointer; transition: 0.3s; color: #333; @@ -48,7 +48,7 @@ } .formGroup label { - font-size: 14px; + font-size: 1.4rem; margin-bottom: 6px; color: #444; font-weight: 500; @@ -59,7 +59,7 @@ padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; - font-size: 14px; + font-size: 1.4rem; transition: border 0.3s, box-shadow 0.3s; } @@ -78,7 +78,7 @@ .btn { padding: 8px 16px; border-radius: 6px; - font-size: 14px; + font-size: 1.4rem; cursor: pointer; border: none; transition: 0.3s; diff --git a/app/(private)/Mensajes/page.tsx b/app/(private)/Mensajes/page.tsx index 4049d50..596d120 100644 --- a/app/(private)/Mensajes/page.tsx +++ b/app/(private)/Mensajes/page.tsx @@ -1,6 +1,11 @@ import EnviarMensaje from "@/app/Components/EviarMensaje/EnviarMensaje"; import EnviarMensajeSala from "@/app/Components/EviarMensaje/EnviarMensajeSala"; import Toggle from "@/app/Components/Global/Toggle/Toggle"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Mensajes", +}; export default async function Page(props: { searchParams?: Promise<{ diff --git a/app/(private)/Monitor/MachineTable.tsx b/app/(private)/Monitor/MachineTable.tsx index aa95c39..8f3ee13 100644 --- a/app/(private)/Monitor/MachineTable.tsx +++ b/app/(private)/Monitor/MachineTable.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import styles from "./Page.module.css"; import axios from "axios"; +import Cookies from "js-cookie"; type AreaUbicacion = { id_area_ubicacion: number; @@ -24,10 +25,15 @@ export default function MachineTable() { const [selectedArea, setSelectedArea] = useState("Todo"); const [loading, setLoading] = useState(true); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const fetchMachines = async () => { try { + const res = await axios.get( - `${process.env.NEXT_PUBLIC_API_URL}/equipo/disable` + `${process.env.NEXT_PUBLIC_API_URL}/equipo/disable`, + { headers }, ); setMachines(res.data); @@ -41,7 +47,8 @@ export default function MachineTable() { const fetchAreas = async () => { try { const res = await axios.get( - `${process.env.NEXT_PUBLIC_API_URL}/area-ubicacion` + `${process.env.NEXT_PUBLIC_API_URL}/area-ubicacion`, + { headers }, ); setAreas(res.data); @@ -63,8 +70,8 @@ export default function MachineTable() { selectedArea === "Todo" ? machines : machines.filter( - (machine) => machine.areaUbicacion.area === selectedArea, - ); + (machine) => machine.areaUbicacion.area === selectedArea, + ); return (
diff --git a/app/(private)/Monitor/MachineTableActive.tsx b/app/(private)/Monitor/MachineTableActive.tsx index 9120b7f..b2c1467 100644 --- a/app/(private)/Monitor/MachineTableActive.tsx +++ b/app/(private)/Monitor/MachineTableActive.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import styles from "./Page.module.css"; import axios from "axios"; +import Cookies from "js-cookie"; type AreaUbicacion = { id_area_ubicacion: number; @@ -24,10 +25,15 @@ export default function MachineTableActive() { const [selectedArea, setSelectedArea] = useState("Todo"); const [loading, setLoading] = useState(true); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const fetchMachines = async () => { try { + const res = await axios.get( - `${process.env.NEXT_PUBLIC_API_URL}/equipo/active` + `${process.env.NEXT_PUBLIC_API_URL}/equipo/active`, + { headers }, ); setMachines(res.data); @@ -41,7 +47,9 @@ export default function MachineTableActive() { const fetchAreas = async () => { try { const res = await axios.get( - `${process.env.NEXT_PUBLIC_API_URL}/area-ubicacion` + `${process.env.NEXT_PUBLIC_API_URL}/area-ubicacion`, + { headers }, + ); setAreas(res.data); diff --git a/app/(private)/Monitor/Page.module.css b/app/(private)/Monitor/Page.module.css index 29c8352..29e51fe 100644 --- a/app/(private)/Monitor/Page.module.css +++ b/app/(private)/Monitor/Page.module.css @@ -17,7 +17,7 @@ } .ocupado { - background-color: rgb(173, 233, 253); + background-color: #54bbfc !important; color: red; font-weight: bold; } diff --git a/app/(private)/Monitor/TableTable.tsx b/app/(private)/Monitor/TableTable.tsx new file mode 100644 index 0000000..6d1f7f7 --- /dev/null +++ b/app/(private)/Monitor/TableTable.tsx @@ -0,0 +1,66 @@ +"use client"; + +import { useEffect, useState } from "react"; +import styles from "./Page.module.css"; +import axios from "axios"; +import Cookies from "js-cookie"; + +type Mesa = { + id_mesa: number; + ocupado: number; +}; + +export default function TableTable() { + const [mesas, setMesas] = useState([]); + const [loading, setLoading] = useState(true); + + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + + const fetchMesas = async () => { + try { + const res = await axios.get( + `${process.env.NEXT_PUBLIC_API_URL}/mesa/uso`, + { headers }, + ); + + setMesas(res.data); + } catch (error) { + console.error("Error cargando mesas:", error); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + fetchMesas(); + }, []); + + if (loading) { + return

Cargando mesas...

; + } + + return ( +
+ + + + + + + + + + {mesas.map((mesa) => ( + + + + + ))} + +
ID MesaDisponible
{mesa.id_mesa} + {mesa.ocupado === 1 ? "No" : "Si"} +
+
+ ); +} \ No newline at end of file diff --git a/app/(private)/Monitor/page.tsx b/app/(private)/Monitor/page.tsx index 1810f66..83c06a5 100644 --- a/app/(private)/Monitor/page.tsx +++ b/app/(private)/Monitor/page.tsx @@ -1,20 +1,24 @@ -import Toggle from "@/app/Components/Global/Toggle/Toggle"; -import MachineTable from "./MachineTable"; import styles from "./Page.module.css"; import MachineTableActive from "./MachineTableActive"; import DSC from "./DSC"; import ToggleTable from "@/app/Components/Global/Toggle/ToggleTable"; +import TableTable from "./TableTable"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "Monitor", +}; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; key: string }>; }) { const params = await props.searchParams; const numAcount = params?.numAcount ?? null; - const key = params?.key ?? "active"; + const key = params?.key ?? "Equipos"; return (
-

MONITOR DE MÁQUINAS

+

MONITOR

@@ -23,8 +27,8 @@ export default async function Page(props: { defaultView={key} options={[ { - key: "active", - label: "Disponibles", + key: "Equipos", + label: "Equipos", content: ( <> @@ -32,11 +36,11 @@ export default async function Page(props: { ), }, { - key: "disable", - label: "No Disponibles", + key: "Mesas", + label: "Mesas", content: ( <> - + ), }, diff --git a/app/(private)/Periodo-Graficas/page.tsx b/app/(private)/Periodo-Graficas/page.tsx new file mode 100644 index 0000000..c2ccc1b --- /dev/null +++ b/app/(private)/Periodo-Graficas/page.tsx @@ -0,0 +1,147 @@ +"use client"; + +import { useState, useEffect } from "react"; +import { envConfig } from "@/app/lib/config"; +import axios from "axios"; +import Cookies from "js-cookie"; +import { Metadata } from "next"; + +interface TotalServicioPeriodo { + nombre_servicio: string; + periodo: string; + monto_total: number; +} + +interface Servicio { + id_servicio: number; + servicio: string; +} + +interface Periodo { + id_periodo: number; + semestre: string; +} + +export default function ReporteTotalesPage() { + const [totales, setTotales] = useState([]); + const [servicios, setServicios] = useState([]); + const [periodos, setPeriodos] = useState([]); + const [cargando, setCargando] = useState(true); + + const [periodoInicio, setPeriodoInicio] = useState(""); + const [periodoFin, setPeriodoFin] = useState(""); + const [servicioId, setServicioId] = useState(""); + + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + + useEffect(() => { + const fetchData = async () => { + try { + const [serviciosRes, periodosRes] = await Promise.all([ + axios.get(`${envConfig.apiUrl}/servicio`, { headers }), + axios.get(`${envConfig.apiUrl}/periodo`, { headers }), + ]); + setServicios(serviciosRes.data); + setPeriodos(periodosRes.data); + } catch (error) { + console.error("Error al cargar servicios o periodos", error); + } + }; + fetchData(); + }, []); + + const obtenerTotales = async () => { + setCargando(true); + try { + // Construir query params + const params = new URLSearchParams(); + if (periodoInicio) params.append("periodoInicio", periodoInicio); + if (periodoFin) params.append("periodoFin", periodoFin); + if (servicioId) params.append("servicioId", servicioId); + + const url = `${envConfig.apiUrl}/detalle-servicio/totales-por-periodo?${params.toString()}`; + const res = await axios.get(url, { headers }); + setTotales(res.data); + } catch (error) { + console.error("Error al obtener totales", error); + } finally { + setCargando(false); + } + }; + + const aplicarFiltros = () => { + obtenerTotales(); + }; + + return ( +
+

REPORTE DE TOTALES POR SERVICIO Y PERIODO

+ +
+ + + + + + + +
+ + {cargando ? ( +

Cargando...

+ ) : ( +
+ + + + + + + + + + {totales.map((item, index) => ( + + + + + + ))} + +
ServicioPeriodoMonto Total
{item.nombre_servicio}{item.periodo}${item.monto_total.toFixed(2)}
+
+ )} +
+ ); +} \ No newline at end of file diff --git a/app/(private)/Periodo/page.tsx b/app/(private)/Periodo/page.tsx index 1605a02..009df98 100644 --- a/app/(private)/Periodo/page.tsx +++ b/app/(private)/Periodo/page.tsx @@ -1,15 +1,20 @@ "use client"; import { useState, useEffect } from "react"; +import { envConfig } from "@/app/lib/config"; import axios from "axios"; import Cookies from "js-cookie"; +import { Metadata } from "next"; interface Periodo { id_periodo: number; semestre: string; fecha_inicio_servicio: string; fecha_fin_servicio: string; - activo: boolean; + activo: { + type: string; + data: number[]; + }; } export default function PeriodoPage() { @@ -21,7 +26,7 @@ export default function PeriodoPage() { const [modoEdicion, setModoEdicion] = useState(false); const [idEditar, setIdEditar] = useState(null); - const API = "http://localhost:5000/periodo"; + const API = `${envConfig.apiUrl}/periodo`; const token = Cookies.get("token"); const headers = { Authorization: `Bearer ${token}` }; @@ -39,10 +44,8 @@ export default function PeriodoPage() { obtenerPeriodos(); }, []); - // VALIDAR SEMESTRE const handleSemestreChange = (e: React.ChangeEvent) => { const valor = e.target.value; - if (/^\d{0,6}$/.test(valor)) { setSemestre(valor); @@ -74,16 +77,6 @@ export default function PeriodoPage() { } }; - - const eliminarPeriodo = async (id_periodo: number) => { - try { - await axios.delete(`${API}/${id_periodo}`, { headers }); - obtenerPeriodos(); - } catch (error) { - console.error("Error al eliminar periodo", error); - } - }; - const cargarPeriodo = (p: Periodo) => { setModoEdicion(true); setIdEditar(p.id_periodo); @@ -129,7 +122,6 @@ export default function PeriodoPage() {

PERIODO ESCOLAR

- {/* ================= FORMULARIO ================= */}
- {/* ================= TABLA ================= */}
@@ -203,7 +194,7 @@ export default function PeriodoPage() { - + ))} @@ -226,4 +210,5 @@ export default function PeriodoPage() { ); -} \ No newline at end of file +} +//IO \ No newline at end of file diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 3a91805..cab1438 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -1,10 +1,12 @@ "use client"; import { useState, useEffect } from "react"; -import styleprograms from "./programas.module.css"; import { envConfig } from "@/app/lib/config"; +import styleprograms from "./programas.module.css"; import axios from "axios"; import Swal from "sweetalert2"; +import Cookies from "js-cookie"; +import { Metadata } from "next"; interface Programa { id_programa: number; @@ -17,9 +19,13 @@ export default function Page() { const [programas, setProgramas] = useState([]); const [nombrePrograma, setNombrePrograma] = useState(""); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const cargarProgramas = async () => { try { - const response = await axios.get(`${envConfig.apiUrl}/programa/`); + const response = await axios.get(`${envConfig.apiUrl}/programa/`, { headers } + ); setProgramas(response.data); } catch (error: any) { console.error("Error al cargar programas:", error); @@ -41,7 +47,8 @@ export default function Page() { try { await axios.post(`${envConfig.apiUrl}/programa`, { programa: nombrePrograma, - }); + }, { headers } + ); await cargarProgramas(); @@ -63,13 +70,14 @@ export default function Page() { const handleGuardar = async () => { if (!programaSeleccionado) return; - try { + await axios.patch( `${envConfig.apiUrl}/programa/${programaSeleccionado}`, { programa: nombrePrograma, - } + }, + { headers }, ); await cargarProgramas(); @@ -107,7 +115,8 @@ export default function Page() { try { await axios.delete( - `${envConfig.apiUrl}/programa/${programaSeleccionado}` + `${envConfig.apiUrl}/programa/${programaSeleccionado}`, + { headers }, ); await cargarProgramas(); @@ -160,13 +169,6 @@ export default function Page() { > Nuevo - - )} @@ -193,6 +195,13 @@ export default function Page() { > Cancelar + + )} diff --git a/app/(private)/QuitarSancion/page.tsx b/app/(private)/QuitarSancion/page.tsx index be2c496..6be1d58 100644 --- a/app/(private)/QuitarSancion/page.tsx +++ b/app/(private)/QuitarSancion/page.tsx @@ -1,5 +1,10 @@ import ShowError from "@/app/Components/Global/ShowError"; import { GetSancionByStudent } from "@/app/lib/getSancionByStudent"; +import { Metadata } from "next"; + +export const metadata: Metadata = { + title: "QuitarSancion", +}; export default async function Page(props: { searchParams?: Promise<{ diff --git a/app/(private)/Reportes/page.tsx b/app/(private)/Reportes/page.tsx index b361760..06d8572 100644 --- a/app/(private)/Reportes/page.tsx +++ b/app/(private)/Reportes/page.tsx @@ -1,5 +1,10 @@ +import { Metadata } from 'next'; import ReportesClient from './ReportesClient'; +export const metadata: Metadata = { + title: "Reportes", +}; + export default async function Page(props: { searchParams?: Promise<{ key: string; diff --git a/app/(private)/layout.tsx b/app/(private)/layout.tsx index 289489c..7757bef 100644 --- a/app/(private)/layout.tsx +++ b/app/(private)/layout.tsx @@ -1,6 +1,7 @@ import { ReactNode } from "react"; import Logout from "../Components/auth/Logout/Logout"; -import BackgroundRotator from "../Components/layout/BackgroundRotator.tsx/BackgroundRotator"; +import BackgroundRotator from "../Components/layout/BackgroundRotator/BackgroundRotator"; + export default async function PrivateLayout({ children, }: { diff --git a/app/Components/ActivosMantenimiento/Areas.tsx b/app/Components/ActivosMantenimiento/Areas.tsx index 3ec051b..6e35eda 100644 --- a/app/Components/ActivosMantenimiento/Areas.tsx +++ b/app/Components/ActivosMantenimiento/Areas.tsx @@ -1,10 +1,12 @@ "use client"; import { useEffect, useState } from "react"; +import { envConfig } from "@/app/lib/config"; + +import axios from "axios"; +import Swal from "sweetalert2"; +import Cookies from "js-cookie"; import "@/app/globals.css"; -import axios from "axios"; -import { envConfig } from "@/app/lib/config"; -import Swal from "sweetalert2"; export default function Areas() { const [areas, setAreas] = useState([]); @@ -14,9 +16,15 @@ export default function Areas() { "Mantenimiento", ); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + + useEffect(() => { axios - .get(`${envConfig.apiUrl}/area-ubicacion`) + .get(`${envConfig.apiUrl}/area-ubicacion`, + { headers } + ) .then((data) => { setAreas(data.data); }) @@ -54,7 +62,7 @@ export default function Areas() { { id_area_ubicacion: Number(selectedArea), activo: modo === "Activo", - } + }, { headers } ); diff --git a/app/Components/ActivosMantenimiento/Equipos.tsx b/app/Components/ActivosMantenimiento/Equipos.tsx index c0c4191..200cd27 100644 --- a/app/Components/ActivosMantenimiento/Equipos.tsx +++ b/app/Components/ActivosMantenimiento/Equipos.tsx @@ -1,8 +1,9 @@ "use client"; import { envConfig } from "@/app/lib/config"; -import axios from "axios"; import { useEffect, useState } from "react"; +import axios from "axios"; +import Cookies from "js-cookie"; export default function Equipos() { const [cuenta, setCuenta] = useState(""); @@ -13,7 +14,12 @@ export default function Equipos() { useEffect(() => { const fetchEquipos = async () => { try { - const response = await axios.get(`${envConfig.apiUrl}/equipo`); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + + const response = await axios.get(`${envConfig.apiUrl}/equipo`, + { headers }, + ); setEquipos(response.data); } catch (error: any) { setMensaje( diff --git a/app/Components/ActivosMantenimiento/MesasDisponibles.tsx b/app/Components/ActivosMantenimiento/MesasDisponibles.tsx index 71c45e4..5be9934 100644 --- a/app/Components/ActivosMantenimiento/MesasDisponibles.tsx +++ b/app/Components/ActivosMantenimiento/MesasDisponibles.tsx @@ -1,9 +1,10 @@ "use client"; import { useEffect, useState } from "react"; -import axios from "axios"; import { envConfig } from "@/app/lib/config"; +import axios from "axios"; import Swal from "sweetalert2"; +import Cookies from "js-cookie"; interface Mesa { id_mesa: number; @@ -14,13 +15,16 @@ export default function MesasDisponibles() { const [mesas, setMesas] = useState(); const [loading, setLoading] = useState(true); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { obtenerMesas(); }, []); const obtenerMesas = async () => { try { - const response = await axios.get(`${envConfig.apiUrl}/mesa`); + const response = await axios.get(`${envConfig.apiUrl}/mesa`,{ headers }); setMesas(response.data); } catch (error) { console.error("Error al obtener mesas:", error); @@ -31,8 +35,11 @@ export default function MesasDisponibles() { const toggleEquipo = async (id_mesa: number) => { try { + await axios.patch( - `${envConfig.apiUrl}/mesa/${id_mesa}/activo` + `${envConfig.apiUrl}/mesa/${id_mesa}/activo`, + {}, + { headers }, ); setMesas((prev) => diff --git a/app/Components/Alta/registerAlta.tsx b/app/Components/Alta/registerAlta.tsx index 42fcbae..580aca6 100644 --- a/app/Components/Alta/registerAlta.tsx +++ b/app/Components/Alta/registerAlta.tsx @@ -72,22 +72,22 @@ export default function RegisterAlta(props: urlProp) { await apiClient.post("/student", payload); setSaved(true); - - Swal.fire({ - title: "Alumno registrado correctamente!", - icon: "success", - draggable: true, - }); - + + Swal.fire({ + title: "Alumno registrado correctamente!", + icon: "success", + draggable: true, + }); + } catch (error) { console.error("Error al guardar alumno:", error); - - Swal.fire({ - title: "Error al guardar alumno:!", - icon: "error", - draggable: true, - }); - + + Swal.fire({ + title: "Error al guardar alumno:!", + icon: "error", + draggable: true, + }); + } }; diff --git a/app/Components/AsignacionMesas.tsx b/app/Components/AsignacionMesas.tsx index db4c573..ad57293 100644 --- a/app/Components/AsignacionMesas.tsx +++ b/app/Components/AsignacionMesas.tsx @@ -6,6 +6,8 @@ import { getEquipoByCount } from "../lib/getEquipoByCount"; import { getMesaByCount } from "../lib/getMesaByCount"; import Swal from "sweetalert2"; import axios from "axios"; +import Cookies from "js-cookie"; +import { useRouter } from "next/navigation"; type Props = { inscripcion: any[]; @@ -21,6 +23,8 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) { const [bitacora, setBitacora] = useState<[] | null>([]); const [error, setError] = useState(); + const router = useRouter(); + const fetchByCuenta = async (idCuenta: number) => { const [result, resultMesa] = await Promise.all([ getEquipoByCount(idCuenta), @@ -33,19 +37,11 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) { setBitacora([]); if (!result?.error) { - setError("Equio") - Swal.fire({ - title: "Ya cuentas con un equipo asignado!", - icon: "error", - }); + setError("Equipo") } if (!resultMesa?.error) { setError("Mesa") - Swal.fire({ - title: "Ya cuentas con mesa asignada!", - icon: "error", - }); } } }; @@ -80,10 +76,14 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) { const fetchMesas = async () => { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + setLoadingMesas(true); const response = await axios.get( - `${envConfig.apiUrl}/mesa/activo` + `${envConfig.apiUrl}/mesa/activo`, + { headers }, ); setMesas(response.data); @@ -113,6 +113,9 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) { } try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const body = { tiempo_asignado: tiempo, id_mesa: Number(mesaSeleccionada), @@ -121,11 +124,12 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) { await axios.post( `${envConfig.apiUrl}/bitacora-mesa`, - body + body, + { headers }, ); setBitacora([]); - + router.refresh(); Swal.fire({ title: "Mesa asignada correctamente!", icon: "success", @@ -165,6 +169,8 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) { + + diff --git a/app/Components/BitacoraSanciones/ApplySanction.tsx b/app/Components/BitacoraSanciones/ApplySanction.tsx index 77e63c8..99c4c49 100644 --- a/app/Components/BitacoraSanciones/ApplySanction.tsx +++ b/app/Components/BitacoraSanciones/ApplySanction.tsx @@ -7,6 +7,7 @@ import { GetSancionByStudent } from "@/app/lib/getSancionByStudent"; import TableSanction from "./TableSanction"; import axios from "axios"; import Swal from "sweetalert2"; +import Cookies from "js-cookie"; if (!envConfig.apiUrl) { console.error("API URL is not defined in envConfig"); @@ -20,16 +21,19 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) { const [loading, setLoading] = useState(false); const [loadingTable, setLoadingTable] = useState(false); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const fetchAlumnoSanciones = async () => { - try { - const res = await GetSancionByStudent(idCuenta); + const res = await GetSancionByStudent(idCuenta); - setAlumno(res.student ?? null); - setAlumnoSanciones(res.alusancion ?? []); - } catch { - } finally { - setLoadingTable(true) + setAlumno(res.student ?? null); + setAlumnoSanciones(res.alusancion ?? []); + setLoadingTable(true) + + if (res.error) { + setLoadingTable(false) } }; @@ -39,7 +43,7 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) { fetchAlumnoSanciones(); axios - .get(`${envConfig.apiUrl}/sancion`) + .get(`${envConfig.apiUrl}/sancion`, { headers }) .then((res) => setSanciones(res.data)) .catch(() => @@ -56,7 +60,7 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) { e.preventDefault(); if (!selectedSancion) { - + Swal.fire({ title: "Selecciona una sanción!", icon: "error", @@ -71,18 +75,18 @@ export default function ApplySanction({ idCuenta }: { idCuenta: number }) { await axios.post(`${envConfig.apiUrl}/alumno-sancion/`, { id_sancion: Number(selectedSancion), id_cuenta: idCuenta, - }); + }, { headers }); await fetchAlumnoSanciones(); setSelectedSancion(""); - + Swal.fire({ title: "Sanción aplicada correctamente!", icon: "success", draggable: true }); } catch { - + Swal.fire({ title: "Error al aplicar la sanción!", icon: "error", diff --git a/app/Components/BitacoraSanciones/BitacoraAlumno.tsx b/app/Components/BitacoraSanciones/BitacoraAlumno.tsx index ea1880f..16addd8 100644 --- a/app/Components/BitacoraSanciones/BitacoraAlumno.tsx +++ b/app/Components/BitacoraSanciones/BitacoraAlumno.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import axios from "axios"; import { envConfig } from "@/app/lib/config"; +import Cookies from "js-cookie"; interface AlumnoBitacora { tiempo_entrada: string; @@ -20,6 +21,9 @@ interface BitacoraAlumnoProps { export default function BitacoraAlumno({ numAcount, date }: BitacoraAlumnoProps) { const [alumnos, setAlumnos] = useState([]); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { if (!numAcount) return; if (!date) return; @@ -27,7 +31,7 @@ export default function BitacoraAlumno({ numAcount, date }: BitacoraAlumnoProps) axios.post(`${envConfig.apiUrl}/bitacora/equipos-por-dia`, { numero_cuenta: numAcount, fecha: date, - }) + }, { headers }) .then(res => { setAlumnos(res.data); }) diff --git a/app/Components/BitacoraSanciones/BitacoraEquipo.tsx b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx index 2db2f4d..8885744 100644 --- a/app/Components/BitacoraSanciones/BitacoraEquipo.tsx +++ b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx @@ -1,11 +1,12 @@ "use client"; -import SearchDate from "../SearchDate/SearchDate"; import { useEffect, useState } from "react"; +import { envConfig } from "@/app/lib/config"; + +import SearchDate from "../SearchDate/SearchDate"; +import axios from "axios"; +import Cookies from "js-cookie"; import "../../(private)/AsignacionEquipo/asignacion.css" -import { envConfig } from "@/app/lib/config"; -import axios from "axios"; - interface equipos { hora_entrada: string; min_utilizados: number; @@ -20,10 +21,14 @@ export default function BitacoraEquipo({ date }: { date: string | null }) { const [equipoSeleccionado, setEquipoSeleccionado] = useState(null); const [equipos, setEquipos] = useState([]); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { const fetchData = async () => { setLoadingEquipos(true); - const response = await axios.get(`${envConfig.apiUrl}/equipo`); + const response = await axios.get(`${envConfig.apiUrl}/equipo`, { headers }, + ); setEquipos(response.data); setLoadingEquipos(false); }; @@ -38,7 +43,7 @@ export default function BitacoraEquipo({ date }: { date: string | null }) { axios.post(`${envConfig.apiUrl}/bitacora/equipos-por-equipo`, { id_equipo: equipoSeleccionado.id_equipo, fecha: date, - }) + }, { headers }) .then(res => { setEquipo(res.data); }) diff --git a/app/Components/BitacoraSanciones/BitacoraMesas.tsx b/app/Components/BitacoraSanciones/BitacoraMesas.tsx index e047be4..0692c43 100644 --- a/app/Components/BitacoraSanciones/BitacoraMesas.tsx +++ b/app/Components/BitacoraSanciones/BitacoraMesas.tsx @@ -1,10 +1,12 @@ "use client"; -import SearchDate from "../SearchDate/SearchDate"; import { useEffect, useState } from "react"; import { useSearchParams } from "next/navigation"; -import axios from "axios"; import { envConfig } from "@/app/lib/config"; +import SearchDate from "../SearchDate/SearchDate"; +import axios from "axios"; +import Cookies from "js-cookie"; + interface Tables { no_mesa: number; no_cuenta: number; @@ -18,12 +20,15 @@ export default function BitacoraMesas() { const searchParams = useSearchParams(); const date = searchParams.get("date"); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { if (!date) return; axios.post(`${envConfig.apiUrl}/bitacora-mesa/mesas-por-dia`, { fecha: date, - }) + }, { headers }) .then(res => { setTables(res.data); }) diff --git a/app/Components/CheckBoxEquipo.tsx b/app/Components/CheckBoxEquipo.tsx index b7486fa..aaf80ef 100644 --- a/app/Components/CheckBoxEquipo.tsx +++ b/app/Components/CheckBoxEquipo.tsx @@ -1,19 +1,25 @@ "use client"; + import { useEffect, useState } from "react"; import { envConfig } from "../lib/config"; - import { getEquipoByCount } from "../lib/getEquipoByCount"; import SearchUser from "./Global/SearchUser/searchUser"; import SearchEquipo from "./SearchEquipo"; import axios from "axios"; import Information from "./Global/Information/information"; import Swal from "sweetalert2"; +import Cookies from "js-cookie"; async function getEquipoId(idEquipo: number) { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const res = await axios.get( `${envConfig.apiUrl}/bitacora/equipo/${idEquipo}`, + { headers } ); + return res.data; } catch (error: any) { if (axios.isAxiosError(error)) { @@ -21,7 +27,6 @@ async function getEquipoId(idEquipo: number) { error: error.response?.data?.message || "Error al consultar equipo", }; } - return { error: "Error desconocido" }; } } @@ -32,20 +37,31 @@ interface Props { } export default function CheckBoxEquipo({ numAcount, machine }: Props) { - const [modo, setModo] = useState<"Equipo" | "Cuenta" | null>("Cuenta"); - const [bitacora, setBitacora] = useState(null); - const [tiempoRestante, setTiempoRestante] = useState(""); - const [minutos, setMinutos] = useState(); - const [error, setError] = useState() + const [modo, setModo] = useState<"Equipo" | "Cuenta">("Cuenta"); + + const [bitacoraCuenta, setBitacoraCuenta] = useState(null); + const [bitacoraEquipo, setBitacoraEquipo] = useState(null); + + const [tiempoRestante, setTiempoRestante] = useState(""); + const [minutos, setMinutos] = useState(0); + + const [errorCuenta, setErrorCuenta] = useState(null); + const [errorEquipo, setErrorEquipo] = useState(null); + + const [loading, setLoading] = useState(false); + + const bitacora = + modo === "Cuenta" ? bitacoraCuenta : bitacoraEquipo; const fetchByCuenta = async (idCuenta: number) => { const result = await getEquipoByCount(idCuenta); if (result?.error) { - setError(result.error); - setBitacora(null); + setErrorCuenta(result.error); + setBitacoraCuenta(null); } else { - setBitacora(result); + setErrorCuenta(null); + setBitacoraCuenta(result); } }; @@ -53,28 +69,27 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { const result = await getEquipoId(idEquipo); if (result?.error) { - setError(result.error); - setBitacora(null); + setErrorEquipo(result.error); + setBitacoraEquipo(null); } else { - setBitacora(result); + setErrorEquipo(null); + setBitacoraEquipo(result); } }; useEffect(() => { - if (!numAcount) return; - const idCuenta = parseInt(numAcount); - if (isNaN(idCuenta)) return; + if (modo !== "Cuenta" || !numAcount) return; - fetchByCuenta(idCuenta); - }, [numAcount]); + const idCuenta = parseInt(numAcount); + if (!isNaN(idCuenta)) fetchByCuenta(idCuenta); + }, [numAcount, modo]); useEffect(() => { - if (!machine) return; - const idEquipo = parseInt(machine); - if (isNaN(idEquipo)) return; + if (modo !== "Equipo" || !machine) return; - fetchByEquipo(idEquipo); - }, [machine]); + const idEquipo = parseInt(machine); + if (!isNaN(idEquipo)) fetchByEquipo(idEquipo); + }, [machine, modo]); useEffect(() => { if (!bitacora) return; @@ -82,19 +97,32 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { const entrada = new Date(bitacora.tiempo_entrada).getTime(); const asignadoMs = bitacora.tiempo_asignado * 60 * 1000; - const interval = setInterval(() => { + const updateTimer = () => { const ahora = Date.now(); const restante = entrada + asignadoMs - ahora; if (restante <= 0) { setTiempoRestante("agotado"); - clearInterval(interval); - } else { - const minutos = Math.floor(restante / 60000); - setMinutos(minutos + 1); - const segundos = Math.floor((restante % 60000) / 1000); - setTiempoRestante(`${minutos} minutos con ${segundos} segundos`); + setMinutos(0); + return false; } + + const minutosRestantes = Math.floor(restante / 60000); + const segundos = Math.floor((restante % 60000) / 1000); + + setMinutos(minutosRestantes + 1); + setTiempoRestante( + `${minutosRestantes} minuto(s) con ${segundos} segundo(s)` + ); + + return true; + }; + + updateTimer(); + + const interval = setInterval(() => { + const sigue = updateTimer(); + if (!sigue) clearInterval(interval); }, 1000); return () => clearInterval(interval); @@ -102,25 +130,42 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { const handleButton = async (e: React.MouseEvent) => { e.preventDefault(); + if (!bitacora) return; - await axios.patch( - `${envConfig.apiUrl}/bitacora/cancelar/${bitacora.id_bitacora}`, - { tiempo_asignado: minutos }, - ); + setLoading(true); + try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; - Swal.fire({ - title: "Tiempo cancelado Correctamente!", - icon: "success", - draggable: true, - }); + await axios.patch( + `${envConfig.apiUrl}/bitacora/cancelar/${bitacora.id_bitacora}`, + { tiempo_asignado: minutos }, + { headers } + ); - if (modo === "Cuenta" && numAcount) { - fetchByCuenta(parseInt(numAcount)); - } + Swal.fire({ + title: "Tiempo cancelado correctamente!", + icon: "success", + }); - if (modo === "Equipo" && machine) { - fetchByEquipo(parseInt(machine)); + if (modo === "Cuenta" && numAcount) { + fetchByCuenta(parseInt(numAcount)); + setBitacoraEquipo(null); + } + + if (modo === "Equipo" && machine) { + fetchByEquipo(parseInt(machine)); + setBitacoraCuenta(null); + + } + } catch (error) { + Swal.fire({ + title: "Error al cancelar tiempo", + icon: "error", + }); + } finally { + setLoading(false); } }; @@ -130,7 +175,6 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { + + + - {equipos.map((eq) => { + {filteredMachines.map((eq) => { const isActivo = eq.activo?.data?.[0] === 1; return ( @@ -84,7 +160,7 @@ export default function TableEquipos() { - +
{p.semestre} {p.fecha_inicio_servicio} {p.fecha_fin_servicio}{p.activo === true ? "Sí" : "No"}{p.activo.data[0] === 1 ? "Sí" : "No"} - -
Activo
+ + + + + +
{eq.plataforma?.nombre} {eq.areaUbicacion?.nombre || eq.id_area_ubicacion}{eq.areaUbicacion.area} ); } +//IO \ No newline at end of file diff --git a/app/Components/EviarMensaje/EnviarMensaje.tsx b/app/Components/EviarMensaje/EnviarMensaje.tsx index 3d5206c..d8ab174 100644 --- a/app/Components/EviarMensaje/EnviarMensaje.tsx +++ b/app/Components/EviarMensaje/EnviarMensaje.tsx @@ -1,8 +1,9 @@ "use client"; import { useEffect, useState } from "react"; -import axios from "axios"; import { envConfig } from "@/app/lib/config"; +import axios from "axios"; +import Cookies from "js-cookie"; import "../../(private)/AsignacionEquipo/asignacion.css"; @@ -39,14 +40,17 @@ const EnviarMensaje = ({ titulo }: EnviarMensajeProps) => { const [customMsg, setCustomMsg] = useState(""); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { const fetchData = async () => { try { setLoadingMensajes(true); const [equiposRes, mensajesRes] = await Promise.all([ - axios.get(`${envConfig.apiUrl}/equipo/busy`), - axios.get(`${envConfig.apiUrl}/mensaje`) + axios.get(`${envConfig.apiUrl}/equipo/busy`, { headers }), + axios.get(`${envConfig.apiUrl}/mensaje`, { headers }) ]); setEquipos(equiposRes.data); diff --git a/app/Components/EviarMensaje/EnviarMensajeSala.tsx b/app/Components/EviarMensaje/EnviarMensajeSala.tsx index 473c797..6bb5344 100644 --- a/app/Components/EviarMensaje/EnviarMensajeSala.tsx +++ b/app/Components/EviarMensaje/EnviarMensajeSala.tsx @@ -1,8 +1,9 @@ "use client"; import { useEffect, useState } from "react"; -import axios from "axios"; import { envConfig } from "@/app/lib/config"; +import axios from "axios"; +import Cookies from "js-cookie"; interface Area { id_area_ubicacion: number; @@ -20,10 +21,13 @@ const EnviarMensajeSala = ({ titulo }: EnviarMensajeSalaProps) => { const [mensaje, setMensaje] = useState(""); const [customMsg, setCustomMsg] = useState(""); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { const fetchSalas = async () => { try { - const response = await axios.get(`${envConfig.apiUrl}/area-ubicacion`); + const response = await axios.get(`${envConfig.apiUrl}/area-ubicacion`, { headers }); setSalas(response.data); } catch (error) { console.error("Error cargando salas:", error); @@ -45,7 +49,7 @@ const EnviarMensajeSala = ({ titulo }: EnviarMensajeSalaProps) => { return (
- +
- +
setInputValue(e.target.value)} diff --git a/app/Components/SelectAreas.tsx b/app/Components/SelectAreas.tsx index 49fe688..6f648b7 100644 --- a/app/Components/SelectAreas.tsx +++ b/app/Components/SelectAreas.tsx @@ -1,7 +1,8 @@ "use client"; -import axios from "axios"; import { useEffect, useState } from "react"; import { envConfig } from "../lib/config"; +import axios from "axios"; +import Cookies from "js-cookie"; if (!envConfig.apiUrl) { console.error("API URL is not defined in envConfig"); @@ -15,9 +16,14 @@ export default function SelectAreas(props: proms) { const [areas, setAreas] = useState([]); const [selectedArea, setSelectedArea] = useState(""); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + + useEffect(() => { axios - .get(`${envConfig.apiUrl}/area-ubicacion`) + .get(`${envConfig.apiUrl}/area-ubicacion`, { headers } + ) .then((data) => { setAreas(data.data); }) diff --git a/app/Components/Selection/Selection.css b/app/Components/Selection/Selection.css index a9feee6..d413537 100644 --- a/app/Components/Selection/Selection.css +++ b/app/Components/Selection/Selection.css @@ -15,6 +15,10 @@ } .buttonSelection { + display: flex; + align-items: center; + justify-content: center; + position: relative; width: 50px; height: 50px; border-radius: 100%; @@ -24,6 +28,13 @@ padding: 5px; } +.imageSelection { + width: 30px; + height: 30px; + position: relative; + object-fit: contain; +} + .buttonSelection:hover { transform: scale(1.1); background-color: #d0e1ff; @@ -41,3 +52,31 @@ color: #333; text-align: center; } + +@media(max-height:550px) { + .buttonLabel { + margin-top: 2px; + font-size: 1rem; + } +} + +@media(max-height:550px) { + .selection { + margin-bottom: 0rem; + gap: 2rem; + + } + + .buttonSelection { + width: 40px; + height: 40px; + padding: 0px; + } + + .imageSelection { + width: 20px; + height: 20px; + position: relative; + object-fit: contain; + } +} \ No newline at end of file diff --git a/app/Components/Selection/Selection.tsx b/app/Components/Selection/Selection.tsx index 88f73bc..98583ac 100644 --- a/app/Components/Selection/Selection.tsx +++ b/app/Components/Selection/Selection.tsx @@ -1,6 +1,7 @@ "use client"; import { useState } from "react"; +import Image from "next/image"; import "./Selection.css"; export default function Selection({ @@ -24,11 +25,11 @@ export default function Selection({ }, { name: "MACINTOSH", - img: "apple.png", + img: "/apple.png", }, { name: "PROFESORES", - img: "teacher.png", + img: "/teacher.png", }, ]; @@ -45,16 +46,16 @@ export default function Selection({ onClick={() => handleSelect(option.name)} > {option.name}
diff --git a/app/Components/Selection/SelectionCo.tsx b/app/Components/Selection/SelectionCo.tsx index ec31d01..5673f3f 100644 --- a/app/Components/Selection/SelectionCo.tsx +++ b/app/Components/Selection/SelectionCo.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import "./Selection.css"; +import Image from "next/image"; export default function SelectionCo({ plataformasInscritas = [], @@ -19,11 +20,11 @@ export default function SelectionCo({ }, { name: "MACINTOSH", - img: "apple.png", + img: "/apple.png", }, { name: "PROFESORES", - img: "teacher.png", + img: "/teacher.png", }, ]; @@ -46,16 +47,16 @@ export default function SelectionCo({ onClick={() => handleSelect(option.name)} > {option.name} diff --git a/app/Components/auth/Logout/Logout.css b/app/Components/auth/Logout/Logout.css index d60c6bd..ff46962 100644 --- a/app/Components/auth/Logout/Logout.css +++ b/app/Components/auth/Logout/Logout.css @@ -10,7 +10,7 @@ background-color: #d12020; } -.session{ +.session { position: absolute; top: 10px; right: 10px; @@ -19,11 +19,19 @@ gap: 2rem; } -.userName{ +.userName { background-color: white; border-radius: 6px; padding: 6px 12px; z-index: 1; + outline: 1px solid #cfcfcf; +} + +@media(max-height: 800px) { + .session { + top: 5px; + right: 5px; + } } @media (max-width: 800px) { @@ -57,16 +65,17 @@ transform: translate(0, -50%); } - .userName{ + .userName { position: absolute; top: 0px; right: 50px; } } -@media(max-width:450px){ - .userName{ + +@media(max-width:450px) { + .userName { position: absolute; top: 50px; right: 0px; } -} +} \ No newline at end of file diff --git a/app/Components/layout/BackgroundRotator.tsx/Background.css b/app/Components/layout/BackgroundRotator/Background.css similarity index 100% rename from app/Components/layout/BackgroundRotator.tsx/Background.css rename to app/Components/layout/BackgroundRotator/Background.css diff --git a/app/Components/layout/BackgroundRotator.tsx/BackgroundRotator.tsx b/app/Components/layout/BackgroundRotator/BackgroundRotator.tsx similarity index 100% rename from app/Components/layout/BackgroundRotator.tsx/BackgroundRotator.tsx rename to app/Components/layout/BackgroundRotator/BackgroundRotator.tsx diff --git a/app/Components/layout/BarNavigation/BarNavigation.css b/app/Components/layout/BarNavigation/BarNavigation.css index 0edffaa..088b3aa 100644 --- a/app/Components/layout/BarNavigation/BarNavigation.css +++ b/app/Components/layout/BarNavigation/BarNavigation.css @@ -24,7 +24,7 @@ transition: background-color 0.3s ease, border 0.3s ease; - font-size: 1.5rem; + font-size: 1.4rem; } .barNavigation li:hover { @@ -107,12 +107,12 @@ align-items: center; justify-content: center; color: #545454; - font-size: 1.5rem; + font-size: 1.4rem; padding: 1rem; } -.subMenu:hover > span, -.subMenu > a:hover > span { +.subMenu:hover>span, +.subMenu>a:hover>span { color: black; } @@ -129,7 +129,7 @@ color: white; width: 100%; height: 100%; - font-size: 1.5rem; + font-size: 1.4rem; } thead, @@ -137,6 +137,12 @@ tbody { font-size: 1.25rem; } +@media(max-height:550px) { + .barNavigation { + max-height: 35px; + } +} + @media (min-width: 1001px) { .subMenu:hover ul { opacity: 1; @@ -158,7 +164,7 @@ tbody { } .barNavigation { - font-size: 15px; + font-size: 1.4rem; justify-content: end; } @@ -166,6 +172,7 @@ tbody { position: absolute; top: 76px; left: 0; + top: 100%; width: 100%; background-color: #fff; flex-direction: column; @@ -235,13 +242,13 @@ tbody { transform: translateY(0); } - .subMenu.open ul a{ + .subMenu.open ul a { display: flex; - pointer-events:auto; + pointer-events: auto; } thead, tbody { font-size: 1rem; } -} +} \ No newline at end of file diff --git a/app/Components/layout/Header/Header.module.css b/app/Components/layout/Header/Header.module.css index 6ce8d21..74ad327 100644 --- a/app/Components/layout/Header/Header.module.css +++ b/app/Components/layout/Header/Header.module.css @@ -1,3 +1,9 @@ +.link { + display: flex; + align-items: center; + margin: 10px 5px; +} + .logo { position: relative; z-index: 3; @@ -86,15 +92,50 @@ max-height: 60%; } +@media (max-height: 550px) { + .containerBarNav { + max-height: 70%; + } + + .yellowPart { + height: 15px; + } + + .logoContainer { + min-width: 150px; + aspect-ratio: 250/70; + } + + .link { + display: flex; + align-items: center; + margin: 5px 2px; + } + + .header::after { + left: -60px; + min-width: 300px; + } + + .header::before { + left: -40px; + width: 10%; + min-width: 300px; + } + +} + @media (max-width: 800px) { .yellowPart { left: 0; background: #bd8c01; transform: skew(0deg); } + .header::after { left: -100px; } + .header::before { left: -80px; } @@ -105,11 +146,13 @@ min-width: 100%; transform: skew(25deg); } + .header::before { min-width: 100%; transform: skew(25deg); } + .containerBarNav { padding-left: 0; } -} +} \ No newline at end of file diff --git a/app/Components/layout/Header/Header.tsx b/app/Components/layout/Header/Header.tsx index 8f28717..0830bec 100644 --- a/app/Components/layout/Header/Header.tsx +++ b/app/Components/layout/Header/Header.tsx @@ -27,8 +27,7 @@ export default async function Header() {
-
-
+
+ diff --git a/app/globals.css b/app/globals.css index aa0985d..eea513f 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,5 +1,6 @@ * { color: #333333; + font-size: 1.4rem; } *, @@ -12,7 +13,7 @@ html { box-sizing: border-box; - font-size: 62.5%; + font-size: 62%; overflow-y: auto; scrollbar-width: none; } @@ -116,9 +117,10 @@ select { border: 1px solid #cfcfcf; background-color: #fff; border-radius: 4px; - font-size: 1.5rem; + font-size: 1.4rem; color: black; height: 3.5rem; + transition: all 0.2s ease-in-out; } input:focus, @@ -129,12 +131,18 @@ select:focus { transition: all 0.2s ease-in-out; } +input:disabled, +select:disabled { + background-color: #cfcfcf; + transition: all 0.2s ease-in-out; +} + select:-webkit-scrollbar { width: 6px; } option { - font-size: 1.5rem; + font-size: 1.4rem; } input[type="checkbox"] { @@ -215,17 +223,25 @@ input[type="checkbox"] { } label { - font-size: 1.5rem; + font-size: 1.4rem; font-weight: bold; display: block; } button { - font-size: 1.5rem; + font-size: 1.4rem; padding: 1rem 1.75rem; border-radius: 4px; cursor: pointer; height: 3.5rem; + max-width: 240px; + font-weight: bold; + border: none; + transition: background-color 0.2s ease; +} + +.button { + color: #ffffff; } button:disabled { @@ -243,12 +259,9 @@ button:disabled { width: 100%; } -.button { - font-weight: bold; - border: none; - color: #ffffff; - transition: background-color 0.2s ease; - max-width: 240px; +.total { + height: 35px; + flex-wrap: nowrap; } .buttonSearch { @@ -288,7 +301,7 @@ button:disabled { ul { list-style: none; - font-size: 1.5rem; + font-size: 1.4rem; } .containerInput { @@ -300,7 +313,7 @@ ul { .containerButton { display: flex; gap: 10px; - justify-content: start; + justify-content: end; align-items: center; width: 100%; } @@ -349,8 +362,13 @@ a { } .informationValue { - color: #555; - font-size: 1.25rem; + color: #000000; + font-size: 1.5rem; +} + +.Credito { + font-weight: bold; + font-size: 2rem; } .title { @@ -386,7 +404,7 @@ form { .toggleSection { width: 100%; max-width: fit-content; - min-width: 750px; + min-width: 600px; border-radius: 4px; background-color: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); @@ -416,6 +434,7 @@ form { padding: 1rem 0.5rem; min-width: 100px; min-height: 45px; + max-width: none; } .toggleButton.active { @@ -424,6 +443,7 @@ form { color: rgb(1, 92, 184); border-radius: 4px 4px 0 0; border-bottom: none; + box-shadow: 0px -8px 10px 3px #cfcfcf; } .toggleContent { @@ -432,7 +452,7 @@ form { } p { - font-size: 1.5rem; + font-size: 1.4rem; } table { @@ -441,7 +461,7 @@ table { border-spacing: 0 1rem; table-layout: auto; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 1.5rem; + font-size: 1.4rem; color: #333; } @@ -481,7 +501,7 @@ thead tr { background-color: #2563eb; position: relative; z-index: 1; -} +} tbody tr { transition: transform 0.3s ease, opacity 0.3s ease; @@ -539,12 +559,6 @@ table td:last-child { align-items: center; } -.impressions-title { - font-size: 1.75rem; - font-weight: bold; - text-align: start; -} - .loginContainer { position: relative; display: flex; @@ -569,7 +583,7 @@ table td:last-child { .checkbox-grid label { display: inline-flex; align-items: center; - font-size: 13px; + font-size: 1.4rem; cursor: pointer; } @@ -592,6 +606,7 @@ table td:last-child { .container { width: 100%; max-width: none; + padding: 1rem; } .containerSection { @@ -628,13 +643,9 @@ table td:last-child { font-size: 1.2rem; } - label { - font-size: 1.5rem; - } - input, select { - font-size: 1.5rem; + font-size: 1.4rem; } button { @@ -651,6 +662,98 @@ table td:last-child { } +@media(max-height:800px) { + * { + font-size: 1rem; + } + + .title { + font-size: 1.9rem; + } + + label { + font-size: 1.2rem; + } + + button { + font-size: 1.2rem; + padding: 0.5rem 1.5rem; + height: 3rem; + } + + .informationValue { + font-size: 1.01rem; + } + + .informationItem { + height: 25px; + } + + input, + select { + padding: 0.5rem; + height: 3rem; + } + + .containerForm { + gap: 0.5rem; + } + + .toggleGroup { + min-height: 30px; + } + + .toggleButton { + font-weight: 400; + padding: 1rem 0.5rem; + min-width: 100px; + min-height: 30px; + } + + .gap { + gap: 0.5rem; + } + + .information { + margin-top: 0.5rem; + } + + table { + border-spacing: 0 0.5rem; + font-size: 1.4rem; + } + + .container { + padding: 0.7rem; + } + + .total { + height: 30px; + } + + .information { + max-width: 320px; + + } + + .containerForm { + max-width: 320px; + } + + .Credito { + font-size: 1.5rem; + } + + table th, + table td { + padding: 0.65rem 1rem; + } + + .toggleSection { + min-width: 570px; + } +} + @media (max-height: 960px) { .container { margin: 0; @@ -667,7 +770,7 @@ table td:last-child { .title { max-width: 250px; overflow-wrap: break-word; - font-size: 2.2rem; + font-size: 2rem; min-height: 50px; align-items: center; } diff --git a/app/layout.tsx b/app/layout.tsx index 0b911a5..192e6b9 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,10 +9,16 @@ import "./globals.css"; const inter = Inter({ subsets: ["latin"], weight: ["400", "700"] }); export const metadata: Metadata = { - title: "Servicio AT", + title: { + default: "Servicio AT", + template: "Servicio AT | %s", + }, description: "Servicio de administracion de la FES Acatlan", authors: [{ name: "FES Acatlán" }], creator: "Lino,Carlos,Axel", + icons: { + icon: "/icon.svg", + }, }; export default function RootLayout({ @@ -23,9 +29,9 @@ export default function RootLayout({ return ( -
-
{children}
-