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
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.jsx)(v.Z,{onClick:function(){window&&(J(),window.location.assign("/"))},children:(0,t.jsx)(s.Z,{})})})}),[J]),ee=(0,d.useMemo)((function(){return Q&&(0,t.jsxs)(t.Fragment,{children:[W,Y,X]})}),[W,Y,Q,X]);return(0,d.useEffect)((function(){0===D&&(N(h),K())}),[K,D,h]),(0,d.useEffect)((function(){x&&G()}),[G,x]),(0,t.jsxs)(p.s_,{children:[(0,t.jsxs)(p.V9,{children:[(0,t.jsx)(j.z,{text:"Server: ".concat(c)}),ee]}),(0,t.jsxs)(Z,{children:[(0,t.jsx)(a.Z,{display:Q?"flex":"none",className:A.displayBox,children:(0,t.jsx)(P,{onConnect:H,onDisconnect:q,rfb:R,rfbConnectArgs:F,rfbScreen:L})}),!Q&&(0,t.jsxs)(a.Z,{display:"flex",className:A.spinnerBox,children:[U&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(j.z,{textAlign:"center",children:["Connecting to ",c,"."]}),(0,t.jsx)(b.Z,{})]}),T&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.z,{textAlign:"center",children:"There was a problem connecting to the server."}),(0,t.jsxs)(j.z,{textAlign:"center",mt:"1em",children:["Retrying in ",D,"."]})]})]})]})]})},F=r(4051),E=r.n(F),O=r(5668),U=r(2787),B=r(4799),M=r(7169),T=r(4390),_=r(4690),z=r(9370);function D(e,n,r,t,i,o,s){try{var c=e[o](s),a=c.value}catch(l){return void r(l)}c.done?n(a):Promise.resolve(a).then(t,i)}var N={externalPreview:"",externalTimestamp:0,headerEndAdornment:null,hrefPreview:void 0,isExternalLoading:!1,isExternalPreviewStale:!1,isFetchPreview:!0,isShowControls:!0,isUseInnerPanel:!1,onClickConnectButton:void 0,onClickPreview:void 0,serverName:"",serverState:""},R=function(e){var n=e.children;return e.isUseInnerPanel?(0,t.jsx)(p.Lg,{children:n}):(0,t.jsx)(p.s_,{children:n})},L=function(e){var n=e.children,r=e.isUseInnerPanel,i=e.text;return r?(0,t.jsxs)(p.CH,{children:[i?(0,t.jsx)(j.Ac,{text:i}):(0,t.jsx)(t.Fragment,{}),n]}):(0,t.jsxs)(p.V9,{children:[i?(0,t.jsx)(j.z,{text:i}):(0,t.jsx)(t.Fragment,{}),n]})},$=function(e){var n=e.externalPreview,r=void 0===n?N.externalPreview:n,i=e.externalTimestamp,o=void 0===i?N.externalTimestamp:i,s=e.headerEndAdornment,c=e.hrefPreview,l=e.isExternalLoading,u=void 0===l?N.isExternalLoading:l,f=e.isExternalPreviewStale,h=void 0===f?N.isExternalPreviewStale:f,x=e.isFetchPreview,m=void 0===x?N.isFetchPreview:x,y=e.isShowControls,p=void 0===y?N.isShowControls:y,w=e.isUseInnerPanel,g=void 0===w?N.isUseInnerPanel:w,C=e.onClickPreview,S=e.serverName,k=e.serverState,A=void 0===k?N.serverState:k,Z=e.serverUUID,P=e.onClickConnectButton,I=void 0===P?C:P,F=(0,d.useState)(!0),$=F[0],G=F[1],J=(0,d.useState)(!1),K=J[0],V=J[1],H=(0,d.useState)(""),q=H[0],Q=H[1],W=(0,d.useState)(0),X=W[0],Y=W[1],ee=(0,z.zO)(),ne=(0,d.useMemo)((function(){return"running"===A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Z,{alt:"",component:"img",src:"data:image;base64,".concat(q),sx:{height:"100%",opacity:K?"0.4":"1",padding:g?".2em":0,width:"100%"}}),K&&function(e){var n=(0,z._J)(ee-e),r=n.unit,i=n.value;return(0,t.jsxs)(j.Ac,{position:"absolute",children:["Updated ~",i," ",r," ago"]})}(X)]}):(0,t.jsx)(O.Z,{sx:{color:M.UZ,height:"80%",width:"80%"}})}),[K,g,ee,q,X,A]),re=(0,d.useMemo)((function(){if($)return(0,t.jsx)(b.Z,{mb:"1em",mt:"1em"});var e=!q,n={borderRadius:M.n_,color:M.s7,padding:0};return c?(0,t.jsx)(B.Z,{disabled:e,href:c,sx:n,children:ne}):(0,t.jsx)(B.Z,{component:"span",disabled:e,onClick:C,sx:n,children:ne})}),[c,$,q,ne,C]);return(0,d.useEffect)((function(){var e;m?(e=E().mark((function e(){var n,r,t;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,T.Z.get("/server/".concat(Z,"?ss=1"));case 3:n=e.sent.data,r=n.screenshot,t=n.timestamp,Q(r),Y(t),V(!(0,z.Z$)(t,300)),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),V(!0);case 13:return e.prev=13,G(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,10,13,16]])})),function(){var n=this,r=arguments;return new Promise((function(t,i){var o=e.apply(n,r);function s(e){D(o,t,i,s,c,"next",e)}function c(e){D(o,t,i,s,c,"throw",e)}s(void 0)}))})():u||(Q(r),Y(o),V(h),G(!1))}),[r,o,u,h,m,Z]),(0,t.jsxs)(R,{isUseInnerPanel:g,children:[(0,t.jsx)(L,{isUseInnerPanel:g,text:S,children:s}),(0,t.jsxs)(_.Z,{row:!0,sx:{"& > :first-child":{flexGrow:1}},children:[(0,t.jsx)(a.Z,{textAlign:"center",children:re}),p&&q&&(0,t.jsx)(_.Z,{children:(0,t.jsx)(v.Z,{onClick:I,children:(0,t.jsx)(U.Z,{})})})]})]})};$.defaultProps=N;var G=$},9370:function(e,n,r){function t(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 i(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function o(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,i,o=[],s=!0,c=!1;try{for(r=r.call(e);!(s=(t=r.next()).done)&&(o.push(t.value),!n||o.length!==n);s=!0);}catch(a){c=!0,i=a}finally{try{s||null==r.return||r.return()}finally{if(c)throw i}}return o}}(e,n)||c(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(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.")}()}function c(e,n){if(e){if("string"===typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}r.d(n,{_J:function(){return u},Z$:function(){return l},zO:function(){return a}});var a=function(e){var n=Date.now();return e||(n=Math.floor(n/1e3)),n},l=function(e,n){var r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).ms,t=a(r)-e;return t<=n},u=function(e){var n,r=e,t=o(s([60,60].reduce((function(e,n){var t=r%n;return e.push(t),r=(r-t)/n,e}),[])).concat([r]),3),c=t[0],a=t[1],l=t[2],u=null!==(n=[{unit:"h",value:l},{unit:"m",value:a}].find((function(e){return e.value})))&&void 0!==n?n:{unit:"s",value:c};return function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),t.forEach((function(n){i(e,n,r[n])}))}return e}({h:l,m:a,s:c},u)}}}]);