(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 h}});var i=s(85893),r=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,...r}=e;return(0,i.jsx)(a.Z,{href:n.url,...r,...n.linkProps,children:(0,i.jsxs)(d.Z,{children:[(0,i.jsx)("span",{children:n.title}),s||(0,i.jsx)(c.Z,{size:17})]})})}var u=s(56211),v=s(45377),x=s(39483),m=s(25808),p=s(96486),f=s.n(p);function j(e){let{service:n}=e,{pageProps:s,ws:c}=(0,l.useContext)(r.AppContext),{deployment:a}=s,{ready:p,setReady:j}=(0,m.Z)(),h=null==a?void 0:a.services.filter(e=>e.parent_service_name==n.service_name),_=[n,...h||[]],[Z,g]=(0,l.useState)(null==_?void 0:_[0]);_.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:f().omit(n,["servers"]),port:e})}setTimeout(()=>{j(!0)},2e3)},[w]),(0,i.jsxs)(t.Z,{className:"grid-cell",children:[(0,i.jsxs)(t.Z,{className:"grid-cell-content",children:[(0,i.jsxs)(d.Z,{className:"w-full justify-between",children:[(0,i.jsx)(u.Z,{children:n.service_name}),(0,i.jsx)(o,{link:{url:"/admin/services/".concat(n.service_name),title:"View"}})]}),(0,i.jsxs)("code",{children:[n.service_name," service"]})]}),(0,i.jsx)("hr",{}),(0,i.jsxs)(t.Z,{className:"gap-0",children:[(0,i.jsxs)(d.Z,{className:"p-4 grid md:grid-cols-2",children:[(0,i.jsx)(x.Z,{options:_.map((e,n)=>({value:e.service_name,title:"Cluster #".concat(n+1)})),changeHandler:e=>{g(_.find(n=>n.service_name==e))}}),N?(0,i.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]}),p&&w?(0,i.jsx)(v.Z,{server:w,service:n,portRef:k}):void 0]})]})}function h(){let{pageProps:e}=(0,l.useContext)(r.AppContext),{deployment:n,children_services:s}=e,c=null==n?void 0:n.services.filter(e=>!e.parent_service_name);return(0,i.jsx)(t.Z,{className:"w-full nested-grid-frame xl:grid-cols-2",children:null==c?void 0:c.map((e,n)=>(0,i.jsx)(j,{service:e},n))})}},9854:function(e,n,s){"use strict";s.r(n),s.d(n,{__N_SSP:function(){return f},default:function(){return j}});var i=s(85893),r=s(5606),t=s(94655),l=s(3668),c=s(60),a=s(67294);function d(){let{pageProps:e}=(0,a.useContext)(r.AppContext),{user:n,deployment:s,deployment_id:d}=e;return s?(0,i.jsx)(c.Z,{className:"w-full gap-0",children:(0,i.jsxs)(c.Z,{className:"grid-cell-content",children:[(0,i.jsxs)(l.Z,{children:[s.services.length," Services"]}),(0,i.jsx)(t.Z,{children:s.services.map((e,n)=>(0,i.jsx)("a",{href:"/admin/services/".concat(e.service_name),children:(0,i.jsx)("code",{children:e.service_name})},n))})]})}):null}var o=s(33028),u=s(38249),v=s(60705),x=s(49533);function m(){let{pageProps:e}=(0,a.useContext)(r.AppContext),{user:n,deployment:s,deployment_id:t}=e,l=null==s?void 0:s.deployment_name;return(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(o.Z,{title:"".concat((0,u.Z)(l)," Deplyoment Dashboard"),description:(0,i.jsxs)(i.Fragment,{children:["Deployment"," ",(0,i.jsx)("code",{children:null==t?void 0:t.split("-").shift()})," > ",(0,i.jsx)("code",{children:null==s?void 0:s.deployment_name})]})}),(0,i.jsx)(v.Z,{}),(0,i.jsx)(d,{}),(0,i.jsx)(v.Z,{}),(0,i.jsx)(x.Z,{})]})}var p=s(89350),f=!0;function j(){return(0,i.jsx)(p.Z,{children:(0,i.jsx)(m,{})})}}},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()}]);