import{G as o,j as e,d as r,C as m,o as u,R as l,H as x,I as h,e as j,L as p}from"./index-Dz5JRQhj.js";import{R as C}from"./RenameHeader-C1ri0rHV.js";import{T as N}from"./TabLinks-DGt5hKZe.js";import{C as R}from"./ClusterMemberActions-CV45MsxB.js";import{C as b}from"./ClusterMemberHardware-ljEu2Bg3.js";import"./usePanelParams-Ct0mzMbg.js";import"./GroupSelection-nMtUu7a9.js";import"./PermissionGroupsFilter-lOSp9Bf0.js";import"./SelectableMainTable-5fh72u4t.js";import"./useSortTableData-hB-CR5gt.js";import"./useClusterGroups-C_js1wC4.js";import"./scroll-Dc7Cgzms.js";const f=({member:s})=>{const{automaticRoles:a,customRoles:i}=o(s.roles);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(m,{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:"Automatic roles"}),e.jsx("td",{children:a})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Custom roles"}),e.jsx("td",{children:i})]}),e.jsxs("tr",{children:[e.jsx("th",{className:"u-text--muted",children:"Groups"}),e.jsx("td",{children:s.groups?.map(t=>e.jsxs(e.Fragment,{children:[e.jsx(u,{type:"cluster-group",value:t,to:`${l}/ui/cluster/groups`},t)," "]}))??"-"})]}),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})]})]})})})]})},$=()=>{const s=r.useNotify(),{name:a,activeTab:i}=x(),{data:t,error:n,isLoading:d}=h(a??"");if(n&&s.failure("Loading cluster member details failed",n),d)return e.jsx(r.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0});const c=["Overview","Hardware"];return e.jsxs(r.CustomLayout,{header:e.jsx(C,{name:a??"",parentItems:[e.jsx(p,{to:`${l}/ui/cluster/members`,children:"Cluster members"},1)],isLoaded:!0,renameDisabledReason:"Cannot rename cluster members",controls:e.jsx(R,{member:t,isDetailPage:!0})}),contentClassName:"detail-page cluster-member-details",children:[e.jsx(j,{}),e.jsxs(r.Row,{children:[e.jsx(N,{tabs:c,activeTab:i,tabUrl:`${l}/ui/cluster/member/${encodeURIComponent(a??"")}`}),!i&&t&&e.jsx(f,{member:t}),i==="hardware"&&t&&e.jsx(b,{member:t})]})]})};export{$ as default};
