refactor(devices): substitui badge arquitetura por status ativacao Windows
- Remove identificador machine-xxx do header dos cards - Substitui badge de arquitetura (X86_64) por status de ativacao do Windows - Remove badge redundante de tipo de dispositivo - Ajusta altura da badge na sidebar para nao cortar texto 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
d95af184be
commit
26b1a65ec4
2 changed files with 24 additions and 20 deletions
|
|
@ -6364,6 +6364,13 @@ function DeviceCard({ device, companyName }: { device: DevicesQueryItem; company
|
|||
})()
|
||||
const persona = collaborator?.role === "manager" ? "Gestor" : "Colaborador"
|
||||
const companyLabel = companyName ?? device.companySlug ?? null
|
||||
const windowsActivationStatus = (() => {
|
||||
const inv = device.inventory as DeviceInventory | null
|
||||
const windowsExt = inv?.extended?.windows
|
||||
const osInfo = parseWindowsOsInfo(windowsExt?.osInfo)
|
||||
if (!osInfo) return null
|
||||
return osInfo.isActivated ?? (typeof osInfo.licenseStatus === "number" ? osInfo.licenseStatus === 1 : null)
|
||||
})()
|
||||
|
||||
return (
|
||||
<Link href={`/admin/devices/${device.id}`} className="group">
|
||||
|
|
@ -6396,14 +6403,6 @@ function DeviceCard({ device, companyName }: { device: DevicesQueryItem; company
|
|||
<span>{device.devicePlatform}</span>
|
||||
</>
|
||||
) : null}
|
||||
{device.authEmail ? (
|
||||
<>
|
||||
<span className="text-slate-300">•</span>
|
||||
<span className="truncate max-w-[140px]" title={device.authEmail}>
|
||||
{device.authEmail}
|
||||
</span>
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
{collaborator?.email ? (
|
||||
<div className="mt-3 flex flex-col gap-2 text-xs text-slate-600">
|
||||
|
|
@ -6445,22 +6444,27 @@ function DeviceCard({ device, companyName }: { device: DevicesQueryItem; company
|
|||
return [name, ver].filter(Boolean).join(" ").trim()
|
||||
})()}
|
||||
</Badge>
|
||||
{device.architecture ? (
|
||||
<Badge variant="outline" className="border-slate-300 bg-slate-100 text-xs font-medium text-slate-700">
|
||||
{device.architecture.toUpperCase()}
|
||||
{windowsActivationStatus !== null ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={cn(
|
||||
"text-xs font-medium",
|
||||
windowsActivationStatus
|
||||
? "border-emerald-300 bg-emerald-50 text-emerald-700"
|
||||
: "border-amber-300 bg-amber-50 text-amber-700"
|
||||
)}
|
||||
>
|
||||
{windowsActivationStatus ? "Ativado" : "Não ativado"}
|
||||
</Badge>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Badge variant="outline" className="border-slate-300 bg-slate-100 text-xs font-medium text-slate-700">
|
||||
{deviceTypeLabel}
|
||||
</Badge>
|
||||
{companyLabel ? (
|
||||
{companyLabel ? (
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<Badge variant="outline" className="border-slate-300 bg-slate-100 text-xs font-medium text-slate-700">
|
||||
{companyLabel}
|
||||
</Badge>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
<div className="flex items-center gap-2 rounded-md border border-slate-200 bg-slate-50/80 px-2 py-1.5">
|
||||
<Cpu className="size-4 text-slate-500" />
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export function SidebarBrand({ logoSrc, logoAlt, title, subtitle }: SidebarBrand
|
|||
<SidebarMenuButton
|
||||
asChild
|
||||
size="lg"
|
||||
className="cursor-default select-none hover:bg-transparent hover:text-inherit active:bg-transparent active:text-inherit focus-visible:ring-0"
|
||||
className="h-auto cursor-default select-none hover:bg-transparent hover:text-inherit active:bg-transparent active:text-inherit focus-visible:ring-0"
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex h-12 w-12 items-center justify-center rounded-lg">
|
||||
|
|
@ -37,7 +37,7 @@ export function SidebarBrand({ logoSrc, logoAlt, title, subtitle }: SidebarBrand
|
|||
</div>
|
||||
<div className="flex flex-col items-start gap-1 leading-none">
|
||||
<span className="text-lg font-semibold">{title}</span>
|
||||
<span className="inline-flex rounded-full bg-neutral-900 px-2.5 py-0.5 text-[11px] font-medium text-white">
|
||||
<span className="inline-flex whitespace-nowrap rounded-full bg-neutral-900 px-2.5 py-1 text-[11px] font-medium text-white">
|
||||
{subtitle}
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue