From ea83311f4d8471965303d61e36894c5fc3891d4b Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Mon, 23 Feb 2026 17:38:34 -0600 Subject: [PATCH 01/31] changed background color --- app/(private)/Monitor/Page.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } From ee4a4be907e786be658867af0de1d16113452b70 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 24 Feb 2026 11:53:29 -0600 Subject: [PATCH 02/31] fixed checkbox --- app/(private)/AsignacionMesas/page.tsx | 1 - app/(private)/Impresiones/page.tsx | 2 +- app/Components/CheckBoxEquipo.tsx | 8 ++++++-- app/Components/CheckBoxMesa.tsx | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 0cd3305..7563c92 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -20,7 +20,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[] = []; diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 221e05b..d40abda 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -7,11 +7,11 @@ import ShowError from "@/app/Components/Global/ShowError"; import { cookies } from "next/headers"; import { GetStudentWhitoutSancion } from "@/app/lib/getStudentWhitoutSancion"; +import { envConfig } from "@/app/lib/config"; import axios from "axios"; import "@/app/globals.css"; -import { envConfig } from "@/app/lib/config"; export default async function Page(props: { searchParams?: Promise<{ diff --git a/app/Components/CheckBoxEquipo.tsx b/app/Components/CheckBoxEquipo.tsx index b7486fa..e368098 100644 --- a/app/Components/CheckBoxEquipo.tsx +++ b/app/Components/CheckBoxEquipo.tsx @@ -37,6 +37,7 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { const [tiempoRestante, setTiempoRestante] = useState(""); const [minutos, setMinutos] = useState(); const [error, setError] = useState() + const [loading, setLoading] = useState(false) const fetchByCuenta = async (idCuenta: number) => { const result = await getEquipoByCount(idCuenta); @@ -102,6 +103,7 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { const handleButton = async (e: React.MouseEvent) => { e.preventDefault(); + setLoading(false) await axios.patch( `${envConfig.apiUrl}/bitacora/cancelar/${bitacora.id_bitacora}`, @@ -122,6 +124,7 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) { if (modo === "Equipo" && machine) { fetchByEquipo(parseInt(machine)); } + setLoading(true) }; return ( @@ -155,7 +158,7 @@ export default function CheckBoxEquipo({ numAcount, machine }: Props) {

{error}

- {bitacora && ( + {bitacora && tiempoRestante !== "agotado" && ( <> + diff --git a/app/Components/CheckBoxMesa.tsx b/app/Components/CheckBoxMesa.tsx index 8e6ba70..4ae7044 100644 --- a/app/Components/CheckBoxMesa.tsx +++ b/app/Components/CheckBoxMesa.tsx @@ -141,7 +141,7 @@ export default function CheckBoxMesa({ numAcount, table }: props) {

{error}

- {bitacora && ( + {bitacora && tiempoRestante !== "agotado" && ( <> + From 0d37fb3536f146092d2896f2bf908ef3866c69cb Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 24 Feb 2026 16:57:23 -0600 Subject: [PATCH 03/31] modified to construct the component impressions --- app/(private)/Impresiones/page.tsx | 3 ++- app/(private)/layout.tsx | 3 ++- app/Components/Impressions/impressions.tsx | 2 +- .../Background.css | 0 .../BackgroundRotator.tsx | 0 app/creadores/page.tsx | 7 ++++--- app/page.tsx | 2 +- tsconfig.json | 2 +- 8 files changed, 11 insertions(+), 8 deletions(-) rename app/Components/layout/{BackgroundRotator.tsx => BackgroundRotator}/Background.css (100%) rename app/Components/layout/{BackgroundRotator.tsx => BackgroundRotator}/BackgroundRotator.tsx (100%) diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index d40abda..7bbb6de 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -33,7 +33,6 @@ export default async function Page(props: { if (numAcount) { const result = await GetStudentWhitoutSancion(parseInt(numAcount)); - if (result.error) { errorMessage = `${result.error}`; } else { @@ -84,6 +83,7 @@ export default async function Page(props: { label: "Impresiones color", content: ( -
-
+
+ diff --git a/app/page.tsx b/app/page.tsx index a70edd3..fec76bf 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,5 +1,5 @@ import Login from "./Components/auth/Login/Login"; -import BackgroundRotator from "./Components/layout/BackgroundRotator.tsx/BackgroundRotator"; +import BackgroundRotator from "./Components/layout/BackgroundRotator/BackgroundRotator"; import { LoginRedirect } from "./Routes/LoginRedirect"; export default function Home() { diff --git a/tsconfig.json b/tsconfig.json index e7ff3a2..f7a0507 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -34,7 +34,7 @@ "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts" - ], +, "app/Components/layout/BackgroundRotator" ], "exclude": [ "node_modules" ] From 01eafd40388d004bd75c65873b3a05978e8f8a40 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 24 Feb 2026 17:24:48 -0600 Subject: [PATCH 04/31] modified restrictions to acept 0 in numAcount --- app/(private)/AgregarTiempo/Addtime.tsx | 2 +- app/Components/Impressions/impressions.tsx | 3 +-- app/Components/Receipt/Inscripcion.tsx | 4 ++-- app/Components/Receipt/Receipt.tsx | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/(private)/AgregarTiempo/Addtime.tsx b/app/(private)/AgregarTiempo/Addtime.tsx index 70f4b77..4cc302c 100644 --- a/app/(private)/AgregarTiempo/Addtime.tsx +++ b/app/(private)/AgregarTiempo/Addtime.tsx @@ -46,7 +46,7 @@ export default function AddTime({ 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/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index f41190d..7911ef4 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -21,7 +21,6 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) { const [cost, setCost] = useState(String(costs[0].value)); const router = useRouter(); - const handleLogout = () => { Cookies.remove("token"); Cookies.remove("session"); @@ -29,7 +28,7 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) { }; const handlePayment = async () => { - if (!numAcount) { + if (numAcount == null) { Swal.fire({ title: "busca de nuevo al estudiante!", diff --git a/app/Components/Receipt/Inscripcion.tsx b/app/Components/Receipt/Inscripcion.tsx index c7a0f67..6221a31 100644 --- a/app/Components/Receipt/Inscripcion.tsx +++ b/app/Components/Receipt/Inscripcion.tsx @@ -50,7 +50,7 @@ export default function Inscripcion({ //restrict this month// const handleSaveReceipt = async () => { - if (!numAcount) { + if (numAcount == null) { Swal.fire({ title: "busca de nuevo al estudiante!", @@ -143,7 +143,7 @@ export default function Inscripcion({ }; const handleInscripcionSinPago = async () => { - if (!numAcount) { + if (numAcount == null) { Swal.fire({ title: "busca de nuevo al estudiante!", diff --git a/app/Components/Receipt/Receipt.tsx b/app/Components/Receipt/Receipt.tsx index 897dcfe..24db703 100644 --- a/app/Components/Receipt/Receipt.tsx +++ b/app/Components/Receipt/Receipt.tsx @@ -31,7 +31,7 @@ export default function Receipt({ numAcount }: ReceiptsProps) { //restrict this month// const handleSaveReceipt = async () => { - if (!numAcount) { + if (numAcount == null) { Swal.fire({ title: "busca de nuevo al estudiante!", From edb2fd2664e76212331ba23271530e6ee92ba822 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 24 Feb 2026 18:29:42 -0600 Subject: [PATCH 05/31] added new image --- app/(private)/Inscripcion/inscripcion.css | 2 +- app/(private)/Programas/page.tsx | 14 +- app/Components/Alta/registerAlta.tsx | 28 +- app/Components/Global/table.module.css | 8 +- app/layout.tsx | 3 + public/icon.svg | 2035 +-------------------- 6 files changed, 65 insertions(+), 2025 deletions(-) diff --git a/app/(private)/Inscripcion/inscripcion.css b/app/(private)/Inscripcion/inscripcion.css index 325829e..ffc8754 100644 --- a/app/(private)/Inscripcion/inscripcion.css +++ b/app/(private)/Inscripcion/inscripcion.css @@ -24,7 +24,7 @@ } .restarPass{ - margin-top: 2rem; + margin-top: 3rem; height: fit-content; } diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 3a91805..995c47c 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -160,13 +160,6 @@ export default function Page() { > Nuevo - -
)} @@ -193,6 +186,13 @@ export default function Page() { > Cancelar + +
)} 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/Global/table.module.css b/app/Components/Global/table.module.css index 612ddf8..2cf2fda 100644 --- a/app/Components/Global/table.module.css +++ b/app/Components/Global/table.module.css @@ -1,5 +1,5 @@ .tableContainer { - margin-top: 1rem; + margin-top: 2rem; width: 100%; max-width: 450px; overflow-x: hidden; @@ -43,4 +43,10 @@ background-repeat: no-repeat; margin-right: 6px; vertical-align: middle; +} + +@media(max-width:800px) { + .tableContainer { + margin-top: 0px; + } } \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 0b911a5..20beab3 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -13,6 +13,9 @@ export const metadata: Metadata = { 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({ diff --git a/public/icon.svg b/public/icon.svg index 7c697cb..3a26ae8 100644 --- a/public/icon.svg +++ b/public/icon.svg @@ -1,2003 +1,34 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b0d186784fe0cf355357b651941a0cfb2700ba55 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 24 Feb 2026 18:47:23 -0600 Subject: [PATCH 06/31] added show table in monitor --- app/(private)/Monitor/TableTable.tsx | 61 ++++++++++++++++++++++++++++ app/(private)/Monitor/page.tsx | 13 +++--- 2 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 app/(private)/Monitor/TableTable.tsx diff --git a/app/(private)/Monitor/TableTable.tsx b/app/(private)/Monitor/TableTable.tsx new file mode 100644 index 0000000..adfb80b --- /dev/null +++ b/app/(private)/Monitor/TableTable.tsx @@ -0,0 +1,61 @@ +"use client"; + +import { useEffect, useState } from "react"; +import styles from "./Page.module.css"; +import axios from "axios"; + +type Mesa = { + id_mesa: number; + ocupado: number; +}; + +export default function TableTable() { + const [mesas, setMesas] = useState([]); + const [loading, setLoading] = useState(true); + + const fetchMesas = async () => { + try { + const res = await axios.get( + `${process.env.NEXT_PUBLIC_API_URL}/mesa/uso` + ); + + 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..a1fa022 100644 --- a/app/(private)/Monitor/page.tsx +++ b/app/(private)/Monitor/page.tsx @@ -4,6 +4,7 @@ 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"; export default async function Page(props: { searchParams?: Promise<{ numAcount: string; key: string }>; @@ -14,7 +15,7 @@ export default async function Page(props: { return (
-

MONITOR DE MÁQUINAS

+

MONITOR

@@ -23,8 +24,8 @@ export default async function Page(props: { defaultView={key} options={[ { - key: "active", - label: "Disponibles", + key: "Equipos", + label: "Equipos", content: ( <> @@ -32,11 +33,11 @@ export default async function Page(props: { ), }, { - key: "disable", - label: "No Disponibles", + key: "Mesas", + label: "Mesas", content: ( <> - + ), }, From b7aa2fa66b024282af375c3fa8004c4dd3a4ecb8 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Wed, 25 Feb 2026 19:27:04 -0600 Subject: [PATCH 07/31] tring to put token --- app/(private)/Impresiones/page.tsx | 35 +++++++++++++++++----- app/Components/Global/Toggle/Toggle.tsx | 12 ++++++-- app/Components/Impressions/impressions.tsx | 7 +++-- app/lib/apiClient.ts | 1 - app/lib/getCost.ts | 28 +++++++++++++++++ 5 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 app/lib/getCost.ts diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 7bbb6de..585faf0 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -6,10 +6,8 @@ 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 { envConfig } from "@/app/lib/config"; - -import axios from "axios"; import "@/app/globals.css"; @@ -40,9 +38,32 @@ 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; + console.log(`getCost`) + + const response = await getCost(); + costos = response; + } catch (error) { console.error("Error obteniendo costos:", error); } @@ -119,8 +140,8 @@ export default async function Page(props: { const optionsToUse = roleNumber === 5 ? options.filter( - (option) => option.key === "Recibo" || option.key === "B/N" - ) + (option) => option.key === "Recibo" || option.key === "B/N" + ) : options; return ( diff --git a/app/Components/Global/Toggle/Toggle.tsx b/app/Components/Global/Toggle/Toggle.tsx index 8183867..9684064 100644 --- a/app/Components/Global/Toggle/Toggle.tsx +++ b/app/Components/Global/Toggle/Toggle.tsx @@ -7,7 +7,7 @@ import { useState, ReactNode } from "react"; interface ToggleOption { key: string; label: string; - content: ReactNode; + content: ReactNode | (() => ReactNode); } interface ToggleProps { @@ -46,7 +46,15 @@ export default function Toggle({ options, defaultView }: ToggleProps) {
- {options.find((opt) => opt.key === view)?.content} + {(() => { + const active = options.find((opt) => opt.key === view)?.content; + + if (typeof active === "function") { + return active(); + } + + return active; + })()}
); diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 7911ef4..3ddeef3 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -19,6 +19,9 @@ interface ImpressionsProps { function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) { const [pages, setPages] = useState(""); const [cost, setCost] = useState(String(costs[0].value)); +console.log(id_servicio) +console.log(costs) + const total = Number(cost) * Number(pages); const router = useRouter(); const handleLogout = () => { @@ -61,7 +64,7 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) { const result = await PostImpressions({ id_cuenta: numAcount, numero_hojas: parseInt(pages), - monto: parseInt(cost) * parseInt(pages), + monto: total, id_servicio, }); @@ -134,7 +137,7 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) { diff --git a/app/lib/apiClient.ts b/app/lib/apiClient.ts index 648bbe8..319bee8 100644 --- a/app/lib/apiClient.ts +++ b/app/lib/apiClient.ts @@ -36,7 +36,6 @@ apiClient.interceptors.response.use( if (status === 401) { Cookies.remove("token"); Cookies.remove("user"); - } if (status === 403) { diff --git a/app/lib/getCost.ts b/app/lib/getCost.ts new file mode 100644 index 0000000..781aa32 --- /dev/null +++ b/app/lib/getCost.ts @@ -0,0 +1,28 @@ +import axios from "axios"; +import { envConfig } from "./config"; +import { cookies } from "next/headers"; + +if (!envConfig.apiUrl) { + console.error("API URL is not defined in envConfig"); +} + +export async function getCost() { + const cookieStore = cookies(); + const token = (await cookieStore).get("token")?.value; + + try { + const response = await axios.get(`${envConfig.apiUrl}/costo`, { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + return response.data; + } catch (error: any) { + const msg = + error.response?.data?.error || + error.message || + "Error desconocido al cobrar impresión"; + return { error: msg }; + } +} +//IO From c0cf9ecda0b9a9929751486339991c2981848a59 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 26 Feb 2026 09:22:39 -0600 Subject: [PATCH 08/31] i thing i fix the impressions --- app/(private)/Impresiones/page.tsx | 1 - app/Components/Impressions/impressions.tsx | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/(private)/Impresiones/page.tsx b/app/(private)/Impresiones/page.tsx index 585faf0..e7c50ec 100644 --- a/app/(private)/Impresiones/page.tsx +++ b/app/(private)/Impresiones/page.tsx @@ -59,7 +59,6 @@ export default async function Page(props: { } try { - console.log(`getCost`) const response = await getCost(); costos = response; diff --git a/app/Components/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index 3ddeef3..a122817 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -19,8 +19,7 @@ interface ImpressionsProps { function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) { const [pages, setPages] = useState(""); const [cost, setCost] = useState(String(costs[0].value)); -console.log(id_servicio) -console.log(costs) + const total = Number(cost) * Number(pages); const router = useRouter(); @@ -82,7 +81,7 @@ console.log(costs) } setPages(""); - setCost(""); + setCost(String(costs[0].value)); Swal.fire({ title: "Impresion cobrada correctamente!", From f19b0d1e11f2673ddf0ce59314e9edfb65955d14 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 26 Feb 2026 13:35:29 -0600 Subject: [PATCH 09/31] value = null --- app/Components/Global/SearchUser/searchUser.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Components/Global/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx index 3dc6881..6037328 100644 --- a/app/Components/Global/SearchUser/searchUser.tsx +++ b/app/Components/Global/SearchUser/searchUser.tsx @@ -8,7 +8,7 @@ interface urlProp { } function SearchUser(props: urlProp) { - const [numAcount, setnumAcount] = useState(""); + const [numAcount, setnumAcount] = useState(); const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); @@ -17,6 +17,10 @@ function SearchUser(props: urlProp) { if (props.value) { setnumAcount(props.value); } + + if(props.value===null){ + setnumAcount("") + } }, [props.value]); const handleSubmit = (e: React.FormEvent) => { From 80be76f4102880d76dab891a2812b04bf8f40604 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 26 Feb 2026 13:43:43 -0600 Subject: [PATCH 10/31] style --- app/globals.css | 1 + 1 file changed, 1 insertion(+) diff --git a/app/globals.css b/app/globals.css index 3efcefd..c8a0b9e 100644 --- a/app/globals.css +++ b/app/globals.css @@ -421,6 +421,7 @@ form { color: rgb(1, 92, 184); border-radius: 4px 4px 0 0; border-bottom: none; + box-shadow: 0px -8px 10px 3px #cfcfcf; } .toggleContent { From 08386f7ae5c8f1dc0354cab2fe4f15202e61aaf8 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 26 Feb 2026 13:52:47 -0600 Subject: [PATCH 11/31] fixed searchUser --- app/Components/Global/SearchUser/searchUser.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Components/Global/SearchUser/searchUser.tsx b/app/Components/Global/SearchUser/searchUser.tsx index 6037328..98630f9 100644 --- a/app/Components/Global/SearchUser/searchUser.tsx +++ b/app/Components/Global/SearchUser/searchUser.tsx @@ -8,7 +8,7 @@ interface urlProp { } function SearchUser(props: urlProp) { - const [numAcount, setnumAcount] = useState(); + const [numAcount, setnumAcount] = useState(""); const router = useRouter(); const pathname = usePathname(); const searchParams = useSearchParams(); From 0ddb17a23fb61867aac46220b3f2e0d82e08f082 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Thu, 26 Feb 2026 14:38:28 -0600 Subject: [PATCH 12/31] added new token --- app/Components/Receipt/Inscripcion.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Components/Receipt/Inscripcion.tsx b/app/Components/Receipt/Inscripcion.tsx index 6221a31..2e21227 100644 --- a/app/Components/Receipt/Inscripcion.tsx +++ b/app/Components/Receipt/Inscripcion.tsx @@ -166,13 +166,18 @@ export default function Inscripcion({ const id_plataforma = PLATAFORMA_MAP[plataformaSeleccionada]; try { + + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + await axios.post( `${envConfig.apiUrl}/alumno-inscrito`, { id_cuenta: numAcount, id_plataforma, realizo_pago: false, - } + }, + { headers }, ); Swal.fire({ From 1027bd0673d5d0867111e3ff7b350e862957d177 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Fri, 27 Feb 2026 11:27:52 -0600 Subject: [PATCH 13/31] added new headers and added table in asignation table --- app/(private)/ActivosMantenimiento/page.tsx | 3 - app/(private)/AgregarTiempo/Addtime.tsx | 1 + .../AsignacionEquipo/PlaticaGate.tsx | 10 ++- app/(private)/AsignacionMesas/page.tsx | 76 ++++++++++--------- .../InformacionEquipo/informacionequipo.css | 1 + app/(private)/Monitor/MachineTable.tsx | 7 +- app/(private)/Monitor/MachineTableActive.tsx | 12 ++- app/(private)/Monitor/TableTable.tsx | 7 +- app/(private)/Monitor/page.tsx | 2 +- app/(private)/Programas/page.tsx | 15 +++- .../ActivosMantenimiento/Equipos.tsx | 10 ++- .../ActivosMantenimiento/MesasDisponibles.tsx | 10 ++- app/Components/AsignacionMesas.tsx | 28 ++++--- .../BitacoraSanciones/BitacoraEquipo.tsx | 15 ++-- app/Components/CheckBoxEquipo.tsx | 8 +- app/Components/CheckBoxMesa.tsx | 10 +++ app/Components/Equipos/equipos.tsx | 30 +++++--- app/Components/Equipos/tableequipos.tsx | 18 ++++- .../InformacionEquipos/ProgramSelector.tsx | 35 ++++++--- .../InformacionEquipos/SelectorEquipo.tsx | 11 ++- .../InformacionEquipos/SelectorSala.tsx | 8 +- app/Components/Receipt/Inscripcion.tsx | 11 ++- app/Components/SearchMesa.tsx | 2 +- app/lib/getEquipoByCount.ts | 5 ++ app/lib/getMesaByCount.ts | 5 ++ app/lib/getTableByCount.ts | 5 ++ 26 files changed, 240 insertions(+), 105 deletions(-) diff --git a/app/(private)/ActivosMantenimiento/page.tsx b/app/(private)/ActivosMantenimiento/page.tsx index 66332ee..c4b3be3 100644 --- a/app/(private)/ActivosMantenimiento/page.tsx +++ b/app/(private)/ActivosMantenimiento/page.tsx @@ -6,13 +6,10 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle"; 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 4cc302c..cbd84da 100644 --- a/app/(private)/AgregarTiempo/Addtime.tsx +++ b/app/(private)/AgregarTiempo/Addtime.tsx @@ -8,6 +8,7 @@ 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 = { diff --git a/app/(private)/AsignacionEquipo/PlaticaGate.tsx b/app/(private)/AsignacionEquipo/PlaticaGate.tsx index e8fb0ae..861ca72 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[]; @@ -72,10 +74,14 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) { const fetchEquipos = async () => { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + setLoadingEquipos(true); const res = await axios.get( - `${envConfig.apiUrl}/equipo/student/${numAcount}` + `${envConfig.apiUrl}/equipo/student/${numAcount}`, + { headers }, ); setEquipos(res.data); diff --git a/app/(private)/AsignacionMesas/page.tsx b/app/(private)/AsignacionMesas/page.tsx index 7563c92..b884fb1 100644 --- a/app/(private)/AsignacionMesas/page.tsx +++ b/app/(private)/AsignacionMesas/page.tsx @@ -7,12 +7,13 @@ import Toggle from "@/app/Components/Global/Toggle/Toggle"; import { GetRegisterStudent } from "@/app/lib/getRegisterStudent"; import { GetRegisterStudentSancion } from "@/app/lib/GetRegisterStudentSancion"; +import TableTable from "../Monitor/TableTable"; export default async function Page(props: { searchParams?: Promise<{ key?: string; numAcount?: string; - table?:number + table?: number }>; }) { const params = await props.searchParams; @@ -39,7 +40,7 @@ export default async function Page(props: { ? Boolean(rawPlatica.data[0]) : Boolean(rawPlatica); } - + const inscResult = await GetRegisterStudent(idCuenta); if (!inscResult.error && Array.isArray(inscResult)) { @@ -55,41 +56,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)/InformacionEquipo/informacionequipo.css b/app/(private)/InformacionEquipo/informacionequipo.css index ca568ed..897a236 100644 --- a/app/(private)/InformacionEquipo/informacionequipo.css +++ b/app/(private)/InformacionEquipo/informacionequipo.css @@ -15,6 +15,7 @@ .form-container { gap: 10px; + margin-bottom: 1rem; } .form-container label { diff --git a/app/(private)/Monitor/MachineTable.tsx b/app/(private)/Monitor/MachineTable.tsx index aa95c39..6b75436 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; @@ -26,8 +27,12 @@ export default function MachineTable() { const fetchMachines = async () => { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + 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); 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/TableTable.tsx b/app/(private)/Monitor/TableTable.tsx index adfb80b..6d1f7f7 100644 --- a/app/(private)/Monitor/TableTable.tsx +++ b/app/(private)/Monitor/TableTable.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 Mesa = { id_mesa: number; @@ -13,10 +14,14 @@ 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` + `${process.env.NEXT_PUBLIC_API_URL}/mesa/uso`, + { headers }, ); setMesas(res.data); diff --git a/app/(private)/Monitor/page.tsx b/app/(private)/Monitor/page.tsx index a1fa022..80d7826 100644 --- a/app/(private)/Monitor/page.tsx +++ b/app/(private)/Monitor/page.tsx @@ -11,7 +11,7 @@ export default async function Page(props: { }) { const params = await props.searchParams; const numAcount = params?.numAcount ?? null; - const key = params?.key ?? "active"; + const key = params?.key ?? "Equipos"; return (
diff --git a/app/(private)/Programas/page.tsx b/app/(private)/Programas/page.tsx index 995c47c..3a1bd5c 100644 --- a/app/(private)/Programas/page.tsx +++ b/app/(private)/Programas/page.tsx @@ -1,10 +1,11 @@ "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"; interface Programa { id_programa: number; @@ -17,6 +18,9 @@ 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/`); @@ -63,13 +67,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 +112,9 @@ export default function Page() { try { await axios.delete( - `${envConfig.apiUrl}/programa/${programaSeleccionado}` + `${envConfig.apiUrl}/programa/${programaSeleccionado}`, + { headers }, + ); await cargarProgramas(); 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..8ae02f2 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,6 +15,9 @@ 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(); }, []); @@ -31,8 +35,10 @@ 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/AsignacionMesas.tsx b/app/Components/AsignacionMesas.tsx index db4c573..b8ecefd 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", diff --git a/app/Components/BitacoraSanciones/BitacoraEquipo.tsx b/app/Components/BitacoraSanciones/BitacoraEquipo.tsx index 2db2f4d..43d32e3 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; @@ -21,9 +22,13 @@ export default function BitacoraEquipo({ date }: { date: string | null }) { const [equipos, setEquipos] = useState([]); useEffect(() => { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + 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); }; diff --git a/app/Components/CheckBoxEquipo.tsx b/app/Components/CheckBoxEquipo.tsx index e368098..6a3f7d8 100644 --- a/app/Components/CheckBoxEquipo.tsx +++ b/app/Components/CheckBoxEquipo.tsx @@ -1,18 +1,24 @@ "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) { diff --git a/app/Components/CheckBoxMesa.tsx b/app/Components/CheckBoxMesa.tsx index 4ae7044..47b9231 100644 --- a/app/Components/CheckBoxMesa.tsx +++ b/app/Components/CheckBoxMesa.tsx @@ -4,11 +4,14 @@ import { useEffect, useState } from "react"; import { getTableByCount } from "../lib/getTableByCount"; import { envConfig } from "../lib/config"; import { getMesaByCount } from "../lib/getMesaByCount"; +import { useRouter } from "next/navigation"; + import SearchUser from "./Global/SearchUser/searchUser"; import Information from "./Global/Information/information"; import SearchMesa from "./SearchMesa"; import axios from "axios"; import Swal from "sweetalert2"; +import Cookies from "js-cookie"; interface props { numAcount: string | null; @@ -23,6 +26,8 @@ export default function CheckBoxMesa({ numAcount, table }: props) { const [error, setError] = useState() const [loading, setLoading] = useState(false) + const router = useRouter(); + const fetchByCuenta = async (idCuenta: number) => { const result = await getMesaByCount(idCuenta); @@ -89,9 +94,13 @@ export default function CheckBoxMesa({ numAcount, table }: props) { e.preventDefault(); setLoading(false) + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + await axios.patch( `${envConfig.apiUrl}/bitacora-mesa/cancelar/${bitacora.id_bitacora_mesa}`, { tiempo_asignado: minutos }, + { headers }, ); Swal.fire({ @@ -107,6 +116,7 @@ export default function CheckBoxMesa({ numAcount, table }: props) { if (modo === "Mesa" && table) { fetchByEquipo(table); } + router.refresh(); setLoading(true) }; diff --git a/app/Components/Equipos/equipos.tsx b/app/Components/Equipos/equipos.tsx index 8ba4d73..28985a7 100644 --- a/app/Components/Equipos/equipos.tsx +++ b/app/Components/Equipos/equipos.tsx @@ -1,8 +1,9 @@ "use client"; -import axios from "axios"; import { envConfig } from "@/app/lib/config"; import { useState } from "react"; import Swal from "sweetalert2"; +import axios from "axios"; +import Cookies from "js-cookie"; interface Data { nombre_equipo: string; @@ -44,11 +45,17 @@ export default function Equipos() { e.preventDefault(); try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const [equipoRes, plataformaRes, areaRes] = await Promise.all([ - axios.get(`${envConfig.apiUrl}/equipo/${id}`), - axios.get(`${envConfig.apiUrl}/alumno-inscrito/plataforma`), - axios.get(`${envConfig.apiUrl}/area-ubicacion`), + axios.get(`${envConfig.apiUrl}/equipo/${id}`, { headers }, + ), + axios.get(`${envConfig.apiUrl}/alumno-inscrito/plataforma`, { headers }, + ), + axios.get(`${envConfig.apiUrl}/area-ubicacion`, { headers }, + ), ]); const equipo = equipoRes.data as Data; @@ -277,13 +284,14 @@ export default function Equipos() { )} - + ); } +//IO \ No newline at end of file diff --git a/app/Components/Equipos/tableequipos.tsx b/app/Components/Equipos/tableequipos.tsx index 014250f..c5c8db3 100644 --- a/app/Components/Equipos/tableequipos.tsx +++ b/app/Components/Equipos/tableequipos.tsx @@ -3,17 +3,25 @@ import { envConfig } from "@/app/lib/config"; import { useEffect, useState } from "react"; -import "./tableEquipos.css"; import axios from "axios"; +import Cookies from "js-cookie"; + +import "./tableEquipos.css"; export default function TableEquipos() { const [equipos, setEquipos] = useState([]); const [loading, setLoading] = useState(true); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { + const fetchEquipos = async () => { try { - const response = await axios.get(`${envConfig.apiUrl}/equipo`); + const response = await axios.get(`${envConfig.apiUrl}/equipo`, + { headers }, + ); setEquipos(response.data); } catch (error: any) { console.error("ERROR API:", error.response?.data || error.message); @@ -28,7 +36,8 @@ export default function TableEquipos() { const toggleEquipo = async (id_equipo: number) => { try { await axios.patch( - `${envConfig.apiUrl}/equipo/${id_equipo}/activo` + `${envConfig.apiUrl}/equipo/${id_equipo}/activo`, + { headers }, ); setEquipos((prev) => @@ -84,7 +93,7 @@ export default function TableEquipos() { {eq.plataforma?.nombre} - {eq.areaUbicacion?.nombre || eq.id_area_ubicacion} + {eq.areaUbicacion?.area || eq.id_area_ubicacion} ); } +//IO \ No newline at end of file diff --git a/app/Components/InformacionEquipos/ProgramSelector.tsx b/app/Components/InformacionEquipos/ProgramSelector.tsx index ae8fd0c..9582c5e 100644 --- a/app/Components/InformacionEquipos/ProgramSelector.tsx +++ b/app/Components/InformacionEquipos/ProgramSelector.tsx @@ -3,6 +3,7 @@ import { envConfig } from "@/app/lib/config"; import axios from "axios"; import { useEffect, useState } from "react"; import Swal from "sweetalert2"; +import Cookies from "js-cookie"; interface Programa { id_programa: number; @@ -19,11 +20,14 @@ export default function ProgramSelector({ const [programas, setProgramas] = useState([]); const [checkboxes, setCheckboxes] = useState>({}); + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + useEffect(() => { const fetchData = async () => { const [programasRes] = await Promise.all([ - axios.get(`${envConfig.apiUrl}/programa`), - ]); + axios.get(`${envConfig.apiUrl}/programa`, { headers }, + )]); setProgramas(programasRes.data); @@ -58,9 +62,10 @@ export default function ProgramSelector({ { programas: programasSeleccionados, }, + { headers }, ); - + Swal.fire({ title: "Programas actualizados en la máquina!", icon: "success", @@ -70,12 +75,15 @@ export default function ProgramSelector({ } if (id) { - await axios.patch(`${envConfig.apiUrl}/programa-equipo/sala`, { - sala: id, - programas: programasSeleccionados, - }); + await axios.patch(`${envConfig.apiUrl}/programa-equipo/sala`, + { + sala: id, + programas: programasSeleccionados, + }, + { headers }, + ); + - Swal.fire({ title: "Programas actualizados en la sala", icon: "success", @@ -90,7 +98,7 @@ export default function ProgramSelector({ draggable: true }); } catch (error) { - + Swal.fire({ title: "Error al guardar cambios!", @@ -116,12 +124,15 @@ export default function ProgramSelector({ if (ubicacion && ubicacion !== "0") { res = await axios.get( `${envConfig.apiUrl}/programa-equipo/${ubicacion}`, + { headers }, ); } if (id) { res = await axios.get( `${envConfig.apiUrl}/area-ubicacion/programs/${id}`, + { headers }, + ); } @@ -131,14 +142,14 @@ export default function ProgramSelector({ } catch (error: any) { if (axios.isAxiosError(error)) { if (error.response?.status === 404) { - + Swal.fire({ title: "Sin programas asignados!", icon: "error", draggable: true }); } else { - + Swal.fire({ title: "Error al cargar programas!", icon: "error", @@ -147,7 +158,7 @@ export default function ProgramSelector({ } } else { - + Swal.fire({ title: "Error inesperado!", icon: "error", diff --git a/app/Components/InformacionEquipos/SelectorEquipo.tsx b/app/Components/InformacionEquipos/SelectorEquipo.tsx index 0f0840a..9560903 100644 --- a/app/Components/InformacionEquipos/SelectorEquipo.tsx +++ b/app/Components/InformacionEquipos/SelectorEquipo.tsx @@ -1,8 +1,10 @@ "use client"; + import { envConfig } from "@/app/lib/config"; import { usePathname, useRouter, useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; import axios from "axios"; +import Cookies from "js-cookie"; import "../../(private)/AsignacionEquipo/asignacion.css"; @@ -33,10 +35,15 @@ export default function SelectorEquipo({ onSearch }: Props) { const [loadingEquipos, setLoadingEquipos] = useState(false); const [open, setOpen] = useState(false); + + 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); }; @@ -85,7 +92,7 @@ export default function SelectorEquipo({ onSearch }: Props) { {open && ( -
+
{equipos.length === 0 && (
No hay equipos disponibles diff --git a/app/Components/InformacionEquipos/SelectorSala.tsx b/app/Components/InformacionEquipos/SelectorSala.tsx index 1c482f2..590d183 100644 --- a/app/Components/InformacionEquipos/SelectorSala.tsx +++ b/app/Components/InformacionEquipos/SelectorSala.tsx @@ -3,6 +3,7 @@ import { envConfig } from "@/app/lib/config"; import { useEffect, useState } from "react"; import { usePathname, useRouter, useSearchParams } from "next/navigation"; import axios from "axios"; +import Cookies from "js-cookie"; interface Area { id_area_ubicacion: number; @@ -45,8 +46,13 @@ export default function SelectorSala({ onSearch }: Props) { }; useEffect(() => { + + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const fetchData = async () => { - const response = await axios.get(`${envConfig.apiUrl}/area-ubicacion`); + const response = await axios.get(`${envConfig.apiUrl}/area-ubicacion`, { headers }, + ); setSala(response.data); }; diff --git a/app/Components/Receipt/Inscripcion.tsx b/app/Components/Receipt/Inscripcion.tsx index 2e21227..da2be87 100644 --- a/app/Components/Receipt/Inscripcion.tsx +++ b/app/Components/Receipt/Inscripcion.tsx @@ -1,14 +1,14 @@ "use client"; import { useState } from "react"; -import { useRouter } from "next/navigation"; +import { usePathname, useRouter, useSearchParams } from "next/navigation"; import { envConfig } from "@/app/lib/config"; import Selection from "../Selection/Selection"; import Cookies from "js-cookie"; import axios from "axios"; - import Swal from "sweetalert2"; + import "./Receipt.css"; interface ReceiptsProps { @@ -32,6 +32,8 @@ export default function Inscripcion({ >(null); const router = useRouter(); + const pathname = usePathname(); + const searchParams = useSearchParams(); const [folio, setFolio] = useState(""); const [amount, setAmount] = useState(""); @@ -128,7 +130,10 @@ export default function Inscripcion({ setAmount(""); setDate(todayISO); - router.refresh(); + const params = new URLSearchParams(searchParams.toString()); + params.delete("numAcount"); + router.push(`${pathname}?${params.toString()}`); + } catch (error: any) { const msg = error.response?.data?.message || diff --git a/app/Components/SearchMesa.tsx b/app/Components/SearchMesa.tsx index bfb9df1..e711893 100644 --- a/app/Components/SearchMesa.tsx +++ b/app/Components/SearchMesa.tsx @@ -26,7 +26,7 @@ export default function SearchMesa() {
setInputValue(e.target.value)} diff --git a/app/lib/getEquipoByCount.ts b/app/lib/getEquipoByCount.ts index a041689..5d442c9 100644 --- a/app/lib/getEquipoByCount.ts +++ b/app/lib/getEquipoByCount.ts @@ -1,10 +1,15 @@ import axios from "axios"; import { envConfig } from "./config"; +import Cookies from "js-cookie"; export async function getEquipoByCount(idCuenta: number) { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const res = await axios.get( `${envConfig.apiUrl}/bitacora/cuenta/${idCuenta}`, + { headers }, ); return res.data; } catch (error: any) { diff --git a/app/lib/getMesaByCount.ts b/app/lib/getMesaByCount.ts index a4785e5..1e12b72 100644 --- a/app/lib/getMesaByCount.ts +++ b/app/lib/getMesaByCount.ts @@ -1,10 +1,15 @@ import axios from "axios"; import { envConfig } from "./config"; +import Cookies from "js-cookie"; export async function getMesaByCount(idCuenta: number) { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const res = await axios.get( `${envConfig.apiUrl}/bitacora-mesa/cuenta/${idCuenta}`, + { headers }, ); return res.data; } catch (error: any) { diff --git a/app/lib/getTableByCount.ts b/app/lib/getTableByCount.ts index cd185a9..ccc44dd 100644 --- a/app/lib/getTableByCount.ts +++ b/app/lib/getTableByCount.ts @@ -1,10 +1,15 @@ import axios from "axios"; import { envConfig } from "./config"; +import Cookies from "js-cookie"; export async function getTableByCount(idCuenta: number) { try { + const token = Cookies.get("token"); + const headers = { Authorization: `Bearer ${token}` }; + const res = await axios.get( `${envConfig.apiUrl}/bitacora-mesa/table/${idCuenta}`, + { headers }, ); return res.data; } catch (error: any) { From c2aba808ada3179a8c80f776df5fbb6f56110a95 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Fri, 27 Feb 2026 18:11:03 -0600 Subject: [PATCH 14/31] new style now ist more little --- .../ActivosMantenimiento/Page.module.css | 2 +- app/(private)/AgregarTiempo/addTime.css | 14 ++- app/(private)/AsignacionEquipo/asignacion.css | 2 +- .../InformacionEquipo/informacionequipo.css | 6 +- app/(private)/Mensajes/mensaje.css | 8 +- app/Components/CheckBoxMesa.tsx | 30 +++-- app/Components/Dowload/style.module.css | 2 +- app/Components/Receipt/Receipt.css | 8 +- app/Components/auth/Logout/Logout.css | 7 ++ .../layout/BarNavigation/BarNavigation.css | 18 +-- app/globals.css | 103 +++++++++++++----- 11 files changed, 136 insertions(+), 64 deletions(-) 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)/AgregarTiempo/addTime.css b/app/(private)/AgregarTiempo/addTime.css index aaf7820..360fb5f 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; background-color: #8cd32f; } -.buttonOpenLock:hover{ +.buttonOpenLock:hover { background-color: #78b32c; } @@ -63,6 +63,12 @@ background-repeat: no-repeat; } +@media(max-height:800px) { + .buttonLock { + padding: 0.5rem; + } +} + @media (max-width: 800px) { .containeInformationTime { flex-direction: column; 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)/InformacionEquipo/informacionequipo.css b/app/(private)/InformacionEquipo/informacionequipo.css index 897a236..eb43c8b 100644 --- a/app/(private)/InformacionEquipo/informacionequipo.css +++ b/app/(private)/InformacionEquipo/informacionequipo.css @@ -19,13 +19,13 @@ } .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; @@ -58,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)/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/Components/CheckBoxMesa.tsx b/app/Components/CheckBoxMesa.tsx index 47b9231..0cbb602 100644 --- a/app/Components/CheckBoxMesa.tsx +++ b/app/Components/CheckBoxMesa.tsx @@ -23,7 +23,8 @@ export default function CheckBoxMesa({ numAcount, table }: props) { const [bitacora, setBitacora] = useState(null); const [tiempoRestante, setTiempoRestante] = useState(""); const [minutos, setMinutos] = useState(); - const [error, setError] = useState() + const [errorMesa, setErrorMesa] = useState() + const [errorCount, setErrorCount] = useState() const [loading, setLoading] = useState(false) const router = useRouter(); @@ -32,18 +33,18 @@ export default function CheckBoxMesa({ numAcount, table }: props) { const result = await getMesaByCount(idCuenta); if (result?.error) { - setError(result.error); + setErrorCount(result.error); setBitacora(null); } else { setBitacora(result); } }; - const fetchByEquipo = async (idEquipo: number) => { + const fetchByMesa = async (idEquipo: number) => { const result = await getTableByCount(idEquipo); if (result?.error) { - setError(result.error); + setErrorMesa(result.error); setBitacora(null); } else { setBitacora(result); @@ -63,7 +64,7 @@ export default function CheckBoxMesa({ numAcount, table }: props) { const idEquipo = table; if (isNaN(idEquipo)) return; - fetchByEquipo(idEquipo); + fetchByMesa(idEquipo); }, [table]); useEffect(() => { @@ -114,8 +115,9 @@ export default function CheckBoxMesa({ numAcount, table }: props) { } if (modo === "Mesa" && table) { - fetchByEquipo(table); + fetchByMesa(table); } + router.refresh(); setLoading(true) }; @@ -146,10 +148,18 @@ export default function CheckBoxMesa({ numAcount, table }: props) {
- {modo === "Cuenta" && } - {modo === "Mesa" && } - -

{error}

+ {modo === "Cuenta" && + <> + +

{errorCount}

+ + } + {modo === "Mesa" && + <> + +

{errorMesa}

+ + } {bitacora && tiempoRestante !== "agotado" && ( <> diff --git a/app/Components/Dowload/style.module.css b/app/Components/Dowload/style.module.css index 936347b..08e97ae 100644 --- a/app/Components/Dowload/style.module.css +++ b/app/Components/Dowload/style.module.css @@ -12,7 +12,7 @@ padding: 5px 5px; cursor: pointer; border-radius: 10px 10px 0 0; - font-size: 14px; + font-size: 1.4rem; font-weight: 600; transition: background 0.2s ease; min-width: 50px; diff --git a/app/Components/Receipt/Receipt.css b/app/Components/Receipt/Receipt.css index 037aa26..c2dc3c5 100644 --- a/app/Components/Receipt/Receipt.css +++ b/app/Components/Receipt/Receipt.css @@ -26,7 +26,7 @@ .buttonLock{ padding: 0.8rem; position: absolute; - right: 0; + right: 100px; background-color: #d32f2f; } @@ -61,4 +61,10 @@ filter: invert(1); background-size: contain; background-repeat: no-repeat; +} + +@media(max-height:800px) { + .buttonLock { + padding: 0.5rem; + } } \ No newline at end of file diff --git a/app/Components/auth/Logout/Logout.css b/app/Components/auth/Logout/Logout.css index d60c6bd..1b88a30 100644 --- a/app/Components/auth/Logout/Logout.css +++ b/app/Components/auth/Logout/Logout.css @@ -26,6 +26,13 @@ z-index: 1; } +@media(max-width: 1000px){ + .session{ + top: 5px; + right: 5px; +} +} + @media (max-width: 800px) { .button-logout { color: transparent; diff --git a/app/Components/layout/BarNavigation/BarNavigation.css b/app/Components/layout/BarNavigation/BarNavigation.css index 0edffaa..482a5f2 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, @@ -158,7 +158,7 @@ tbody { } .barNavigation { - font-size: 15px; + font-size: 1.4rem; justify-content: end; } @@ -235,13 +235,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/globals.css b/app/globals.css index c8a0b9e..472672a 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,7 +117,7 @@ select { border: 1px solid #cfcfcf; background-color: #fff; border-radius: 4px; - font-size: 1.5rem; + font-size: 1.4rem; color: black; height: 3.5rem; } @@ -134,7 +135,7 @@ select:-webkit-scrollbar { } option { - font-size: 1.5rem; + font-size: 1.4rem; } input[type="checkbox"] { @@ -215,17 +216,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,14 +252,6 @@ button:disabled { width: 100%; } -.button { - font-weight: bold; - border: none; - color: #ffffff; - transition: background-color 0.2s ease; - max-width: 240px; -} - .buttonSearch { background-color: #2563eb; } @@ -285,7 +286,7 @@ button:disabled { ul { list-style: none; - font-size: 1.5rem; + font-size: 1.4rem; } .containerInput { @@ -297,7 +298,7 @@ ul { .containerButton { display: flex; gap: 10px; - justify-content: start; + justify-content: end; align-items: center; width: 100%; } @@ -430,7 +431,7 @@ form { } p { - font-size: 1.5rem; + font-size: 1.4rem; } table { @@ -439,7 +440,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; } @@ -537,12 +538,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; @@ -567,7 +562,7 @@ table td:last-child { .checkbox-grid label { display: inline-flex; align-items: center; - font-size: 13px; + font-size: 1.4rem; cursor: pointer; } @@ -590,6 +585,7 @@ table td:last-child { .container { width: 100%; max-width: none; + padding: 1rem; } .containerSection { @@ -626,13 +622,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 { @@ -649,6 +641,57 @@ table td:last-child { } +@media(max-height:800px) { + * { + font-size: 1rem; + } + + .title { + font-size: 2rem; + } + + label { + font-size: 1.2rem; + } + + button { + font-size: 1.2rem; + padding: 0.5rem 1.5rem; + height: 3rem; + } + + .informationValue { + font-size: 1rem; + } + + .informationItem { + height: 25px; + } + + input, + select { + padding: 0.5rem; + font-size: 1.3rem; + height: 3rem; + } + + .containerForm { + gap: 0.5rem; + } + + .toggleGroup { + min-height: 35px; + } + + +.toggleButton { + font-weight: 400; + padding: 1rem 0.5rem; + min-width: 100px; + min-height: 35px; +} +} + @media (max-height: 960px) { .container { margin: 0; @@ -665,7 +708,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; } From 805f4835a38a07723044e12948dc8af2f99e9da2 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Fri, 27 Feb 2026 19:15:56 -0600 Subject: [PATCH 15/31] git added new style , little style --- app/(private)/AgregarTiempo/addTime.css | 7 +++ app/(private)/Inscripcion/inscripcion.css | 16 ++++++- app/Components/Global/table.module.css | 5 +++ app/Components/Selection/Selection.css | 39 ++++++++++++++++ app/Components/Selection/Selection.tsx | 23 +++++----- app/Components/Selection/SelectionCo.tsx | 19 ++++---- app/Components/auth/Logout/Logout.css | 23 +++++----- .../layout/BarNavigation/BarNavigation.css | 7 +++ .../layout/Header/Header.module.css | 45 ++++++++++++++++++- app/Components/layout/Header/Header.tsx | 3 +- app/globals.css | 33 +++++++++++--- 11 files changed, 177 insertions(+), 43 deletions(-) diff --git a/app/(private)/AgregarTiempo/addTime.css b/app/(private)/AgregarTiempo/addTime.css index 360fb5f..9e09a4e 100644 --- a/app/(private)/AgregarTiempo/addTime.css +++ b/app/(private)/AgregarTiempo/addTime.css @@ -63,6 +63,13 @@ background-repeat: no-repeat; } +@media(max-height:550px) { + .addTime { + margin-top: 0.5rem; + padding: 0.5rem; + } +} + @media(max-height:800px) { .buttonLock { padding: 0.5rem; diff --git a/app/(private)/Inscripcion/inscripcion.css b/app/(private)/Inscripcion/inscripcion.css index ffc8754..06df7a0 100644 --- a/app/(private)/Inscripcion/inscripcion.css +++ b/app/(private)/Inscripcion/inscripcion.css @@ -23,18 +23,30 @@ max-width: 450px; } -.restarPass{ +.restarPass { margin-top: 3rem; height: fit-content; } +@media(max-height:550px) { + .inscripcion { + 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/Components/Global/table.module.css b/app/Components/Global/table.module.css index 2cf2fda..b90bb5d 100644 --- a/app/Components/Global/table.module.css +++ b/app/Components/Global/table.module.css @@ -44,6 +44,11 @@ margin-right: 6px; vertical-align: middle; } +@media(max-height:550px) { + .tableContainer { + margin-top: 1.5rem; + } +} @media(max-width:800px) { .tableContainer { 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..da378c1 100644 --- a/app/Components/Selection/Selection.tsx +++ b/app/Components/Selection/Selection.tsx @@ -2,6 +2,7 @@ import { useState } from "react"; import "./Selection.css"; +import Image from "next/image"; export default function Selection({ plataformasInscritas = [], @@ -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..7e642e1 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 = [], @@ -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 1b88a30..9177852 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,18 +19,18 @@ gap: 2rem; } -.userName{ +.userName { background-color: white; border-radius: 6px; padding: 6px 12px; z-index: 1; } -@media(max-width: 1000px){ - .session{ - top: 5px; - right: 5px; -} +@media(max-height: 550px) { + .session { + top: 5px; + right: 5px; + } } @media (max-width: 800px) { @@ -64,16 +64,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/BarNavigation/BarNavigation.css b/app/Components/layout/BarNavigation/BarNavigation.css index 482a5f2..72fedfe 100644 --- a/app/Components/layout/BarNavigation/BarNavigation.css +++ b/app/Components/layout/BarNavigation/BarNavigation.css @@ -137,6 +137,13 @@ tbody { font-size: 1.25rem; } +@media(max-height:550px) { + .barNavigation { + height: 25px; + max-height: 35px; + } +} + @media (min-width: 1001px) { .subMenu:hover ul { opacity: 1; 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() {
Date: Fri, 27 Feb 2026 19:52:23 -0600 Subject: [PATCH 16/31] added more headers --- app/(private)/AgregarTiempo/Addtime.tsx | 2 +- app/Components/BitacoraSanciones/ApplySanction.tsx | 14 +++++++++----- app/Components/Impressions/impressions.tsx | 3 +-- app/Components/QuitarSancion/QuitarSancion.tsx | 14 ++++++++++---- .../layout/BarNavigation/BarNavigation.css | 1 - app/globals.css | 14 +++++++++++--- app/lib/getSancionByStudent.ts | 6 +++++- 7 files changed, 37 insertions(+), 17 deletions(-) diff --git a/app/(private)/AgregarTiempo/Addtime.tsx b/app/(private)/AgregarTiempo/Addtime.tsx index cbd84da..95d96c7 100644 --- a/app/(private)/AgregarTiempo/Addtime.tsx +++ b/app/(private)/AgregarTiempo/Addtime.tsx @@ -2,10 +2,10 @@ 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"; diff --git a/app/Components/BitacoraSanciones/ApplySanction.tsx b/app/Components/BitacoraSanciones/ApplySanction.tsx index 77e63c8..0aed87a 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,6 +21,9 @@ 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 { @@ -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/Impressions/impressions.tsx b/app/Components/Impressions/impressions.tsx index a122817..bae824e 100644 --- a/app/Components/Impressions/impressions.tsx +++ b/app/Components/Impressions/impressions.tsx @@ -129,8 +129,7 @@ function Impressions({ costs, numAcount, id_servicio }: ImpressionsProps) {