(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[722],{8706:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters/[cluster]",function(){return t(6996)}])},6996:function(e,s,t){"use strict";t.r(s);var l=t(5893),i=t(7294),a=t(8799),r=t(8236),n=t(1163),c=t(9470),d=t(1664),x=t.n(d),m=t(9037),u=t(9307),h=t(7673),j=t(3266),o=t(3626),f=t(6989),N=t(9284),v=t(3001),b=t(9008),g=t.n(b);function y(e){let{clusterData:s,clusterJobData:t,loading:i}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-6",children:(0,l.jsxs)(h.Zb,{children:[(0,l.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,l.jsx)("h3",{className:"text-lg font-semibold",children:"Details"})}),(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,l.jsx)("div",{className:"text-base mt-1",children:(0,l.jsx)(u.OE,{status:s.status})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.cluster})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.user})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Infra"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.infra?(0,l.jsx)(f.Md,{content:s.full_infra||s.infra,className:"text-sm text-muted-foreground",children:(0,l.jsxs)("span",{children:[(0,l.jsx)(x(),{href:"/infra",className:"text-blue-600 hover:underline",children:s.cloud||s.infra.split("(")[0].trim()}),s.infra.includes("(")&&(0,l.jsx)("span",{children:" "+s.infra.substring(s.infra.indexOf("("))})]})}):"N/A"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Resources"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.resources_str_full||s.resources_str||"N/A"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Started"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.time?new Date(s.time).toLocaleString():"N/A"})]})]})})]})}),(0,l.jsx)("div",{children:t&&(0,l.jsx)(r.L4,{clusterName:s.cluster,clusterJobData:t,loading:i})})]})}s.default=function(){let e=(0,n.useRouter)(),{cluster:s}=e.query,[t,r]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!0),[h,b]=(0,i.useState)(!1),[p,_]=(0,i.useState)(!1),S=(0,v.X)(),{clusterData:k,clusterJobData:w,loading:C,refreshData:O}=(0,j.QL)({cluster:s});i.useEffect(()=>{!C&&d&&u(!1)},[C,d]);let D=async()=>{r(!0),await O(),r(!1)};if(!e.isReady)return(0,l.jsx)("div",{children:"Loading..."});let E=s?"Cluster: ".concat(s," | SkyPilot Dashboard"):"Cluster Details | SkyPilot Dashboard";return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g(),{children:(0,l.jsx)("title",{children:E})}),(0,l.jsxs)(c.A,{highlighted:"clusters",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,l.jsxs)("div",{className:"text-base flex items-center",children:[(0,l.jsx)(x(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,l.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,l.jsx)(x(),{href:"/clusters/".concat(s),className:"text-sky-blue hover:underline",children:s})]}),(0,l.jsx)("div",{className:"text-sm flex items-center",children:(0,l.jsxs)("div",{className:"text-sm flex items-center",children:[(C||t)&&(0,l.jsxs)("div",{className:"flex items-center mr-4",children:[(0,l.jsx)(a.Z,{size:15,className:"mt-0"}),(0,l.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),k&&(0,l.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,l.jsx)(f.WH,{content:"Refresh",className:"text-sm text-muted-foreground",children:(0,l.jsxs)("button",{onClick:D,disabled:C||t,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,l.jsx)(o.Z,{className:"w-4 h-4 mr-1.5"}),!S&&(0,l.jsx)("span",{children:"Refresh"})]})}),(0,l.jsx)(m.GV,{withLabel:!0,cluster:k.cluster,status:k.status,onOpenSSHModal:()=>{b(!0)},onOpenVSCodeModal:()=>{_(!0)}})]})]})})]}),C&&d?(0,l.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,l.jsx)(a.Z,{size:24,className:"mr-2"}),(0,l.jsx)("span",{className:"text-gray-500",children:"Loading..."})]}):k?(0,l.jsx)(y,{clusterData:k,clusterJobData:w,loading:C||t}):null,(0,l.jsx)(N.Oh,{isOpen:h,onClose:()=>b(!1),cluster:s}),(0,l.jsx)(N._R,{isOpen:p,onClose:()=>_(!1),cluster:s})]})]})}}},function(e){e.O(0,[573,488,470,990,627,236,578,888,774,179],function(){return e(e.s=8706)}),_N_E=e.O()}]);