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 line
10 KiB

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[94],{5094:function(e,n,r){r.d(n,{S:function(){return I},M:function(){return G}});var t=r(5893),i=r(791),o=r(5537),s=r(4433),c=r(1496),a=r(7357),l=r(8333),u=r(5861),f=r(5152),d=r(7294),v=r(1706),h="0xffe3",x="0xffe9",m=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[h,x,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[h,x,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[h,x,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[h,x,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[h,x,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[h,x,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[h,x,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[h,x,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[h,x,"0xffc6"]}],y=r(4427),p=r(3679),b=r(2152),j=r(7750),w=r(1081);function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}function C(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function S(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"===typeof e)return g(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var k="FullSize",A={displayBox:"".concat(k,"-displayBox"),spinnerBox:"".concat(k,"-spinnerBox")},Z=(0,c.ZP)("div")((function(){var e;return C(e={},"& .".concat(A.displayBox),{width:"75vw",height:"75vh"}),C(e,"& .".concat(A.spinnerBox),{flexDirection:"column",width:"75vw",height:"75vh",alignItems:"center",justifyContent:"center"}),e})),P=(0,f.default)((function(){return Promise.all([r.e(460),r.e(665)]).then(r.bind(r,4665))}),{loadableGenerated:{webpack:function(){return[4665]}},ssr:!1}),I=function(e){var n=e.onClickCloseButton,r=e.serverUUID,c=e.serverName,f=e.vncReconnectTimerStart,h=void 0===f?5:f,x=(0,w.Z)(),g=(0,d.useState)(null),C=g[0],k=g[1],I=(0,d.useState)(void 0),F=I[0],E=I[1],O=(0,d.useState)(!1),U=O[0],B=O[1],M=(0,d.useState)(!1),T=M[0],_=M[1],z=(0,d.useState)(h),D=z[0],N=z[1],R=(0,d.useRef)(null),L=(0,d.useRef)(null),$=function(e){k(e.currentTarget)},G=(0,d.useCallback)((function(){var e,n;B(!0),_(!1),E({url:(e=window.location.host,n=r,"ws://".concat(e,"/ws/server/vnc/").concat(n))})}),[r]),J=(0,d.useCallback)((function(){(null===R||void 0===R?void 0:R.current)&&(R.current.disconnect(),R.current=null),E(void 0)}),[]),K=(0,d.useCallback)((function(){J(),G()}),[G,J]),V=(0,d.useCallback)((function(){var e=setInterval((function(){N((function(n){var r=n-1;return r<1&&clearInterval(e),r}))}),1e3)}),[]),H=(0,d.useCallback)((function(){B(!1)}),[]),q=(0,d.useCallback)((function(e){e.detail.clean||(B(!1),_(!0),V())}),[V]),Q=(0,d.useMemo)((function(){return!U&&!T}),[U,T]),W=(0,d.useMemo)((function(){return(0,t.jsxs)(a.Z,{children:[(0,t.jsx)(v.Z,{onClick:$,children:(0,t.jsx)(i.Z,{})}),(0,t.jsx)(l.Z,{anchorEl:C,keepMounted:!0,open:Boolean(C),onClose:function(){return k(null)},children:m.map((function(e){var n=e.keys,r=e.scans;return(0,t.jsx)(y.Z,{onClick:function(){return function(e){if(R.current){if(e.length){for(var n=0;n<=e.length-1;n+=1)R.current.sendKey(e[n],1);for(var r=e.length-1;r>=0;r-=1)R.current.sendKey(e[r],0)}else R.current.sendCtrlAltDel();k(null)}}(r)},children:(0,t.jsx)(u.Z,{variant:"subtitle1",children:n})},n)}))})]})}),[C]),X=(0,d.useMemo)((function(){return(0,t.jsx)(a.Z,{children:(0,t.jsx)(v.Z,{onClick:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var i;J(),null===n||void 0===n||(i=n).call.apply(i,[null].concat(S(r)))},children:(0,t.jsx)(o.Z,{})})})}),[J,n]),Y=(0,d.useMemo)((function(){return(0,t.jsx)(a.Z,{children:(0,t