fix: improve admin machine details and role gating

This commit is contained in:
Esdras Renan 2025-10-13 13:32:50 -03:00
parent 076c0df7f9
commit 42611df0f5
6 changed files with 311 additions and 162 deletions

View file

@ -78,11 +78,6 @@ function formatRole(role: string) {
return ROLE_LABELS[key] ?? role
}
function normalizeRoleValue(role: string | null | undefined): RoleOption {
const candidate = (role ?? "agent").toLowerCase() as RoleOption
return ((ROLE_OPTIONS as readonly string[]).includes(candidate) ? candidate : "agent") as RoleOption
}
function formatTenantLabel(tenantId: string, defaultTenantId: string) {
if (!tenantId) return "Principal"
if (tenantId === defaultTenantId) return "Principal"