Align ticket status colors and polish Windows insights

This commit is contained in:
Esdras Renan 2025-10-21 00:12:39 -03:00
parent 6a8f7a63aa
commit 6007babad3
2 changed files with 25 additions and 20 deletions

View file

@ -2356,8 +2356,9 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
</CardTitle> </CardTitle>
<CardDescription>Configurações automáticas e histórico recente</CardDescription> <CardDescription>Configurações automáticas e histórico recente</CardDescription>
</CardHeader> </CardHeader>
<CardContent className="space-y-3 text-sm"> <CardContent className="grid gap-4 text-sm lg:grid-cols-[minmax(0,1fr)_minmax(0,220px)]">
<div className="flex flex-wrap gap-2 text-xs"> <div className="space-y-3">
<div className="flex flex-wrap gap-2 text-xs">
{windowsUpdateDisabled !== undefined ? ( {windowsUpdateDisabled !== undefined ? (
<Badge className={windowsUpdateDisabled ? BADGE_WARNING : BADGE_POSITIVE}> <Badge className={windowsUpdateDisabled ? BADGE_WARNING : BADGE_POSITIVE}>
{windowsUpdateDisabled ? <ShieldOff className="size-3" /> : <ShieldCheck className="size-3" />} {windowsUpdateDisabled ? <ShieldOff className="size-3" /> : <ShieldCheck className="size-3" />}
@ -2370,21 +2371,21 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
Sem detecção automática Sem detecção automática
</Badge> </Badge>
) : null} ) : null}
</div> </div>
<div className="grid gap-2"> <div className="grid gap-2">
<DetailLine label="Modo" value={windowsUpdateMode ?? "—"} /> <DetailLine label="Modo" value={windowsUpdateMode ?? "—"} />
<DetailLine label="Agendamento" value={windowsUpdateScheduleLabel ?? "—"} /> <DetailLine label="Agendamento" value={windowsUpdateScheduleLabel ?? "—"} />
<DetailLine label="Último sucesso" value={windowsUpdateLastSuccessLabel ?? "—"} /> <DetailLine label="Último sucesso" value={windowsUpdateLastSuccessLabel ?? "—"} />
</div>
</div> </div>
{windowsHotfixes.length > 0 ? ( {windowsHotfixes.length > 0 ? (
<div className="space-y-1"> <div className="rounded-md border border-slate-200 bg-slate-50/80 p-3">
<Separator className="my-2" />
<p className="text-xs font-semibold uppercase text-slate-500">Atualizações recentes</p> <p className="text-xs font-semibold uppercase text-slate-500">Atualizações recentes</p>
<ul className="space-y-1 text-xs text-muted-foreground"> <ul className="mt-2 space-y-1 text-xs text-muted-foreground">
{windowsHotfixes.slice(0, 3).map((fix) => ( {windowsHotfixes.slice(0, 3).map((fix) => (
<li key={fix.id} className="flex items-center justify-between gap-3"> <li key={fix.id} className="flex flex-col gap-1 border-b border-slate-200 pb-1 last:border-b-0 last:pb-0">
<span className="font-medium text-foreground">{fix.id}</span> <span className="font-medium text-foreground">{fix.id}</span>
<span>{fix.installedLabel}</span> <span className="text-[11px] uppercase tracking-wide text-slate-500">{fix.installedLabel}</span>
</li> </li>
))} ))}
</ul> </ul>
@ -2565,7 +2566,11 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
].join(" · ")} ].join(" · ")}
</span> </span>
</div> </div>
) : null} ) : (
<p className="text-xs text-muted-foreground">
TPM: não foi possível coletar informações (requer privilégios administrativos na máquina).
</p>
)}
{windowsDeviceGuardDetails ? ( {windowsDeviceGuardDetails ? (
<div className="grid gap-1 text-xs text-muted-foreground"> <div className="grid gap-1 text-xs text-muted-foreground">
@ -3090,9 +3095,9 @@ export function MachineDetails({ machine }: MachineDetailsProps) {
</Dialog> </Dialog>
</div> </div>
)} )}
</CardContent> </CardContent>
</Card> </Card>
) );
} }
function MachinesGrid({ machines, companyNameBySlug }: { machines: MachinesQueryItem[]; companyNameBySlug: Map<string, string> }) { function MachinesGrid({ machines, companyNameBySlug }: { machines: MachinesQueryItem[]; companyNameBySlug: Map<string, string> }) {

View file

@ -20,10 +20,10 @@ const statusLabel: Record<Ticket["status"], string> = {
} }
const statusTone: Record<Ticket["status"], string> = { const statusTone: Record<Ticket["status"], string> = {
PENDING: "bg-slate-200 text-slate-800", PENDING: "border border-slate-200 bg-slate-100 text-slate-700",
AWAITING_ATTENDANCE: "bg-sky-100 text-sky-700", AWAITING_ATTENDANCE: "border border-sky-200 bg-sky-100 text-sky-700",
PAUSED: "bg-violet-100 text-violet-700", PAUSED: "border border-amber-200 bg-[#fff3c4] text-[#7a5901]",
RESOLVED: "bg-emerald-100 text-emerald-700", RESOLVED: "border border-emerald-200 bg-emerald-100 text-emerald-700",
} }
const priorityLabel: Record<Ticket["priority"], string> = { const priorityLabel: Record<Ticket["priority"], string> = {