1import{j as e}from"./index-BPFw6Db2.js";import{a as h,D as j}from"./DeviceStatusChip-Tr2oh-ty.js";import{B as f}from"./Breadcrumb-BPPkFFf-.js";import{ae as N,a7 as u,w as l,L as m,D as a,af as b,E as i,ay as y,H as g,ag as v,a0 as w,d as D}from"./main-DlSV9Dem.js";import{P as $}from"./PlatformBadge-Bcw_BDEp.js";import{F as A}from"./ComputerDesktopIcon-CAWT7YZO.js";import{F}from"./TagIcon-CkEBG2v5.js";import"./MinusCircleIcon-Dw3Chmru.js";import"./XCircleIcon-C3AExB7r.js";import"./DockerIcon-CtkA0vg3.js";const t="text-2xs font-mono font-semibold uppercase tracking-label text-text-muted",r="text-sm text-text-primary font-medium mt-0.5";function S(){const{uid:c}=N(),{data:s,isLoading:x,error:o}=h(c??"");if(x)return e.jsx(u,{label:"Loading device details"});if(o||!s)return e.jsxs("div",{className:"text-center py-24",children:[e.jsx(l,{className:"w-10 h-10 text-text-muted/30 mx-auto mb-3",strokeWidth:1}),e.jsx("p",{className:"text-sm text-text-muted mb-2",children:"Device not found"}),e.jsx(m,{to:"/admin/devices",className:"text-sm text-primary hover:underline",children:"Back to devices"})]});const n=s.tags??[];return e.jsxs("div",{className:"animate-fade-in",children:[e.jsx(f,{items:[{label:"Devices",to:"/admin/devices"},{label:s.name}]}),e.jsxs("div",{className:"flex items-start gap-4 mb-8",children:[e.jsxs("div",{className:"relative w-14 h-14 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center shrink-0",children:[e.jsx(l,{className:"w-7 h-7 text-primary"}),e.jsx("span",{className:`absolute -top-1 -right-1 w-3.5 h-3.5 rounded-full border-2 border-surface ${s.online?"bg-accent-green":"bg-text-muted/30"}`,title:s.online?"Online":"Offline","aria-label":s.online?"Online":"Offline"})]}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-text-primary",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 text-2xs font-semibold rounded-md ${s.online?"bg-accent-green/10 text-accent-green border border-accent-green/20":"bg-text-muted/10 text-text-muted border border-text-muted/20"}`,children:s.online?"Online":"Offline"}),e.jsx(j,{status:s.status})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[e.jsxs(a,{className:"p-5 space-y-4",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2",children:[e.jsx(b,{className:"w-4 h-4 text-primary"}),"Identity"]}),e.jsxs("dl",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"UID"}),e.jsxs("dd",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx("span",{className:"text-xs font-mono text-text-primary truncate max-w-[180px]",title:s.uid,children:s.uid}),e.jsx(i,{text:s.uid})]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"MAC Address"}),e.jsxs("dd",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx("span",{className:"text-xs font-mono text-text-primary",children:s.identity?.mac??"â"}),s.identity?.mac&&e.jsx(i,{text:s.identity.mac})]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Remote Address"}),e.jsx("dd",{className:r,children:e.jsx("span",{className:"font-mono text-xs",children:s.remote_addr??"â"})})]})]})]}),e.jsxs(a,{className:"p-5 space-y-4",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4 text-primary"}),"System"]}),e.jsxs("dl",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Operating System"}),e.jsxs("dd",{className:"flex items-center gap-2 mt-0.5",children:[e.jsx(y,{id:s.info?.id??"",className:"text-base leading-none"}),e.jsx("span",{className:"text-sm text-text-primary",children:s.info?.pretty_name??"â"})]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Architecture"}),e.jsx("dd",{className:r,children:e.jsx("span",{className:"font-mono text-xs",children:s.info?.arch??"â"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Platform"}),e.jsx("dd",{className:"mt-0.5",children:s.info?.platform?e.jsx($,{platform:s.info.platform}):e.jsx("span",{className:"text-sm text-text-muted",children:"â"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Agent Version"}),e.jsx("dd",{className:r,children:e.jsx("span",{className:"font-mono text-xs",children:s.info?.version??"â"})})]})]})]}),e.jsxs(a,{className:"p-5 space-y-4",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2",children:[e.jsx(g,{className:"w-4 h-4 text-primary"}),"Namespace & Timeline"]}),e.jsxs("dl",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Namespace"}),e.jsx("dd",{className:"mt-0.5",children:s.namespace?e.jsx(m,{to:`/admin/namespaces/${s.tenant_id}`,className:"text-sm text-primary hover:underline",children:s.namespace}):e.jsx("span",{className:"text-sm text-text-muted",children:"â"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Tenant ID"}),e.jsxs("dd",{className:"flex items-center gap-1 mt-0.5",children:[e.jsx("span",{className:"text-xs font-mono text-text-primary",children:s.tenant_id}),e.jsx(i,{text:s.tenant_id})]})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Created"}),e.jsx("dd",{className:r,children:v(s.created_at)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:t,children:"Last Seen"}),e.jsx("dd",{className:r,children:w(s.last_seen)})]})]})]})]}),e.jsxs(a,{className:"p-5 mb-6",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2 mb-3",children:[e.jsx(F,{className:"w-4 h-4 text-primary"}),"Tags"]}),n.length>0?e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:n.map((d,p)=>e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 bg-primary/8 text-primary text-2xs rounded-md font-medium border border-primary/15",children:d},`${d}-${p}`))}):e.jsx("p",{className:"text-xs font-mono text-text-muted/50",children:"No tags"})]}),s.public_key&&e.jsxs(a,{className:"p-5",children:[e.jsxs("h3",{className:"text-xs font-semibold text-text-primary flex items-center gap-2 mb-3",children:[e.jsx(D,{className:"w-4 h-4 text-primary"}),"Public Key"]}),e.jsx("pre",{className:"text-2xs font-mono text-text-secondary bg-surface border border-border rounded-lg p-4 overflow-x-auto whitespace-pre-wrap break-all",children:s.public_key})]})]})}export{S as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.