Local modifications to ClusterLabs/Anvil by Alteeve
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
23 KiB

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{366:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(2108)).default)(i.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.Z=s},306:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(2108)).default)(i.createElement("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H3V4h18v12z"}),"DesktopWindows");t.Z=s},2617:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(2108)).default)(i.createElement("path",{d:"M20 5H4c-1.1 0-1.99.9-1.99 2L2 17c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm-9 3h2v2h-2V8zm0 3h2v2h-2v-2zM8 8h2v2H8V8zm0 3h2v2H8v-2zm-1 2H5v-2h2v2zm0-3H5V8h2v2zm9 7H8v-2h8v2zm0-4h-2v-2h2v2zm0-3h-2V8h2v2zm3 3h-2v-2h2v2zm0-3h-2V8h2v2z"}),"Keyboard");t.Z=s},5358:function(e,t,n){"use strict";var r=n(5318),o=n(862);t.Z=void 0;var i=o(n(7294)),s=(0,r(n(2108)).default)(i.createElement("path",{d:"M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25 6 8.54v5.96L9.5 18v3h5v-3l.48-.48 4.47 4.47 1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57-1.07 1.06z"}),"PowerOffOutlined");t.Z=s},210:function(e,t,n){"use strict";n.d(t,{Z:function(){return C}});var r=n(4942),o=n(7294),i=n(5258),s=n(1120),a=n(9956),c=n(282),u=[{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"}],l={width:"40em",height:"40em"},d=n(9753),f=n(7159),p=n(2822),h=n(998),m=n(5517),v=n(7623),g=n(442),b=n(964),x=n(5893);function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var w=(0,s.Z)((function(){return(0,v.Z)({list:{width:"200px"},divider:{background:d.d},text:{paddingTop:".5em",paddingLeft:"1.5em"},dashboardButton:{paddingLeft:".1em"},dashboardIcon:{fontSize:"2.3em",color:d.s7}})})),_=function(e){var t=e.open,n=e.setOpen,r=w();return(0,x.jsx)(f.ZP,{BackdropProps:{invisible:!0},anchor:"left",open:t,onClose:function(){return n(!t)},children:(0,x.jsx)("div",{role:"presentation",children:(0,x.jsxs)(p.Z,{className:r.list,children:[(0,x.jsx)(h.Z,{button:!0,children:(0,x.jsx)(b.z,{text:"Admin"})}),(0,x.jsx)(m.Z,{className:r.divider}),(0,x.jsx)(h.Z,{button:!0,component:"a",href:"/index.html",children:(0,x.jsxs)(a.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,x.jsx)(a.Z,{className:r.dashboardButton,children:(0,x.jsx)(g.Z,{className:r.dashboardIcon})}),(0,x.jsx)(a.Z,{flexGrow:1,className:r.text,children:(0,x.jsx)(b.A,{text:"Dashboard"})})]})}),u.map((function(e){return(0,x.jsx)(h.Z,{button:!0,component:"a",href:-1!==e.uri.search(/^https?:/)?e.uri:"".concat("/cgi-bin").concat(e.uri),children:(0,x.jsxs)(a.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,x.jsx)(a.Z,{children:(0,x.jsx)("img",j({alt:"",src:e.image},l),"icon")}),(0,x.jsx)(a.Z,{flexGrow:1,className:r.text,children:(0,x.jsx)(b.A,{text:e.text})})]})},e.image)}))]})})})};function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Z=(0,s.Z)((function(e){return{appBar:{paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5),paddingLeft:e.spacing(3),paddingRight:e.spacing(3),borderBottom:"solid 1px",borderBottomColor:d.hM},input:{height:"2.8em",width:"30vw",backgroundColor:e.palette.secondary.main,borderRadius:d.n_},barElement:{padding:0},iconBox:(0,r.Z)({},e.breakpoints.down("sm"),{display:"none"}),searchBar:(0,r.Z)({},e.breakpoints.down("sm"),{flexGrow:1,paddingLeft:"15vw"}),icons:{paddingLeft:".1em",paddingRight:".1em"}}})),C=function(){var e=Z(),t=(0,o.useState)(!1),n=t[0],r=t[1];return(0,x.jsxs)(i.Z,{position:"static",className:e.appBar,children:[(0,x.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,x.jsx)(a.Z,{className:e.barElement,children:(0,x.jsx)(c.Z,{onClick:function(){return r(!n)},children:(0,x.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,x.jsx)(a.Z,{className:"".concat(e.barElement," ").concat(e.iconBox),children:u.map((function(t){return(0,x.jsx)("a",{href:-1!==t.uri.search(/^https?:/)?t.uri:"".concat("/cgi-bin").concat(t.uri),children:(0,x.jsx)("img",k(k({alt:"",src:t.image},l),{},{className:e.icons}),"icon")},t.uri)}))})]}),(0,x.jsx)(_,{open:n,setOpen:r})]})}},6638:function(e,t,n){"use strict";n.d(t,{Lg:function(){return l},s_:function(){return f},V9:function(){return c}});var r=n(9956),o=n(1120),i=n(9753),s=n(5893),a=(0,o.Z)((function(){return{innerHeader:{position:"relative",padding:"0 .7em"},header:{top:"-.3em",left:"-.3em",padding:"1.4em 0",position:"absolute",content:'""',borderColor:i.d,borderWidth:"1px",borderRadius:i.n_,borderStyle:"solid",width:"100%"}}})),c=function(e){var t=e.children,n=a();return(0,s.jsxs)(r.Z,{className:n.innerHeader,whiteSpace:"pre-wrap",children:[(0,s.jsx)("div",{className:n.header}),t]})},u=(0,o.Z)((function(){return{innerBody:{borderWidth:"1px",borderRadius:i.n_,borderStyle:"solid",borderColor:i.d,marginTop:"1.4em",marginBottom:"1.4em",paddingBottom:0,position:"relative"}}})),l=function(e){var t=e.children,n=u();return(0,s.jsx)(r.Z,{className:n.innerBody,children:t})},d=(0,o.Z)((function(){return{paper:{padding:"2.1em",backgroundColor:i.v9,opacity:.8,zIndex:999},container:{margin:"1em",position:"relative"},square:{content:'""',position:"absolute",width:"2.1em",height:"2.1em",border:"1px",borderColor:i.lD,borderWidth:"1px",borderRadius:i.n_,borderStyle:"solid",padding:0,margin:0},topSquare:{top:"-.3em",left:"-.3em"},bottomSquare:{bottom:"-.3em",right:"-.3em"},"@global":{"*::-webkit-scrollbar":{width:".6em"},"*::-webkit-scrollbar-track":{backgroundColor:i.v9},"*::-webkit-scrollbar-thumb":{backgroundColor:i.lD,outline:"1px solid transparent",borderRadius:i.n_}}}})),f=function(e){var t=e.children,n=d();return(0,s.jsxs)("div",{className:n.container,children:[(0,s.jsx)("div",{className:"".concat(n.square," ").concat(n.topSquare)}),(0,s.jsx)("div",{className:"".concat(n.square," ").concat(n.bottomSquare)}),(0,s.jsx)("div",{className:n.paper,children:t})]})}},8382:function(e,t,n){"use strict";var r=n(1120),o=n(5477),i=n(9753),s=n(5893),a=(0,r.Z)((function(){return{root:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:"3em"},spinner:{color:i.lD,variant:"indeterminate",size:"50em"}}}));t.Z=function(){var e=a();return(0,s.jsx)("div",{className:e.root,children:(0,s.jsx)(o.Z,{className:e.spinner})})}},964:function(e,t,n){"use strict";n.d(t,{A:function(){return d},z:function(){return c}});var r=n(2318),o=n(4670),i=n(9753),s=n(5893),a=(0,o.Z)({root:{color:i.lD}})(r.Z),c=function(e){var t=e.text;return(0,s.jsx)(a,{variant:"h4",children:t})},u=(0,n(1120).Z)((function(){return{selected:{color:i.lD},unselected:{color:i.UZ}}})),l=function(e){var t=e.text,n=e.selected,o=u();return(0,s.jsx)(r.Z,{variant:"subtitle1",className:n?o.selected:o.unselected,children:t})};l.defaultProps={selected:!0};var d=l},9386:function(e,t){"use strict";t.Z=function(e,t){return fetch(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}},8771:function(e,t,n){"use strict";var r=n(9713);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.default=function(e,t){var n=s.default,r={loading:function(e){e.error,e.isLoading;return e.pastDelay,null}};e instanceof Promise?r.loader=function(){return e}:"function"===typeof e?r.loader=e:"object"===typeof e&&(r=i(i({},r),e));var o=r=i(i({},r),t);if(o.suspense)throw new Error("Invalid suspense option usage in next/dynamic. Read more: https://nextjs.org/docs/messages/invalid-dynamic-suspense");if(o.suspense)return n(o);r.loadableGenerated&&delete(r=i(i({},r),r.loadableGenerated)).loadableGenerated;if("boolean"===typeof r.ssr){if(!r.ssr)return delete r.ssr,c(n,r);delete r.ssr}return n(r)};a(n(7294));var s=a(n(4860));function a(e){return e&&e.__esModule?e:{default:e}}function c(e,t){return delete t.webpack,delete t.modules,e(t)}},1083:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LoadableContext=void 0;var o=((r=n(7294))&&r.__esModule?r:{default:r}).default.createContext(null);t.LoadableContext=o},4860:function(e,t,n){"use strict";var r=n(4575),o=n(3913),i=n(9713);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l,d=(l=n(7294))&&l.__esModule?l:{default:l},f=n(7161),p=n(1083);var h=[],m=[],v=!1;function g(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((function(e){return n.loading=!1,n.loaded=e,e})).catch((function(e){throw n.loading=!1,n.error=e,e})),n}var b=function(){function e(t,n){r(this,e),this._loadFn=t,this._opts=n,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}return o(e,[{key:"promise",value:function(){return this._res.promise}},{key:"retry",value:function(){var e=this;this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};var t=this._res,n=this._opts;t.loading&&("number"===typeof n.delay&&(0===n.delay?this._state.pastDelay=!0:this._delay=setTimeout((function(){e._update({pastDelay:!0})}),n.delay)),"number"===typeof n.timeout&&(this._timeout=setTimeout((function(){e._update({timedOut:!0})}),n.timeout))),this._res.promise.then((function(){e._update({}),e._clearTimeouts()})).catch((function(t){e._update({}),e._clearTimeouts()})),this._update({})}},{key:"_update",value:function(e){this._state=a(a({},this._state),{},{error:this._res.error,loaded:this._res.loaded,loading:this._res.loading},e),this._callbacks.forEach((function(e){return e()}))}},{key:"_clearTimeouts",value:function(){clearTimeout(this._delay),clearTimeout(this._timeout)}},{key:"getCurrentValue",value:function(){return this._state}},{key:"subscribe",value:function(e){var t=this;return this._callbacks.add(e),function(){t._callbacks.delete(e)}}}]),e}();function x(e){return function(e,t){var n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null,suspense:!1},t);n.suspense&&(n.lazy=d.default.lazy(n.loader));var r=null;function o(){if(!r){var t=new b(e,n);r={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return r.promise()}if(!v&&"function"===typeof n.webpack&&!n.suspense){var i=n.webpack();m.push((function(e){var t,n=c(i);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(-1!==e.indexOf(r))return o()}}catch(s){n.e(s)}finally{n.f()}}))}var s=n.suspense?function(e,t){return d.default.createElement(n.lazy,a(a({},e),{},{ref:t}))}:function(e,t){o();var i=d.default.useContext(p.LoadableContext),s=f.useSubscription(r);return d.default.useImperativeHandle(t,(function(){return{retry:r.retry}}),[]),i&&Array.isArray(n.modules)&&n.modules.forEach((function(e){i(e)})),d.default.useMemo((function(){return s.loading||s.error?d.default.createElement(n.loading,{isLoading:s.loading,pastDelay:s.pastDelay,timedOut:s.timedOut,error:s.error,retry:r.retry}):s.loaded?d.default.createElement(function(e){return e&&e.__esModule?e.default:e}(s.loaded),e):null}),[e,s])};return s.preload=function(){return!n.suspense&&o()},s.displayName="LoadableComponent",d.default.forwardRef(s)}(g,e)}function y(e,t){for(var n=[];e.length;){var r=e.pop();n.push(r(t))}return Promise.all(n).then((function(){if(e.length)return y(e,t)}))}x.preloadAll=function(){return new Promise((function(e,t){y(h).then(e,t)}))},x.preloadReady=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new Promise((function(t){var n=function(){return v=!0,t()};y(m,e).then(n,n)}))},window.__NEXT_PRELOADREADY=x.preloadReady;var j=x;t.default=j},5782:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return V}});var r=n(4942),o=n(7294),i=n(1163),s=n(9008),a=n(9956),c=n(1120);function u(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){u(i,r,o,s,a,"next",e)}function a(e){u(i,r,o,s,a,"throw",e)}s(void 0)}))}}var d=n(7757),f=n.n(d),p=n(5152),h=n(5675),m=n(5639),v=n(2318),g=n(282),b=n(366),x=n(2617),y=n(7812),j=n(6638),w=n(9753),_="0xffe3",O="0xffe9",k=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[_,O,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[_,O,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[_,O,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[_,O,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[_,O,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[_,O,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[_,O,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[_,O,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[_,O,"0xffc6"]}],Z=n(9386),C=function(){var e=l(f().mark((function e(t,n,r){var o,i,s;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new AbortController,i=setTimeout((function(){return o.abort()}),r),e.next=4,fetch(t,{method:"PUT",headers:{"Content-Type":"application/json","Keep-Alive":"timeout=120"},signal:o.signal,body:JSON.stringify(n)});case 4:return s=e.sent,clearTimeout(i),e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),P=n(964),D=n(8382),N=n(5893),S=(0,p.default)((function(){return Promise.all([n.e(204),n.e(97)]).then(n.bind(n,7097))}),{ssr:!1,loadableGenerated:{webpack:function(){return[7097]},modules:["../components/Display/FullSize.tsx -> ./VncDisplay"]}}),E=(0,c.Z)((function(){return{displayBox:{width:"75vw",height:"75vh",paddingTop:"1em",paddingBottom:0,paddingLeft:0,paddingRight:0},spinnerBox:{flexDirection:"column",width:"75vw",height:"75vh",alignItems:"center",justifyContent:"center"},closeButton:{borderRadius:8,backgroundColor:w.hM,"&:hover":{backgroundColor:w.hM}},keyboardButton:{borderRadius:8,backgroundColor:w.lD,"&:hover":{backgroundColor:w.lD}},closeBox:{paddingBottom:"1em",paddingLeft:".7em",paddingRight:0},buttonsBox:{paddingTop:0},keysItem:{backgroundColor:w.lD,paddingRight:"3em","&:hover":{backgroundColor:w.lD}},buttonText:{color:w.E5}}})),B=function(e){var t=e.setMode,n=e.uuid,r=e.serverName,i=(0,o.useState)(null),s=i[0],c=i[1],u=(0,o.useRef)(),d=(0,o.useRef)(void 0),p=(0,o.useState)(void 0),_=p[0],O=p[1],B=(0,o.useState)(!1),z=B[0],T=B[1],A=E();(0,o.useEffect)((function(){d.current=window.location.hostname,_||l(f().mark((function e(){var t;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:n,is_open:!0},12e4);case 3:return t=e.sent,e.t0=O,e.next=7,t.json();case 7:e.t1=e.sent,(0,e.t0)(e.t1),e.next=14;break;case 11:e.prev=11,e.t2=e.catch(0),T(!0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[n,_,z]);var L=function(){var e=l(f().mark((function e(){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.Z)("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:n,is_open:!1});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,N.jsxs)(j.s_,{children:[(0,N.jsx)(a.Z,{flexGrow:1,children:(0,N.jsx)(P.z,{text:"Server: ".concat(r)})}),_?(0,N.jsxs)(a.Z,{display:"flex",className:A.displayBox,children:[(0,N.jsx)(S,{rfb:u,url:"".concat(_.protocol,"://").concat(d.current,":").concat(_.forward_port),viewOnly:!1,focusOnClick:!1,clipViewport:!1,dragViewport:!1,scaleViewport:!0,resizeSession:!0,showDotCursor:!1,background:"",qualityLevel:6,compressionLevel:2}),(0,N.jsxs)(a.Z,{children:[(0,N.jsx)(a.Z,{className:A.closeBox,children:(0,N.jsx)(y.Z,{className:A.closeButton,style:{color:w.lD},component:"span",onClick:function(){L(),t(!0)},children:(0,N.jsx)(b.Z,{})})}),(0,N.jsxs)(a.Z,{className:A.closeBox,children:[(0,N.jsx)(y.Z,{className:A.keyboardButton,style:{color:w.E5},component:"span",onClick:function(e){c(e.currentTarget)},children:(0,N.jsx)(x.Z,{})}),(0,N.jsx)(h.Z,{anchorEl:s,keepMounted:!0,open:Boolean(s),onClose:function(){return c(null)},children:k.map((function(e){var t=e.keys,n=e.scans;return(0,N.jsx)(m.Z,{onClick:function(){return function(e){if(u.current){if(e.length){for(var t=0;t<=e.length-1;t+=1)u.current.sendKey(e[t],1);for(var n=e.length-1;n>=0;n-=1)u.current.sendKey(e[n],0)}else u.current.sendCtrlAltDel();c(null)}}(n)},className:A.keysItem,children:(0,N.jsx)(v.Z,{variant:"subtitle1",children:t})},t)}))})]})]})]}):(0,N.jsx)(a.Z,{display:"flex",className:A.spinnerBox,children:z?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(a.Z,{style:{paddingBottom:"2em"},children:(0,N.jsx)(P.z,{text:"There was a problem connecting to the server, please try again"})}),(0,N.jsx)(g.Z,{variant:"contained",onClick:function(){T(!1)},style:{textTransform:"none"},children:(0,N.jsx)(v.Z,{className:A.buttonText,variant:"subtitle1",children:"Reconnect"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(P.z,{text:"Establishing connection with ".concat(r)}),(0,N.jsx)(P.z,{text:"This may take a few minutes"}),(0,N.jsx)(D.Z,{})]})})]})},z=n(306),T=n(5358),A=(0,c.Z)((function(){return{displayBox:{padding:0,paddingTop:".7em",width:"100%"},fullScreenButton:{borderRadius:8,backgroundColor:w.lD,"&:hover":{backgroundColor:w.lD}},fullScreenBox:{paddingLeft:"1em",padding:0},imageButton:{padding:0,color:w.lD},powerOffIcon:{borderRadius:8,padding:0,color:w.s7,width:"100%",height:"100%"},previewImage:{width:"100%",height:"100%"}}})),L=function(e){var t=e.setMode,n=e.uuid,r=e.serverName,i=A(),s=(0,o.useState)(),c=s[0],u=s[1];return(0,o.useEffect)((function(){l(f().mark((function e(){var t,r,o;return f().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(n),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return t=e.sent,e.next=6,t.json();case 6:r=e.sent,o=r.screenshot,u(o),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),u("");case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[n]),(0,N.jsxs)(j.s_,{children:[(0,N.jsx)(a.Z,{flexGrow:1,children:(0,N.jsx)(P.z,{text:"Server: ".concat(r)})}),(0,N.jsxs)(a.Z,{display:"flex",className:i.displayBox,children:[(0,N.jsx)(a.Z,{children:(0,N.jsx)(y.Z,{className:i.imageButton,style:{color:w.E5},component:"span",onClick:function(){return t(!1)},children:c?(0,N.jsx)("img",{alt:"",src:"data:image/png;base64,".concat(c),className:i.previewImage},"preview"):(0,N.jsx)(T.Z,{className:i.powerOffIcon})})}),(0,N.jsx)(a.Z,{className:i.fullScreenBox,children:(0,N.jsx)(y.Z,{className:i.fullScreenButton,style:{color:w.E5},component:"span",onClick:function(){return t(!1)},children:(0,N.jsx)(z.Z,{})})})]})]})},R=n(210),M=(0,c.Z)((function(e){return{preview:(0,r.Z)({width:"25%",height:"100%"},e.breakpoints.down("md"),{width:"100%"}),fullView:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}}})),V=function(){var e=(0,o.useState)(!0),t=e[0],n=e[1],r=M(),c=(0,i.useRouter)().query,u=c.uuid,l=c.server_name;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(s.default,{children:(0,N.jsx)("title",{children:l})}),(0,N.jsx)(R.Z,{}),"string"===typeof u&&(t?(0,N.jsx)(a.Z,{className:r.preview,children:(0,N.jsx)(L,{setMode:n,uuid:u,serverName:l})}):(0,N.jsx)(a.Z,{className:r.fullView,children:(0,N.jsx)(B,{setMode:n,uuid:u,serverName:l})}))]})}},8954:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return n(5782)}])},5152:function(e,t,n){e.exports=n(8771)},1163:function(e,t,n){e.exports=n(4651)}},function(e){e.O(0,[774,322,888,179],(function(){return t=8954,e(e.s=t);var t}));var t=e.O();_N_E=t}]);