(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{8954:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return t(8266)}])},8750:function(e,n,t){"use strict";t.d(n,{Z:function(){return N}});var r=t(5893),o=t(7294),i=t(5258),s=t(1120),a=t(253),c=t(282),l=[{text:"Files",image:"/pngs/files_on.png",uri:"/striker?files=true"},{text:"Tasks",image:"/pngs/tasks_no-jobs_icon.png",uri:"/striker?jobs=true"},{text:"Configure",image:"/pngs/configure_icon_on.png",uri:"/striker?configure=true"},{text:"Striker",image:"/pngs/striker_icon_on.png",uri:"/striker?striker=true"},{text:"Anvil",image:"/pngs/anvil_icon_on.png",uri:"/striker?anvil=true"},{text:"Email",image:"/pngs/email_on.png",uri:"/striker?email=true"},{text:"Logout",image:"/pngs/users_icon_on.png",uri:"/striker?logout=true"},{text:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],u={width:"40em",height:"40em"},d=t(7169),p=t(8008),f=t(2822),h=t(998),m=t(5517),x=t(5154),g=t(442),v=t(3430);function b(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function j(e){for(var n=1;n=0;t-=1)d.current.sendKey(e[t],0)}else d.current.sendCtrlAltDel();l(null)}}(t)},className:R.keysItem,children:(0,r.jsx)(h.Z,{variant:"subtitle1",children:n})},n)}))})]})]})]}):(0,r.jsx)(a.Z,{display:"flex",className:R.spinnerBox,children:E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{style:{paddingBottom:"2em"},children:(0,r.jsx)(B.z,{text:"There was a problem connecting to the server, please try again"})}),(0,r.jsx)(m.Z,{variant:"contained",onClick:function(){A(!1)},style:{textTransform:"none"},children:(0,r.jsx)(h.Z,{className:R.buttonText,variant:"subtitle1",children:"Reconnect"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.z,{text:"Establishing connection with ".concat(i)}),(0,r.jsx)(B.z,{text:"This may take a few minutes"}),(0,r.jsx)(S.Z,{})]})})]})},A=t(306),R=t(5358);function F(e,n,t,r,o,i,s){try{var a=e[i](s),c=a.value}catch(l){return void t(l)}a.done?n(c):Promise.resolve(c).then(r,o)}var L=(0,c.Z)((function(){return{displayBox:{padding:0,paddingTop:".7em",width:"100%"},fullScreenButton:{borderRadius:8,backgroundColor:j.lD,"&:hover":{backgroundColor:j.lD}},fullScreenBox:{paddingLeft:"1em",padding:0},imageButton:{padding:0,color:j.lD},powerOffIcon:{borderRadius:8,padding:0,color:j.s7,width:"100%",height:"100%"},previewImage:{width:"100%",height:"100%"}}})),z=function(e){var n=e.setMode,t=e.uuid,i=e.serverName,s=L(),c=(0,o.useState)(),l=c[0],d=c[1];return(0,o.useEffect)((function(){var e;(e=u().mark((function e(){var n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat("/cgi-bin","/get_server_screenshot?server_uuid=").concat(t),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=e.sent,e.next=6,n.json();case 6:r=e.sent.screenshot,d(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),d("");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function s(e){F(i,r,o,s,a,"next",e)}function a(e){F(i,r,o,s,a,"throw",e)}s(void 0)}))})()}),[t]),(0,r.jsxs)(b.s_,{children:[(0,r.jsx)(a.Z,{flexGrow:1,children:(0,r.jsx)(B.z,{text:"Server: ".concat(i)})}),(0,r.jsxs)(a.Z,{display:"flex",className:s.displayBox,children:[(0,r.jsx)(a.Z,{children:(0,r.jsx)(v.Z,{className:s.imageButton,style:{color:j.E5},component:"span",onClick:function(){return n(!1)},children:l?(0,r.jsx)("img",{alt:"",src:"data:image/png;base64,".concat(l),className:s.previewImage},"preview"):(0,r.jsx)(R.Z,{className:s.powerOffIcon})})}),(0,r.jsx)(a.Z,{className:s.fullScreenBox,children:(0,r.jsx)(v.Z,{className:s.fullScreenButton,style:{color:j.E5},component:"span",onClick:function(){return n(!1)},children:(0,r.jsx)(A.Z,{})})})]})]})},I=t(8750);var q=(0,c.Z)((function(e){return{preview:(n={width:"25%",height:"100%"},t=e.breakpoints.down("md"),r={width:"100%"},t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n),fullView:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}};var n,t,r})),M=function(){var e=(0,o.useState)(!0),n=e[0],t=e[1],c=q(),l=(0,i.useRouter)().query,u=l.uuid,d=l.server_name;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default,{children:(0,r.jsx)("title",{children:d})}),(0,r.jsx)(I.Z,{}),"string"===typeof u&&(n?(0,r.jsx)(a.Z,{className:c.preview,children:(0,r.jsx)(z,{setMode:t,uuid:u,serverName:d})}):(0,r.jsx)(a.Z,{className:c.fullView,children:(0,r.jsx)(E,{setMode:t,uuid:u,serverName:d})}))]})}}},function(e){e.O(0,[321,145,774,888,179],(function(){return n=8954,e(e.s=n);var n}));var n=e.O();_N_E=n}]);