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-C88DWJny.js";import{R as C}from"./RenameHeader-DwT0tI8X.js";import{T as N}from"./TabLinks-DP94LlMA.js";import{C as R}from"./ClusterMemberActions-CZ5Eq16l.js";import{C as b}from"./ClusterMemberHardware-M0c_UT1C.js";import"./usePanelParams-ip2hqi_i.js";import"./GroupSelection-CHxRV7Bp.js";import"./PermissionGroupsFilter-DwYsz5mc.js";import"./SelectableMainTable-h0rv6-fx.js";import"./useSortTableData-Gi73OjgT.js";import"./useClusterGroups-BLU5gYBu.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};
