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

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[906],{7906:function(e,n,t){t.d(n,{S:function(){return R},M:function(){return J}});var r=t(4051),o=t.n(r),s=t(5893),c=t(7294),a=t(5152),i=t(7357),l=t(4799),u=t(8333),d=t(9309),f=t(5861),x=t(3321),h=t(1496),v=t(594),p=t(1846),m=t(3679),y=t(7169),g="0xffe3",w="0xffe9",b=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[g,w,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[g,w,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[g,w,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[g,w,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[g,w,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[g,w,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[g,w,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[g,w,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[g,w,"0xffc6"]}],j=t(8336);function k(e,n,t,r,o,s,c){try{var a=e[s](c),i=a.value}catch(l){return void t(l)}a.done?n(i):Promise.resolve(i).then(r,o)}var C=function(){var e,n=(e=o().mark((function e(n,t,r){var s,c,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=new AbortController,c=setTimeout((function(){return s.abort()}),r),e.next=4,fetch(n,{method:"PUT",headers:{"Content-Type":"application/json","Keep-Alive":"timeout=120"},signal:s.signal,body:JSON.stringify(t)});case 4:return a=e.sent,clearTimeout(c),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(r,o){var s=e.apply(n,t);function c(e){k(s,r,o,c,a,"next",e)}function a(e){k(s,r,o,c,a,"throw",e)}c(void 0)}))});return function(e,t,r){return n.apply(this,arguments)}}(),B=C,P=t(2416),Z=t(2152);function A(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 S(e,n,t,r,o,s,c){try{var a=e[s](c),i=a.value}catch(l){return void t(l)}a.done?n(i):Promise.resolve(i).then(r,o)}function F(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var s=e.apply(n,t);function c(e){S(s,r,o,c,a,"next",e)}function a(e){S(s,r,o,c,a,"throw",e)}c(void 0)}))}}function I(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function T(e){return function(e){if(Array.isArray(e))return A(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 A(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 A(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 _="FullSize",E={displayBox:"".concat(_,"-displayBox"),spinnerBox:"".concat(_,"-spinnerBox"),closeButton:"".concat(_,"-closeButton"),keyboardButton:"".concat(_,"-keyboardButton"),closeBox:"".concat(_,"-closeBox"),buttonsBox:"".concat(_,"-buttonsBox"),keysItem:"".concat(_,"-keysItem"),buttonText:"".concat(_,"-buttonText")},N=(0,h.ZP)("div")((function(){var e;return I(e={},"& .".concat(E.displayBox),{width:"75vw",height:"75vh",paddingTop:"1em",paddingBottom:0,paddingLeft:0,paddingRight:0}),I(e,"& .".concat(E.spinnerBox),{flexDirection:"column",width:"75vw",height:"75vh",alignItems:"center",justifyContent:"center"}),I(e,"& .".concat(E.closeButton),{borderRadius:8,backgroundColor:y.hM,"&:hover":{backgroundColor:y.hM}}),I(e,"& .".concat(E.keyboardButton),{borderRadius:8,backgroundColor:y.lD,"&:hover":{backgroundColor:y.lD}}),I(e,"& .".concat(E.closeBox),{paddingBottom:"1em",paddingLeft:".7em",paddingRight:0}),I(e,"& .".concat(E.buttonsBox),{paddingTop:0}),I(e,"& .".concat(E.keysItem),{backgroundColor:y.lD,paddingRight:"3em","&:hover":{backgroundColor:y.lD}}),I(e,"& .".concat(E.buttonText),{color:y.E5}),e})),U=(0,a.default)((function(){return Promise.all([t.e(460),t.e(665)]).then(t.bind(t,4665))}),{loadableGenerated:{webpack:function(){return[4665]}},ssr:!1}),D=function(e){var n=e.onClickCloseButton,t=e.serverUUID,r=e.serverName,a=(0,c.useState)(null),h=a[0],g=a[1],w=(0,c.useRef)(),k=(0,c.useRef)(void 0),C=(0,c.useState)(void 0),A=C[0],S=C[1],I=(0,c.useState)(!1),_=I[0],D=I[1];(0,c.useEffect)((function(){k.current=window.location.hostname,A||F(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,B("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:t,is_open:!0},12e4);case 3:return n=e.sent,e.t0=S,e.next=7,n.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),D(!0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[t,A,_]);var R=function(){var e=F(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,j.Z)("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:t,is_open:!1});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,s.jsx)(m.s_,{children:(0,s.jsxs)(N,{children:[(0,s.jsx)(i.Z,{flexGrow:1,children:(0,s.jsx)(P.z,{text:"Server: ".concat(r)})}),A?(0,s.jsxs)(i.Z,{display:"flex",className:E.displayBox,children:[(0,s.jsx)(U,{rfb:w,url:"".concat(A.protocol,"://").concat(k.current,":").concat(A.forward_port),viewOnly:!1,focusOnClick:!1,clipViewport:!1,dragViewport:!1,scaleViewport:!0,resizeSession:!0,showDotCursor:!1,background:"",qualityLevel:6,compressionLevel:2}),(0,s.jsxs)(i.Z,{children:[(0,s.jsx)(i.Z,{className:E.closeBox,children:(0,s.jsx)(l.Z,{className:E.closeButton,style:{color:y.lD},component:"span",onClick:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o;R(),null===n||void 0===n||(o=n).call.apply(o,[null].concat(T(t)))},children:(0,s.jsx)(v.Z,{})})}),(0,s.jsxs)(i.Z,{className:E.closeBox,children:[(0,s.jsx)(l.Z,{className:E.keyboardButton,style:{color:y.E5},component:"span",onClick:function(e){g(e.currentTarget)},children:(0,s.jsx)(p.Z,{})}),(0,s.jsx)(u.Z,{anchorEl:h,keepMounted:!0,open:Boolean(h),onClose:function(){return g(null)},children:b.map((function(e){var n=e.keys,t=e.scans;return(0,s.jsx)(d.Z,{onClick:function(){return function(e){if(w.current){if(e.length){for(var n=0;n<=e.length-1;n+=1)w.current.sendKey(e[n],1);for(var t=e.length-1;t>=0;t-=1)w.current.sendKey(e[t],0)}else w.current.sendCtrlAltDel();g(null)}}(t)},className:E.keysItem,children:(0,s.jsx)(f.Z,{variant:"subtitle1",children:n})},n)}))})]})]})]}):(0,s.jsx)(i.Z,{display:"flex",className:E.spinnerBox,children:_?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{style:{paddingBottom:"2em"},children:(0,s.jsx)(P.z,{text:"There was a problem connecting to the server, please try again"})}),(0,s.jsx)(x.Z,{variant:"contained",onClick:function(){D(!1)},style:{textTransform:"none"},children:(0,s.jsx)(f.Z,{className:E.buttonText,variant:"subtitle1",children:"Reconnect"})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.z,{text:"Establishing connection with ".concat(r)}),(0,s.jsx)(P.z,{text:"This may take a few minutes"}),(0,s.jsx)(Z.Z,{})]})})]})})};D.defaultProps={onClickCloseButton:void 0};var R=D,z=t(9628),O=t(2787),L=t(2029),M=t(1706);function V(e,n,t,r,o,s,c){try{var a=e[s](c),i=a.value}catch(l){return void t(l)}a.done?n(i):Promise.resolve(i).then(r,o)}var G={externalPreview:"",headerEndAdornment:null,isExternalPreviewStale:!1,isFetchPreview:!0,isShowControls:!0,isUseInnerPanel:!1,onClickConnectButton:void 0,onClickPreview:void 0,serverName:""},K=function(e){var n=e.children;return e.isUseInnerPanel?(0,s.jsx)(m.Lg,{children:n}):(0,s.jsx)(m.s_,{children:n})},q=function(e){var n=e.children,t=e.isUseInnerPanel,r=e.text;return t?(0,s.jsxs)(m.CH,{children:[r?(0,s.jsx)(P.Ac,{text:r}):(0,s.jsx)(s.Fragment,{}),n]}):(0,s.jsxs)(m.V9,{children:[r?(0,s.jsx)(P.z,{text:r}):(0,s.jsx)(s.Fragment,{}),n]})},H=function(e){var n=e.externalPreview,t=void 0===n?G.externalPreview:n,r=e.headerEndAdornment,a=e.isExternalPreviewStale,u=void 0===a?G.isExternalPreviewStale:a,d=e.isFetchPreview,f=void 0===d?G.isFetchPreview:d,x=e.isShowControls,h=void 0===x?G.isShowControls:x,v=e.isUseInnerPanel,p=void 0===v?G.isUseInnerPanel:v,m=e.onClickPreview,g=e.serverName,w=e.serverUUID,b=e.onClickConnectButton,j=void 0===b?m:b,k=(0,c.useState)(!1),C=k[0],B=k[1],P=(0,c.useState)(""),Z=P[0],A=P[1];return(0,c.useEffect)((function(){var e;f?(e=o().mark((function e(){var n,t,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat(L.Z,"/server/").concat(w,"?ss"),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=e.sent,e.next=6,n.json();case 6:t=e.sent,r=t.screenshot,A(r),B(!1),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),B(!0);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var s=e.apply(n,t);function c(e){V(s,r,o,c,a,"next",e)}function a(e){V(s,r,o,c,a,"throw",e)}c(void 0)}))})():t&&(A(t),B(u))}),[t,u,f,w]),(0,s.jsxs)(K,{isUseInnerPanel:p,children:[(0,s.jsx)(q,{isUseInnerPanel:p,text:g,children:r}),(0,s.jsxs)(i.Z,{sx:{display:"flex",width:"100%","& > :not(:last-child)":{marginRight:"1em"}},children:[(0,s.jsx)(i.Z,{children:(0,s.jsx)(l.Z,{component:"span",onClick:m,sx:{borderRadius:y.n_,color:y.s7,padding:0},children:Z?(0,s.jsx)(i.Z,{alt:"",component:"img",src:"data:image/png;base64,".concat(Z),sx:{height:"100%",opacity:C?"0.4":"1",padding:p?".2em":0,width:"100%"}}):(0,s.jsx)(z.Z,{sx:{height:"100%",width:"100%"}})})}),h&&(0,s.jsx)(i.Z,{children:(0,s.jsx)(M.Z,{onClick:j,children:(0,s.jsx)(O.Z,{})})})]})]})};H.defaultProps=G;var J=H}}]);