(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[964],{64830:function(e,n,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return s(9854)}])},49533:function(e,n,s){"use strict";s.d(n,{Z:function(){return _}});var r=s(85893),i=s(5606),t=s(60),l=s(67294),c=s(55412),a=s(86609),d=s(94655);function o(e){let{link:n,icon:s,...i}=e;return(0,r.jsx)(a.Z,{href:n.url,...i,...n.linkProps,children:(0,r.jsxs)(d.Z,{children:[(0,r.jsx)("span",{children:n.title}),s||(0,r.jsx)(c.Z,{size:17})]})})}var u=s(56211),v=s(45377),x=s(39483),f=s(25808),m=s(96486),p=s.n(m);function j(e){let{service:n}=e,{pageProps:s,ws:c}=(0,l.useContext)(i.AppContext),{deployment:a}=s,{ready:m,setReady:j}=(0,f.Z)(),_=null==a?void 0:a.services.filter(e=>e.parent_service_name==n.service_name),h=[n,..._||[]],[Z,g]=(0,l.useState)(null==h?void 0:h[0]);h.findIndex(e=>e.service_name==(null==Z?void 0:Z.service_name));let N=null==Z?void 0:Z.servers,[w,C]=(0,l.useState)(null==N?void 0:N[0]),k=(0,l.useRef)(void 0);return(0,l.useEffect)(()=>{var e;C(null==Z?void 0:null===(e=Z.servers)||void 0===e?void 0:e[0])},[Z]),(0,l.useEffect)(()=>{if(j(!1),w&&k.current){var e;e=k.current,c.sendData({event:"client:kill-port",server:w,service:p().omit(n,["servers"]),port:e})}setTimeout(()=>{j(!0)},2e3)},[w]),(0,r.jsxs)(t.Z,{className:"grid-cell",children:[(0,r.jsxs)(t.Z,{className:"grid-cell-content",children:[(0,r.jsxs)(d.Z,{className:"w-full justify-between",children:[(0,r.jsx)(u.Z,{children:n.service_name}),(0,r.jsx)(o,{link:{url:"/admin/services/".concat(n.service_name),title:"View"}})]}),(0,r.jsxs)("code",{children:[n.service_name," service"]})]}),(0,r.jsx)("hr",{}),(0,r.jsxs)(t.Z,{className:"gap-0",children:[(0,r.jsxs)(d.Z,{className:"p-4 grid md:grid-cols-2",children:[(0,r.jsx)(x.Z,{options:h.map((e,n)=>({value:e.service_name,title:"Cluster #".concat(n+1)})),changeHandler:e=>{g(h.find(n=>n.service_name==e))}}),N?(0,r.jsx)(x.Z,{options:N.map(e=>({value:e.private_ip,title:e.private_ip})),changeHandler:e=>{C(N.find(n=>n.private_ip==e))}}):void 0]}),m&&w?(0,r.jsx)(v.Z,{server:w,service:n,portRef:k}):void 0]})]})}function _(){let{pageProps:e}=(0,l.useContext)(i.AppContext),{deployment:n,children_services:s}=e,c=null==n?void 0:n.services.filter(e=>!e.parent_service_name);return(0,r.jsx)(t.Z,{className:"w-full nested-grid-frame xl:grid-cols-2",children:null==c?void 0:c.map((e,n)=>(0,r.jsx)(j,{service:e},n))})}},9854:function(e,n,s){"use strict";s.r(n),s.d(n,{__N_SSP:function(){return p},default:function(){return j}});var r=s(85893),i=s(5606),t=s(94655),l=s(3668),c=s(60),a=s(67294);function d(){let{pageProps:e}=(0,a.useContext)(i.AppContext),{user:n,deployment:s,deployment_id:d}=e;if(!s)return null;let o=s.services.filter(e=>!e.parent_service_name);return(0,r.jsx)(c.Z,{className:"w-full gap-0",children:(0,r.jsxs)(c.Z,{className:"grid-cell-content",children:[(0,r.jsxs)(l.Z,{children:[o.length," Services"]}),(0,r.jsx)(t.Z,{children:o.map((e,n)=>(0,r.jsx)("a",{href:"/admin/services/".concat(e.service_name),children:(0,r.jsx)("code",{children:e.service_name})},n))})]})})}var o=s(33028),u=s(38249),v=s(60705),x=s(49533);function f(){let{pageProps:e}=(0,a.useContext)(i.AppContext),{user:n,deployment:s,deployment_id:t}=e,l=null==s?void 0:s.deployment_name;return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(o.Z,{title:"".concat((0,u.Z)(l)," Deplyoment Dashboard"),description:(0,r.jsxs)(r.Fragment,{children:["Deployment"," ",(0,r.jsx)("code",{children:null==t?void 0:t.split("-").shift()})," > ",(0,r.jsx)("code",{children:null==s?void 0:s.deployment_name})]})}),(0,r.jsx)(v.Z,{}),(0,r.jsx)(d,{}),(0,r.jsx)(v.Z,{}),(0,r.jsx)(x.Z,{})]})}var m=s(89350),p=!0;function j(){return(0,r.jsx)(m.Z,{children:(0,r.jsx)(f,{})})}}},function(e){e.O(0,[662,75,664,433,7,827,910,464,888,774,179],function(){return e(e.s=64830)}),_N_E=e.O()}]);