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
7.4 KiB

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