(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)}])},6521:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,t(998).Z)("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]])},3610:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,t(998).Z)("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]])},3293:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});/**
 * @license lucide-react v0.407.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let a=(0,t(998).Z)("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]])},6996:function(e,s,t){"use strict";t.r(s);var a=t(5893),i=t(7294),l=t(8799),r=t(938),n=t(1163),c=t(9470),d=t(1664),x=t.n(d),h=t(9037),u=t(9307),m=t(7673),o=t(3266),j=t(3626),f=t(6989),v=t(9284),N=t(3001),b=t(9008),y=t.n(b);function p(e){let{clusterData:s,clusterJobData:t,loading:i}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)(m.Zb,{children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold",children:"Details"})}),(0,a.jsx)("div",{className:"p-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,a.jsx)("div",{className:"text-base mt-1",children:(0,a.jsx)(u.OE,{status:s.status})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.cluster})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.user})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Infra"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.infra?(0,a.jsx)(f.Md,{content:s.full_infra||s.infra,className:"text-sm text-muted-foreground",children:(0,a.jsxs)("span",{children:[(0,a.jsx)(x(),{href:"/infra",className:"text-blue-600 hover:underline",children:s.cloud||s.infra.split("(")[0].trim()}),s.infra.includes("(")&&(0,a.jsx)("span",{children:" "+s.infra.substring(s.infra.indexOf("("))})]})}):"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Resources"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.resources_str_full||s.resources_str||"N/A"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Started"}),(0,a.jsx)("div",{className:"text-base mt-1",children:s.time?new Date(s.time).toLocaleString():"N/A"})]})]})})]})}),(0,a.jsx)("div",{children:t&&(0,a.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),[m,b]=(0,i.useState)(!1),[g,k]=(0,i.useState)(!1),_=(0,N.X)(),{clusterData:w,clusterJobData:S,loading:M,refreshData:C}=(0,o.QL)({cluster:s});i.useEffect(()=>{!M&&d&&u(!1)},[M,d]);let Z=async()=>{r(!0),await C(),r(!1)};if(!e.isReady)return(0,a.jsx)("div",{children:"Loading..."});let L=s?"Cluster: ".concat(s," | SkyPilot Dashboard"):"Cluster Details | SkyPilot Dashboard";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y(),{children:(0,a.jsx)("title",{children:L})}),(0,a.jsxs)(c.A,{highlighted:"clusters",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(x(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(x(),{href:"/clusters/".concat(s),className:"text-sky-blue hover:underline",children:s})]}),(0,a.jsx)("div",{className:"text-sm flex items-center",children:(0,a.jsxs)("div",{className:"text-sm flex items-center",children:[(M||t)&&(0,a.jsxs)("div",{className:"flex items-center mr-4",children:[(0,a.jsx)(l.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),w&&(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(f.WH,{content:"Refresh",className:"text-sm text-muted-foreground",children:(0,a.jsxs)("button",{onClick:Z,disabled:M||t,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,a.jsx)(j.Z,{className:"w-4 h-4 mr-1.5"}),!_&&(0,a.jsx)("span",{children:"Refresh"})]})}),(0,a.jsx)(h.GV,{withLabel:!0,cluster:w.cluster,status:w.status,onOpenSSHModal:()=>{b(!0)},onOpenVSCodeModal:()=>{k(!0)}})]})]})})]}),M&&d?(0,a.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,a.jsx)(l.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading..."})]}):w?(0,a.jsx)(p,{clusterData:w,clusterJobData:S,loading:M||t}):null,(0,a.jsx)(v.Oh,{isOpen:m,onClose:()=>b(!1),cluster:s}),(0,a.jsx)(v._R,{isOpen:g,onClose:()=>k(!1),cluster:s})]})]})}}},function(e){e.O(0,[573,488,480,734,938,578,888,774,179],function(){return e(e.s=8706)}),_N_E=e.O()}]);