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
1 line
10 KiB
1 year ago
|
"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 $}});var r=t(5893),i=t(791),o=t(5537),a=t(1496),s=t(7357),c=t(8333),l=t(5861),u=t(5152),f=t(7294),d=t(1706),v="0xffe3",h="0xffe9",x=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[v,h,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[v,h,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[v,h,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[v,h,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[v,h,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[v,h,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[v,h,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[v,h,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[v,h,"0xffc6"]}],m=t(4427),y=t(3679),p=t(2152),b=t(7750),j=t(1081);function g(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 w(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function C(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 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 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 S="FullSize",A={displayBox:"".concat(S,"-displayBox"),spinnerBox:"".concat(S,"-spinnerBox")},k=(0,a.ZP)("div")((function(){var e;return w(e={},"& .".concat(A.displayBox),{width:"75vw",height:"75vh"}),w(e,"& .".concat(A.spinnerBox),{flexDirection:"column",width:"75vw",height:"75vh",alignItems:"center",justifyContent:"center"}),e})),P=(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,a=e.serverName,u=e.vncReconnectTimerStart,v=void 0===u?5:u,h=(0,j.Z)(),g=(0,f.useState)(null),w=g[0],S=g[1],Z=(0,f.useState)(void 0),I=Z[0],F=Z[1],E=(0,f.useState)(!1),O=E[0],U=E[1],B=(0,f.useState)(!1),M=B[0],T=B[1],_=(0,f.useState)(v),z=_[0],D=_[1],N=(0,f.useRef)(null),R=(0,f.useRef)(null),L=function(e){S(e.currentTarget)},$=(0,f.useCallback)((function(){var e,n;U(!0),T(!1),F({url:(e=window.location.host,n=t,"ws://".concat(e,"/ws/server/vnc/").concat(n))})}),[t]),G=(0,f.useCallback)((function(){F(void 0)}),[]),J=(0,f.useCallback)((function(){(null===N||void 0===N?void 0:N.current)&&(N.current.disconnect(),N.current=null,$())}),[$]),K=(0,f.useCallback)((function(){var e=setInterval((function(){D((function(n){var t=n-1;return t<1&&clearInterval(e),t}))}),1e3)}),[]),V=(0,f.useCallback)((function(){U(!1)}),[]),H=(0,f.useCallback)((function(e){e.detail.clean||(U(!1),T(!0),K())}),[K]),q=(0,f.useMemo)((function(){return!O&&!M}),[O,M]),Q=(0,f.useMemo)((function(){return(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(d.Z,{onClick:L,children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)(c.Z,{anchorEl:w,keepMounted:!0,open:Boolean(w),onClose:function(){return S(null)},children:x.map((function(e){var n=e.keys,t=e.scans;return(0,r.jsx)(m.Z,{onClick:function(){return function(e){if(N.current){if(e.length){for(var n=0;n<=e.length-1;n+=1)N.current.sendKey(e[n],1);for(var t=e.length-1;t>=0;t-=1)N.current.sendKey(e[t],0)}else N.current.sendCtrlAltDel();S(null)}}(t)},children:(0,r.jsx)(l.Z,{variant:"subtitle1",children:n})},n)}))})]})}),[w]),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 i;G(),null===n||void 0===n||(i=n).call.apply(i,[null].concat(C(t)))},variant:"redcontained",children:(0,r.jsx)(o.Z,{})})}),[G,n]),X=(0,f.useMemo)((function(){return q&&(0,r.jsxs)(r.Fragment,{children:[Q,W]})}),[
|