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