| Current Path : /snap/lxd/38450/share/lxd-ui/assets/ |
| Current File : //snap/lxd/38450/share/lxd-ui/assets/ClusterMemberHardware-BW3_dTWZ.js |
import{j as e,cW as y,a0 as l,r as m,J as u,x as a,d as j,c0 as N,cs as _,cX as b}from"./index-BsQN_SZU.js";import{M as g}from"./Meter-cq8smrSm.js";import{C as f}from"./ClusterMemberMemoryUsage-DYUQFY0n.js";import{g as C}from"./scroll-Dc7Cgzms.js";const S=({resources:r,state:s})=>e.jsx("table",{children:e.jsxs("tbody",{children:[s&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Uptime"}),e.jsx("td",{children:s?.sysinfo.uptime?y(s?.sysinfo.uptime):"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Load averages"}),e.jsx("td",{children:s?.sysinfo.load_averages.join(" ")})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Processes"}),e.jsx("td",{children:s?.sysinfo.processes})]})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"UUID"}),e.jsx("td",{children:r?.system.uuid})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Vendor"}),e.jsx("td",{children:r?.system.vendor})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Product"}),e.jsx("td",{children:r?.system.product})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Family"}),e.jsx("td",{children:r?.system.family||"N/A"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Version"}),e.jsx("td",{children:r?.system.version})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"SKU"}),e.jsx("td",{children:r?.system.sku||"N/A"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Type"}),e.jsx("td",{children:r?.system.type})]}),r?.system.firmware&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Firmware Vendor"}),e.jsx("td",{children:r.system.firmware.vendor})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Firmware Date"}),e.jsx("td",{children:r.system.firmware.date})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Firmware Version"}),e.jsx("td",{children:r.system.firmware.version})]})]}),r?.system.chassis&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Chassis Vendor"}),e.jsx("td",{children:r.system.chassis.vendor})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Chassis Type"}),e.jsx("td",{children:r.system.chassis.type})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Chassis Serial"}),e.jsx("td",{children:r.system.chassis.serial||"N/A"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Chassis Version"}),e.jsx("td",{children:r.system.chassis.version||"N/A"})]})]}),r?.system.motherboard&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Motherboard Vendor"}),e.jsx("td",{children:r.system.motherboard.vendor})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Motherboard Product"}),e.jsx("td",{children:r.system.motherboard.product})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Motherboard Serial"}),e.jsx("td",{children:r.system.motherboard.serial||"N/A"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Motherboard Version"}),e.jsx("td",{children:r.system.motherboard.version||"N/A"})]})]})]})}),w=({resources:r,state:s})=>e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Architecture"}),e.jsx("td",{children:r?.cpu.architecture})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Total"}),e.jsx("td",{children:r?.cpu.total})]}),s&&e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Logical"}),e.jsx("td",{children:s?.sysinfo.logical_cpus})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Sockets"}),e.jsx("td",{children:r?.cpu.sockets?.map((i,d)=>e.jsxs("div",{children:[e.jsx("strong",{children:i.name}),e.jsxs("div",{children:["Vendor: ",i.vendor]}),e.jsxs("div",{children:["Socket #: ",i.socket]}),(i.cache??[]).length>0&&e.jsxs("div",{children:["Cache:",e.jsx("ul",{children:i.cache?.map((t,c)=>e.jsxs("li",{children:["Level ",t.level," ",t.type," - ",l(t.size)]},c))})]}),(i.cores??[]).length>0&&e.jsxs("div",{children:["Cores:",e.jsx("ul",{children:i.cores?.map((t,c)=>e.jsxs("li",{children:["Core ",t.core,", Die ",t.die,e.jsx("ul",{children:t.threads?.map((h,x)=>e.jsxs("li",{children:["Thread ",h.id," (NUMA ",h.numa_node,") -"," ",h.online?"Online":"Offline",","," ",h.isolated?"Isolated":"Not isolated"]},x))})]},c))})]})]},d))||"None"})]})]})}),M=({resources:r,state:s,member:i})=>{const d=s?.sysinfo.free_swap??0,t=s?.sysinfo.free_swap??0;return e.jsx("table",{children:e.jsxs("tbody",{children:[i&&e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Overview"}),e.jsx("td",{children:e.jsx(f,{member:i})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Total"}),e.jsx("td",{children:l(r?.memory?.total??0)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Used"}),e.jsx("td",{children:l(r?.memory?.used??0)})]}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Free"}),e.jsx("td",{children:l(s?.sysinfo.free_ram??0)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Shared"}),e.jsx("td",{children:l(s?.sysinfo.shared_ram??0)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Buffered"}),e.jsx("td",{children:l(s?.sysinfo.buffered_ram??0)})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Swap"}),e.jsx("td",{children:e.jsx(g,{percentage:100/d*(d-t),text:l(d-t)+" of "+l(d),hoverText:`free: ${l(t)}
total: ${l(d)}`})})]})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Hugepages"}),e.jsxs("td",{children:[e.jsxs("div",{children:["Used: ",r?.memory.hugepages_used]}),e.jsxs("div",{children:["Total: ",r?.memory.hugepages_total]}),e.jsxs("div",{children:["Size: ",l(r?.memory.hugepages_size??0)]})]})]}),r?.memory.nodes?.map((c,h)=>e.jsxs("tr",{children:[e.jsxs("th",{className:"u-text--muted",children:["NUMA Node ",c.numa_node]}),e.jsxs("td",{children:[e.jsxs("div",{children:["Used: ",l(c.used)]}),e.jsxs("div",{children:["Total: ",l(c.total)]})]})]},h))]})})},D=({resources:r})=>e.jsx("table",{children:e.jsx("tbody",{children:r?.gpu.cards?.map((s,i)=>e.jsxs("tr",{children:[e.jsxs("th",{className:"u-text--muted",children:["Card #",i+1]}),e.jsxs("td",{children:[e.jsxs("div",{children:["Product: ",s.product]}),e.jsxs("div",{children:["Vendor: ",s.vendor]}),e.jsxs("div",{children:["PCI Address: ",s.pci_address]}),e.jsxs("div",{children:["Driver: ",s.driver," (",s.driver_version,")"]}),e.jsxs("div",{children:["NUMA Node: ",s.numa_node]}),s.drm&&e.jsxs("div",{children:["DRM:",e.jsxs("div",{children:["Card: ",s.drm.card_name," (",s.drm.card_device,")"]}),e.jsxs("div",{children:["Control: ",s.drm.control_name," (",s.drm.control_device,")"]}),s.drm.render_name&&e.jsxs("div",{children:["Render: ",s.drm.render_name," (",s.drm.render_device,")"]})]}),s.sriov&&e.jsxs("div",{children:["SR-IOV:",e.jsxs("div",{children:[s.sriov.current_vfs," / ",s.sriov.maximum_vfs," VFs"]})]})]})]},i))})}),P=({resources:r})=>e.jsx("table",{children:e.jsx("tbody",{children:r?.network.cards?.map((s,i)=>e.jsxs("tr",{children:[e.jsxs("th",{className:"u-text--muted",children:["Card #",i+1]}),e.jsxs("td",{children:[e.jsxs("div",{children:["Vendor: ",s.vendor]}),e.jsxs("div",{children:["Product: ",s.product]}),e.jsxs("div",{children:["Driver: ",s.driver," (",s.driver_version,")"]}),s.firmware_version&&e.jsxs("div",{children:["Firmware: ",s.firmware_version]}),s.pci_address&&e.jsxs("div",{children:["PCI Address: ",s.pci_address]}),s.usb_address&&e.jsxs("div",{children:["USB Address: ",s.usb_address]}),e.jsxs("div",{children:["NUMA Node: ",s.numa_node]}),(s.ports??[]).length>0&&e.jsxs("div",{children:["Ports:",e.jsx("ul",{children:(s.ports??[]).map((d,t)=>e.jsxs("li",{children:[e.jsxs("div",{children:["ID: ",e.jsx("strong",{children:d.id})]}),e.jsxs("div",{children:["MAC: ",d.address]}),e.jsxs("div",{children:["Protocol: ",d.protocol]}),e.jsxs("div",{children:["Link: ",d.link_detected?"Up":"Down"]}),e.jsxs("div",{children:["Auto-negotiation:"," ",d.auto_negotiation?"Yes":"No"]}),e.jsxs("div",{children:["Port type: ",d.port_type]}),e.jsxs("div",{children:["Transceiver: ",d.transceiver_type]})]},t))})]})]})]},i))})}),U=({resources:r})=>e.jsx("table",{children:e.jsx("tbody",{children:r?.pci.devices?.map((s,i)=>e.jsxs("tr",{children:[e.jsxs("th",{className:"u-text--muted",children:["Device #",i+1]}),e.jsxs("td",{children:[e.jsxs("div",{children:["Vendor: ",s.vendor," (",s.vendor_id,")"]}),e.jsxs("div",{children:["Product: ",s.product," (",s.product_id,")"]}),e.jsxs("div",{children:["PCI Address: ",s.pci_address]}),e.jsxs("div",{children:["Driver: ",s.driver||"N/A"]}),e.jsxs("div",{children:["Driver Version: ",s.driver_version||"N/A"]}),e.jsxs("div",{children:["NUMA Node: ",s.numa_node]}),e.jsxs("div",{children:["IOMMU Group: ",s.iommu_group]}),s.vpd&&Object.keys(s.vpd).length>0&&e.jsxs("div",{children:["VPD:",e.jsx("ul",{children:Object.entries(s.vpd).map(([d,t])=>e.jsxs("li",{children:[d,": ",String(t)]},d))})]})]})]},i))})}),A=({resources:r})=>e.jsx("table",{children:e.jsx("tbody",{children:r?.storage.disks?.map((s,i)=>e.jsxs("tr",{children:[e.jsxs("th",{className:"u-text--muted",children:["Disk #",i+1]}),e.jsxs("td",{children:[e.jsxs("div",{children:["Model: ",e.jsx("strong",{children:s.model})]}),e.jsxs("div",{children:["Type: ",s.type]}),e.jsxs("div",{children:["ID: ",s.id]}),e.jsxs("div",{children:["Serial: ",s.serial]}),e.jsxs("div",{children:["Size: ",l(s.size)]}),e.jsxs("div",{children:["Firmware: ",s.firmware_version]}),e.jsxs("div",{children:["Read-only: ",s.read_only?"Yes":"No"]}),e.jsxs("div",{children:["Mounted: ",s.mounted?"Yes":"No"]}),e.jsxs("div",{children:["Removable: ",s.removable?"Yes":"No"]}),e.jsxs("div",{children:["RPM: ",s.rpm]}),e.jsxs("div",{children:["Block Size: ",l(s.block_size)]}),e.jsxs("div",{children:["PCI Address: ",s.pci_address]}),e.jsxs("div",{children:["NUMA Node: ",s.numa_node]}),e.jsxs("div",{children:["Device Path: ",s.device_path]}),e.jsxs("div",{children:["Device ID: ",s.device_id]}),e.jsxs("div",{children:["WWN: ",s.wwn]}),(s.partitions??[]).length>0&&e.jsxs("div",{children:["Partitions:",e.jsx("ul",{children:(s.partitions??[]).map((d,t)=>e.jsxs("li",{children:[e.jsxs("div",{children:["ID: ",d.id]}),e.jsxs("div",{children:["Device: ",d.device]}),e.jsxs("div",{children:["Size: ",l(d.size)]}),e.jsxs("div",{children:["Partition #: ",d.partition]}),e.jsxs("div",{children:["Mounted: ",d.mounted?"Yes":"No"]}),d.device_fs_uuid&&e.jsxs("div",{children:["UUID: ",d.device_fs_uuid]})]},t))})]})]})]},i))})}),F=({resources:r})=>e.jsx("table",{className:"usb",children:e.jsxs("tbody",{children:[r?.usb.devices?.length===0&&e.jsx("tr",{children:e.jsx("td",{className:"u-text--muted",children:"No USB devices found"})}),r?.usb.devices?.map((s,i)=>e.jsxs("tr",{children:[e.jsxs("th",{className:"u-text--muted",children:["Device #",i+1]}),e.jsxs("td",{children:[e.jsxs("div",{children:["Bus Address: ",s.bus_address]}),e.jsxs("div",{children:["Device Address: ",s.device_address]}),s.vendor&&e.jsxs("div",{children:["Vendor: ",s.vendor]}),s.product&&e.jsxs("div",{children:["Product: ",s.product]}),s.serial&&s.serial!==""&&e.jsxs("div",{children:["Serial: ",s.serial]}),(s.interfaces??[]).length>0&&e.jsxs("div",{children:["Interfaces:",e.jsx("ul",{children:(s.interfaces??[]).map((d,t)=>e.jsxs("li",{children:[e.jsxs("div",{children:["Class: ",d.class]}),e.jsxs("div",{children:["Subclass: ",d.subclass]}),e.jsxs("div",{children:["Protocol: ",d.protocol]})]},t))})]})]})]},i))]})}),T=({member:r})=>{const[s,i]=m.useState("system"),{data:d,isLoading:t}=u({queryKey:[a.cluster,a.members,r?.server_name??void 0,a.resources],queryFn:async()=>_(r?.server_name)}),{data:c,isLoading:h}=u({queryKey:[a.cluster,a.members,r?.server_name??void 0,a.state],queryFn:async()=>b(r?.server_name??""),enabled:!!r}),x=["System","CPU","GPU","Memory","Networks","Storage","PCI","USB"];return m.useEffect(()=>{const n=document.getElementById("content-details"),v=()=>{const p=C(x,n);i(p.toLowerCase())},o=()=>{N(v,20)};return n?.addEventListener("scroll",o),()=>n?.removeEventListener("scroll",o)},[t,x]),t||h?e.jsx(j.Spinner,{className:"u-loader",text:"Loading..."}):e.jsxs(e.Fragment,{children:[!d&&e.jsx(j.Notification,{severity:"negative",title:"Could not load details for this member"}),d&&e.jsxs(j.ScrollableContainer,{dependencies:[d],children:[x.map(n=>e.jsxs(j.Row,{className:"hardware-section",children:[e.jsx(j.Col,{size:2,children:e.jsx("h2",{className:"p-heading--5",id:n.toLowerCase(),children:n})}),e.jsxs(j.Col,{size:10,children:[n==="System"&&e.jsx(S,{resources:d,state:c}),n==="CPU"&&e.jsx(w,{resources:d,state:c}),n==="Memory"&&e.jsx(M,{resources:d,state:c,member:r}),n==="GPU"&&e.jsx(D,{resources:d}),n==="Networks"&&e.jsx(P,{resources:d}),n==="PCI"&&e.jsx(U,{resources:d}),n==="Storage"&&e.jsx(A,{resources:d}),n==="USB"&&e.jsx(F,{resources:d})]})]},n)),e.jsx("div",{className:"aside",children:e.jsx("nav",{"aria-label":"Hardware navigation",className:"toc-tree",children:e.jsx("ul",{children:x.map(n=>e.jsx("li",{className:"p-side-navigation__item",children:e.jsx("a",{className:"p-side-navigation__link",href:`${window.location.pathname}#${n.toLowerCase()}`,"aria-current":s===n.toLowerCase()?"page":void 0,children:n})},n))})})})]})]})};export{T as C};