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