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

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{8954:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/server",function(){return t(8266)}])},8750:function(e,n,t){"use strict";t.d(n,{Z:function(){return N}});var r=t(5893),o=t(7294),i=t(5258),s=t(1120),a=t(253),c=t(282),l=[{text:"Files",image:"/pngs/files_on.png",uri:"/striker?files=true"},{text:"Tasks",image:"/pngs/tasks_no-jobs_icon.png",uri:"/striker?jobs=true"},{text:"Configure",image:"/pngs/configure_icon_on.png",uri:"/striker?configure=true"},{text:"Striker",image:"/pngs/striker_icon_on.png",uri:"/striker?striker=true"},{text:"Anvil",image:"/pngs/anvil_icon_on.png",uri:"/striker?anvil=true"},{text:"Email",image:"/pngs/email_on.png",uri:"/striker?email=true"},{text:"Logout",image:"/pngs/users_icon_on.png",uri:"/striker?logout=true"},{text:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],u={width:"40em",height:"40em"},d=t(7169),p=t(8008),f=t(2822),h=t(998),m=t(5517),x=t(5154),g=t(442),v=t(3430);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 j(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){b(e,n,t[n])}))}return e}var w=(0,s.Z)((function(){return(0,x.Z)({list:{width:"200px"},divider:{background:d.d},text:{paddingTop:".5em",paddingLeft:"1.5em"},dashboardButton:{paddingLeft:".1em"},dashboardIcon:{fontSize:"2.3em",color:d.s7}})})),y=function(e){var n=e.open,t=e.setOpen,o=w();return(0,r.jsx)(p.ZP,{BackdropProps:{invisible:!0},anchor:"left",open:n,onClose:function(){return t(!n)},children:(0,r.jsx)("div",{role:"presentation",children:(0,r.jsxs)(f.Z,{className:o.list,children:[(0,r.jsx)(h.Z,{button:!0,children:(0,r.jsx)(v.z,{text:"Admin"})}),(0,r.jsx)(m.Z,{className:o.divider}),(0,r.jsx)(h.Z,{button:!0,component:"a",href:"/index.html",children:(0,r.jsxs)(a.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,r.jsx)(a.Z,{className:o.dashboardButton,children:(0,r.jsx)(g.Z,{className:o.dashboardIcon})}),(0,r.jsx)(a.Z,{flexGrow:1,className:o.text,children:(0,r.jsx)(v.A,{text:"Dashboard"})})]})}),l.map((function(e){return(0,r.jsx)(h.Z,{button:!0,component:"a",href:-1!==e.uri.search(/^https?:/)?e.uri:"".concat("/cgi-bin").concat(e.uri),children:(0,r.jsxs)(a.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,r.jsx)(a.Z,{children:(0,r.jsx)("img",j({alt:"",src:e.image},u),"icon")}),(0,r.jsx)(a.Z,{flexGrow:1,className:o.text,children:(0,r.jsx)(v.A,{text:e.text})})]})},e.image)}))]})})})};function k(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){k(e,n,t[n])}))}return e}var C=(0,s.Z)((function(e){return{appBar:{paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5),paddingLeft:e.spacing(3),paddingRight:e.spacing(3),borderBottom:"solid 1px",borderBottomColor:d.hM},input:{height:"2.8em",width:"30vw",backgroundColor:e.palette.secondary.main,borderRadius:d.n_},barElement:{padding:0},iconBox:k({},e.breakpoints.down("sm"),{display:"none"}),searchBar:k({},e.breakpoints.down("sm"),{flexGrow:1,paddingLeft:"15vw"}),icons:{paddingLeft:".1em",paddingRight:".1em"}}})),N=function(){var e=C(),n=(0,o.useState)(!1),t=n[0],s=n[1];return(0,r.jsxs)(i.Z,{position:"static",className:e.appBar,children:[(0,r.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,r.jsx)(a.Z,{className:e.barElement,children:(0,r.jsx)(c.Z,{onClick:function(){return s(!t)},children:(0,r.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,r.jsx)(a.Z,{className:"".concat(e.barElement," ").concat(e.iconBox),children:l.map((function(n){return(0,r.jsx)("a",{href:-1!==n.uri.search(/^https?:/)?n.uri:"".concat("/cgi-bin").concat(n.uri),children:(0,r.jsx)("img",Z({alt:"",src:n.image},u,{className:e.icons}),"icon")},n.uri)}))})]}),(0,r.jsx)(y,{open:t,setOpen:s})]})}},4365:function(e,n,t){"use strict";t.d(n,{Lg:function(){return u},s_:function(){return p},V9:function(){return c}});var r=t(5893),o=t(253),i=t(1120),s=t(7169),a=(0,i.Z)((function(){return{innerHeader:{position:"relative",padding:"0 .7em"},header:{top:"-.3em",left:"-.3em",padding:"1.4em 0",position:"absolute",content:'""',borderColor:s.d,borderWidth:"1px",borderRadius:s.n_,borderStyle:"solid",width:"100%"}}})),c=function(e){var n=e.children,t=a();return(0,r.jsxs)(o.Z,{className:t.innerHeader,whiteSpace:"pre-wrap",children:[(0,r.jsx)("div",{className:t.header}),n]})},l=(0,i.Z)((function(){return{innerBody:{borderWidth:"1px",borderRadius:s.n_,borderStyle:"solid",borderColor:s.d,marginTop:"1.4em",marginBottom:"1.4em",paddingBottom:0,position:"relative"}}})),u=function(e){var n=e.children,t=l();return(0,r.jsx)(o.Z,{className:t.innerBody,children:n})},d=(0,i.Z)((function(){return{paper:{padding:"2.1em",backgroundColor:s.v9,opacity:.8,zIndex:999},container:{margin:"1em",position:"relative"},square:{content:'""',position:"absolute",width:"2.1em",height:"2.1em",border:"1px",borderColor:s.lD,borderWidth:"1px",borderRadius:s.n_,borderStyle:"solid",padding:0,margin:0},topSquare:{top:"-.3em",left:"-.3em"},bottomSquare:{bottom:"-.3em",right:"-.3em"},"@global":{"*::-webkit-scrollbar":{width:".6em"},"*::-webkit-scrollbar-track":{backgroundColor:s.v9},"*::-webkit-scrollbar-thumb":{backgroundColor:s.lD,outline:"1px solid transparent",borderRadius:s.n_}}}})),p=function(e){var n=e.children,t=d();return(0,r.jsxs)("div",{className:t.container,children:[(0,r.jsx)("div",{className:"".concat(t.square," ").concat(t.topSquare)}),(0,r.jsx)("div",{className:"".concat(t.square," ").concat(t.bottomSquare)}),(0,r.jsx)("div",{className:t.paper,children:n})]})}},2152:function(e,n,t){"use strict";var r=t(5893),o=t(1120),i=t(5477),s=t(7169),a=(0,o.Z)((function(){return{root:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:"3em"},spinner:{color:s.lD,variant:"indeterminate",size:"50em"}}}));n.Z=function(){var e=a();return(0,r.jsx)("div",{className:e.root,children:(0,r.jsx)(i.Z,{className:e.spinner})})}},3430:function(e,n,t){"use strict";t.d(n,{A:function(){return d},z:function(){return c}});var r=t(5893),o=t(2318),i=t(1591),s=t(7169),a=(0,i.Z)({root:{color:s.lD}})(o.Z),c=function(e){var n=e.text;return(0,r.jsx)(a,{variant:"h4",children:n})},l=(0,t(1120).Z)((function(){return{selected:{color:s.lD},unselected:{color:s.UZ}}})),u=function(e){var n=e.text,t=e.selected,i=l();return(0,r.jsx)(o.Z,{variant:"subtitle1",className:t?i.selected:i.unselected,children:n})};u.defaultProps={selected:!0};var d=u},8336:function(e,n){"use strict";n.Z=function(e,n){return fetch(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}},8266:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return M}});var r=t(5893),o=t(7294),i=t(1163),s=t(9008),a=t(253),c=t(1120),l=t(4051),u=t.n(l),d=t(5152),p=t(5681),f=t(5639),h=t(2318),m=t(282),x=t(366),g=t(2617),v=t(7812),b=t(4365),j=t(7169),w="0xffe3",y="0xffe9",k=[{keys:"Ctrl + Alt + Delete",scans:[]},{keys:"Ctrl + Alt + F1",scans:[w,y,"0xffbe"]},{keys:"Ctrl + Alt + F2",scans:[w,y,"0xffbf"]},{keys:"Ctrl + Alt + F3",scans:[w,y,"0xffc0"]},{keys:"Ctrl + Alt + F4",scans:[w,y,"0xffc1"]},{keys:"Ctrl + Alt + F5",scans:[w,y,"0xffc2"]},{keys:"Ctrl + Alt + F6",scans:[w,y,"0xffc3"]},{keys:"Ctrl + Alt + F7",scans:[w,y,"0xffc4"]},{keys:"Ctrl + Alt + F8",scans:[w,y,"0xffc5"]},{keys:"Ctrl + Alt + F9",scans:[w,y,"0xffc6"]}],Z=t(8336);function C(e,n,t,r,o,i,s){try{var a=e[i](s),c=a.value}catch(l){return void t(l)}a.done?n(c):Promise.resolve(c).then(r,o)}var N=function(){var e,n=(e=u().mark((function e(n,t,r){var o,i,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new AbortController,i=setTimeout((function(){return o.abort()}),r),e.next=4,fetch(n,{method:"PUT",headers:{"Content-Type":"application/json","Keep-Alive":"timeout=120"},signal:o.signal,body:JSON.stringify(t)});case 4:return s=e.sent,clearTimeout(i),e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function s(e){C(i,r,o,s,a,"next",e)}function a(e){C(i,r,o,s,a,"throw",e)}s(void 0)}))});return function(e,t,r){return n.apply(this,arguments)}}(),_=N,B=t(3430),S=t(2152);function O(e,n,t,r,o,i,s){try{var a=e[i](s),c=a.value}catch(l){return void t(l)}a.done?n(c):Promise.resolve(c).then(r,o)}function D(e){return function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function s(e){O(i,r,o,s,a,"next",e)}function a(e){O(i,r,o,s,a,"throw",e)}s(void 0)}))}}var T=(0,d.default)((function(){return Promise.all([t.e(460),t.e(665)]).then(t.bind(t,4665))}),{loadableGenerated:{webpack:function(){return[4665]}},ssr:!1}),P=(0,c.Z)((function(){return{displayBox:{width:"75vw",height:"75vh",paddingTop:"1em",paddingBottom:0,paddingLeft:0,paddingRight:0},spinnerBox:{flexDirection:"column",width:"75vw",height:"75vh",alignItems:"center",justifyContent:"center"},closeButton:{borderRadius:8,backgroundColor:j.hM,"&:hover":{backgroundColor:j.hM}},keyboardButton:{borderRadius:8,backgroundColor:j.lD,"&:hover":{backgroundColor:j.lD}},closeBox:{paddingBottom:"1em",paddingLeft:".7em",paddingRight:0},buttonsBox:{paddingTop:0},keysItem:{backgroundColor:j.lD,paddingRight:"3em","&:hover":{backgroundColor:j.lD}},buttonText:{color:j.E5}}})),E=function(e){var n=e.setMode,t=e.uuid,i=e.serverName,s=(0,o.useState)(null),c=s[0],l=s[1],d=(0,o.useRef)(),w=(0,o.useRef)(void 0),y=(0,o.useState)(void 0),C=y[0],N=y[1],O=(0,o.useState)(!1),E=O[0],A=O[1],R=P();(0,o.useEffect)((function(){w.current=window.location.hostname,C||D(u().mark((function e(){var n;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,_("".concat("/cgi-bin","/manage_vnc_pipes"),{server_uuid:t,is_open:!0},12e4);case 3:return n=e.sent,e.t0=N,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),A(!0);case 14:case"end":return e.stop()}}),e,null,[[0,11]])})))()}),[t,C,E]);var F=function(){var e=D(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.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,r.jsxs)(b.s_,{children:[(0,r.jsx)(a.Z,{flexGrow:1,children:(0,r.jsx)(B.z,{text:"Server: ".concat(i)})}),C?(0,r.jsxs)(a.Z,{display:"flex",className:R.displayBox,children:[(0,r.jsx)(T,{rfb:d,url:"".concat(C.protocol,"://").concat(w.current,":").concat(C.forward_port),viewOnly:!1,focusOnClick:!1,clipViewport:!1,dragViewport:!1,scaleViewport:!0,resizeSession:!0,showDotCursor:!1,background:"",qualityLevel:6,compressionLevel:2}),(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(a.Z,{className:R.closeBox,children:(0,r.jsx)(v.Z,{className:R.closeButton,style:{color:j.lD},component:"span",onClick:function(){F(),n(!0)},children:(0,r.jsx)(x.Z,{})})}),(0,r.jsxs)(a.Z,{className:R.closeBox,children:[(0,r.jsx)(v.Z,{className:R.keyboardButton,style:{color:j.E5},component:"span",onClick:function(e){l(e.currentTarget)},children:(0,r.jsx)(g.Z,{})}),(0,r.jsx)(p.Z,{anchorEl:c,keepMounted:!0,open:Boolean(c),onClose:function(){return l(null)},children:k.map((function(e){var n=e.keys,t=e.scans;return(0,r.jsx)(f.Z,{onClick:function(){return function(e){if(d.current){if(e.length){for(var n=0;n<=e.length-1;n+=1)d.current.sendKey(e[n],1);for(var t=e.length-1;t>=0;t-=1)d.current.sendKey(e[t],0)}else d.current.sendCtrlAltDel();l(null)}}(t)},className:R.keysItem,children:(0,r.jsx)(h.Z,{variant:"subtitle1",children:n})},n)}))})]})]})]}):(0,r.jsx)(a.Z,{display:"flex",className:R.spinnerBox,children:E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{style:{paddingBottom:"2em"},children:(0,r.jsx)(B.z,{text:"There was a problem connecting to the server, please try again"})}),(0,r.jsx)(m.Z,{variant:"contained",onClick:function(){A(!1)},style:{textTransform:"none"},children:(0,r.jsx)(h.Z,{className:R.buttonText,variant:"subtitle1",children:"Reconnect"})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(B.z,{text:"Establishing connection with ".concat(i)}),(0,r.jsx)(B.z,{text:"This may take a few minutes"}),(0,r.jsx)(S.Z,{})]})})]})},A=t(306),R=t(5358);function F(e,n,t,r,o,i,s){try{var a=e[i](s),c=a.value}catch(l){return void t(l)}a.done?n(c):Promise.resolve(c).then(r,o)}var L=(0,c.Z)((function(){return{displayBox:{padding:0,paddingTop:".7em",width:"100%"},fullScreenButton:{borderRadius:8,backgroundColor:j.lD,"&:hover":{backgroundColor:j.lD}},fullScreenBox:{paddingLeft:"1em",padding:0},imageButton:{padding:0,color:j.lD},powerOffIcon:{borderRadius:8,padding:0,color:j.s7,width:"100%",height:"100%"},previewImage:{width:"100%",height:"100%"}}})),z=function(e){var n=e.setMode,t=e.uuid,i=e.serverName,s=L(),c=(0,o.useState)(),l=c[0],d=c[1];return(0,o.useEffect)((function(){var e;(e=u().mark((function e(){var n,r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat("/cgi-bin","/get_server_screenshot?server_uuid=").concat(t),{method:"GET",headers:{"Content-Type":"application/json"}});case 3:return n=e.sent,e.next=6,n.json();case 6:r=e.sent.screenshot,d(r),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),d("");case 13:case"end":return e.stop()}}),e,null,[[0,10]])})),function(){var n=this,t=arguments;return new Promise((function(r,o){var i=e.apply(n,t);function s(e){F(i,r,o,s,a,"next",e)}function a(e){F(i,r,o,s,a,"throw",e)}s(void 0)}))})()}),[t]),(0,r.jsxs)(b.s_,{children:[(0,r.jsx)(a.Z,{flexGrow:1,children:(0,r.jsx)(B.z,{text:"Server: ".concat(i)})}),(0,r.jsxs)(a.Z,{display:"flex",className:s.displayBox,children:[(0,r.jsx)(a.Z,{children:(0,r.jsx)(v.Z,{className:s.imageButton,style:{color:j.E5},component:"span",onClick:function(){return n(!1)},children:l?(0,r.jsx)("img",{alt:"",src:"data:image/png;base64,".concat(l),className:s.previewImage},"preview"):(0,r.jsx)(R.Z,{className:s.powerOffIcon})})}),(0,r.jsx)(a.Z,{className:s.fullScreenBox,children:(0,r.jsx)(v.Z,{className:s.fullScreenButton,style:{color:j.E5},component:"span",onClick:function(){return n(!1)},children:(0,r.jsx)(A.Z,{})})})]})]})},I=t(8750);var q=(0,c.Z)((function(e){return{preview:(n={width:"25%",height:"100%"},t=e.breakpoints.down("md"),r={width:"100%"},t in n?Object.defineProperty(n,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[t]=r,n),fullView:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}};var n,t,r})),M=function(){var e=(0,o.useState)(!0),n=e[0],t=e[1],c=q(),l=(0,i.useRouter)().query,u=l.uuid,d=l.server_name;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.default,{children:(0,r.jsx)("title",{children:d})}),(0,r.jsx)(I.Z,{}),"string"===typeof u&&(n?(0,r.jsx)(a.Z,{className:c.preview,children:(0,r.jsx)(z,{setMode:t,uuid:u,serverName:d})}):(0,r.jsx)(a.Z,{className:c.fullView,children:(0,r.jsx)(E,{setMode:t,uuid:u,serverName:d})}))]})}}},function(e){e.O(0,[321,145,774,888,179],(function(){return n=8954,e(e.s=n);var n}));var n=e.O();_N_E=n}]);