import{j as e,d as r,R as c,n as o,o as m,L as u}from"./index-lOezWVmi.js";import{N as x}from"./NotificationRow-DdxAfFhk.js";import{R as h}from"./RenameHeader-p728-JyF.js";import{T as j}from"./TabLinks-C_bdonmQ.js";import{C as p,a as N}from"./ClusterMemberStatus-D6H6dtfH.js";import{C}from"./ClusterMemberHardware-DfVo4oTD.js";import"./usePanelParams-8kZEbPGc.js";import"./GroupSelection-Dk08yxTV.js";import"./PermissionGroupsFilter-_sIBqW1q.js";import"./SelectableMainTable-DfupvQ-c.js";import"./useSortTableData-DWeqi6jP.js";import"./useClusterGroups-gPFjN-2N.js";import"./Meter-CCMCY0F-.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};
