import{j as e,d as r,R as c,n as o,o as m,L as u}from"./index-DET0E_3l.js";import{N as x}from"./NotificationRow-BgqB5Xch.js";import{R as h}from"./RenameHeader-BJMQYHyG.js";import{T as j}from"./TabLinks-BImuLBgR.js";import{C as p,a as N}from"./ClusterMemberStatus-D97dtpx5.js";import{C}from"./ClusterMemberHardware-VScDzhD_.js";import"./usePanelParams-D0oFlSCz.js";import"./GroupSelection-wgjgPiSG.js";import"./PermissionGroupsFilter-D8fzmJ2u.js";import"./SelectableMainTable-Cx4QgggV.js";import"./useSortTableData-Dv6VLExi.js";import"./useClusterGroups-DzUw0c4L.js";import"./Meter-BDgVCBc0.js";import"./scroll-BEbDVMxI.js";const f=({member:s})=>{var t;return e.jsxs(r.Row,{className:"general",children:[e.jsx(r.Col,{size:3,children:e.jsx("h2",{className:"p-heading--5",children:"General"})}),e.jsx(r.Col,{size:7,children:e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Server name"}),e.jsx("td",{children:s.server_name})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Description"}),e.jsx("td",{children:s.description||"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Status"}),e.jsx("td",{children:e.jsx(p,{member:s})})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Message"}),e.jsx("td",{children:s.message})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Url"}),e.jsx("td",{children:s.url})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Roles"}),e.jsx("td",{children:s.roles.join(", ")})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Groups"}),e.jsx("td",{children:((t=s.groups)==null?void 0:t.map(a=>e.jsxs(e.Fragment,{children:[e.jsx(c,{type:"cluster-group",value:a,to:"/ui/cluster/groups"},a)," "]})))??"-"})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Architecture"}),e.jsx("td",{children:s.architecture})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Failure domain"}),e.jsx("td",{children:s.failure_domain})]})]})})})]})},z=()=>{const s=r.useNotify(),{name:t,activeTab:a}=o(),{data:i,error:l,isLoading:n}=m(t??"");if(l&&s.failure("Loading cluster member details failed",l),n)return e.jsx(r.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0});const d=["Overview","Hardware"];return e.jsxs(r.CustomLayout,{header:e.jsx(h,{name:t??"",parentItems:[e.jsx(u,{to:"/ui/cluster/members",children:"Cluster members"},1)],isLoaded:!0,renameDisabledReason:"Cannot rename cluster members",controls:e.jsx(N,{member:i,isDetailPage:!0})}),contentClassName:"detail-page cluster-member-details",children:[e.jsx(x,{}),e.jsxs(r.Row,{children:[e.jsx(j,{tabs:d,activeTab:a,tabUrl:`/ui/cluster/member/${encodeURIComponent(t??"")}`}),!a&&i&&e.jsx(f,{member:i}),a==="hardware"&&i&&e.jsx(C,{member:i})]})]})};export{z as default};
