feat: categorias de integracion (pagina-web/sam/profesores/otras-apps) + badge prod/dev

This commit is contained in:
Nurfog committed 2026-09-08 16:29:01 -03:00
1 parent 3787152ca0
commit 66ed027043
3 files changed
+59 -19

No files matched your search

+20 -13
View File
@@ -19,6 +19,7 @@ export interface ModuleState {
subdomain: string;
port: number;
active: boolean;
category?: string;
lastDeploy?: LastDeploy;
container?: string | null;
}
@@ -184,20 +185,26 @@ export interface Section {
}
export const SECTIONS: Section[] = [
{ id: "apps", title: "Selección de Aplicación", icon: "bx-grid-alt" },
{ id: "system", title: "Backend & Sistema", icon: "bx-server" },
{ id: "pagina-web", title: "Página Web", icon: "bx-globe" },
{ id: "sam", title: "SAM", icon: "bx-layer" },
{ id: "profesores", title: "Profesores", icon: "bx-pencil" },
{ id: "otras-apps", title: "Otras Aplicaciones", icon: "bx-cube" },
];
const MODULE_SECTION: Record<string, string> = {
// Ejemplos:
// contabilidad: "system",
// pagos: "system",
};
// Categoría que pregunta la integración (default del deployer: otras-apps).
// "Otras Aplicaciones" concentra la revisión prod/dev: módulos
// integrados + backend + gestión.
export function sectionOf(name: string, category?: string): string {
const c = (category || "").trim().toLowerCase();
if (c && SECTIONS.some((s) => s.id === c)) return c;
void name;
return "otras-apps";
}
export function sectionOf(name: string): string {
const key = name.toLowerCase();
if (MODULE_SECTION[key]) return MODULE_SECTION[key];
const known = SECTIONS.some((s) => s.id === key);
if (known) return key;
return "apps";
// Rama main/master = producción, resto = desarrollo.
export function envOf(branch: string) {
const b = (branch || "").trim().toLowerCase();
return b === "main" || b === "master" || b === "prod" || b === "production"
? { label: "Prod", cls: "bg-success" }
: { label: "Dev", cls: "bg-warning text-dark" };
}