(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),a=t(7294),i=t(8799),c=t(8236),n=t(1163),r=t(9470),d=t(1664),x=t.n(d),m=t(9037),u=t(9307),h=t(7673),j=t(3266),o=t(3626),N=t(7469),f=t(1266),v=t(3001);function b(e){let{clusterData:s,clusterJobData:t,loading:a}=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:"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:"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:"Resources"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.resources_str||"N/A"})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Region"}),(0,l.jsx)("div",{className:"text-base mt-1",children:s.region||"N/A"})]})]})})]})}),(0,l.jsx)("div",{children:t&&(0,l.jsx)(c.L4,{clusterName:s.cluster,clusterJobData:t,loading:a})})]})}s.default=function(){let e=(0,n.useRouter)(),{cluster:s}=e.query,[t,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(!0),[h,g]=(0,a.useState)(!1),[y,p]=(0,a.useState)(!1),_=(0,v.X)(),{clusterData:w,clusterJobData:k,loading:S,refreshData:C}=(0,j.QL)({cluster:s});a.useEffect(()=>{!S&&d&&u(!1)},[S,d]);let O=async()=>{c(!0),await C(),c(!1)};return e.isReady?(0,l.jsxs)(r.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:[(S||t)&&(0,l.jsxs)("div",{className:"flex items-center mr-4",children:[(0,l.jsx)(i.Z,{size:15,className:"mt-0"}),(0,l.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),w&&(0,l.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,l.jsx)(N.WH,{content:"Refresh",className:"text-sm text-muted-foreground",children:(0,l.jsxs)("button",{onClick:O,disabled:S||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"}),!_&&(0,l.jsx)("span",{children:"Refresh"})]})}),(0,l.jsx)(m.GV,{withLabel:!0,cluster:w.cluster,status:w.status,onOpenSSHModal:()=>{g(!0)},onOpenVSCodeModal:()=>{p(!0)}})]})]})})]}),S&&d?(0,l.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,l.jsx)(i.Z,{size:24,className:"mr-2"}),(0,l.jsx)("span",{className:"text-gray-500",children:"Loading..."})]}):w?(0,l.jsx)(b,{clusterData:w,clusterJobData:k,loading:S||t}):null,(0,l.jsx)(f.Oh,{isOpen:h,onClose:()=>g(!1),cluster:s}),(0,l.jsx)(f._R,{isOpen:y,onClose:()=>p(!1),cluster:s})]}):(0,l.jsx)("div",{children:"Loading..."})}}},function(e){e.O(0,[678,312,979,845,236,37,888,774,179],function(){return e(e.s=8706)}),_N_E=e.O()}]);