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
6.8 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(1142)}])},8750:function(e,n,t){"use strict";t.d(n,{Z:function(){return V}});var r=t(5893),o=t(1113),i=t(1496),c=t(2293),a=t(7357),l=t(2992),s=t(4799),u=t(7294),d=t(7169),f=t(4433),p=t(9029),g=t(7533),h=t(8462),v=t(7212),m=t(8619),x=[{text:"Anvil",image:"/pngs/anvil_icon_on.png",uri:"/manage-element"},{text:"Files",image:"/pngs/files_on.png",uri:"/file-manager"},{text:"Configure",image:"/pngs/configure_icon_on.png",uri:"/config"},{text:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],j={width:"40em",height:"40em"},b=t(4390),w=t(582),Z=t(4690),y=t(1770),O=t(7750),k=t(1883);function _(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){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){_(e,n,t[n])}))}return e}var P="AnvilDrawer",S={actionIcon:"".concat(P,"-actionIcon"),list:"".concat(P,"-list")},N=(0,i.ZP)(g.ZP)((function(){var e;return _(e={},"& .".concat(S.list),{width:"200px"}),_(e,"& .".concat(S.actionIcon),{fontSize:"2.3em",color:d.of}),e})),B=function(e){var n=e.open,t=e.setOpen,o=(0,(0,k.Z)().getSessionUser)();return(0,r.jsx)(N,{BackdropProps:{invisible:!0},anchor:"left",open:n,onClose:function(){return t(!n)},children:(0,r.jsx)("div",{role:"presentation",children:(0,r.jsxs)(h.Z,{className:S.list,children:[(0,r.jsx)(v.ZP,{children:(0,r.jsx)(O.Ac,{children:o?(0,r.jsxs)(r.Fragment,{children:["Welcome, ",o.name]}):"Unregistered"})}),(0,r.jsx)(w.Z,{}),(0,r.jsx)(m.Z,{component:"a",href:"/index.html",children:(0,r.jsxs)(Z.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(f.Z,{className:S.actionIcon}),(0,r.jsx)(O.Ac,{children:"Dashboard"})]})}),x.map((function(e){return(0,r.jsx)(m.Z,{component:"a",href:e.uri,children:(0,r.jsxs)(Z.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)("img",C({alt:e.text,src:e.image},j)),(0,r.jsx)(O.Ac,{children:e.text})]})},"anvil-drawer-".concat(e.image))})),(0,r.jsx)(m.Z,{onClick:function(){b.Z.put("/auth/logout").then((function(){window.location.replace("/login")})).catch((function(e){(0,y.Z)(e)}))},children:(0,r.jsxs)(Z.Z,{fullWidth:!0,row:!0,spacing:"2em",children:[(0,r.jsx)(p.Z,{className:S.actionIcon}),(0,r.jsx)(O.Ac,{children:"Logout"})]})})]})})})},E=t(3377),D=t(2444);function A(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var I="Header",R={input:"".concat(I,"-input"),barElement:"".concat(I,"-barElement"),iconBox:"".concat(I,"-iconBox"),searchBar:"".concat(I,"-searchBar"),icons:"".concat(I,"-icons")},U=(0,i.ZP)(c.Z)((function(e){var n,t=e.theme;return A(n={paddingTop:t.spacing(.5),paddingBottom:t.spacing(.5),paddingLeft:t.spacing(3),paddingRight:t.spacing(3),borderBottom:"solid 1px",borderBottomColor:d.hM,position:"static"},"& .".concat(R.input),{height:"2.8em",width:"30vw",backgroundColor:t.palette.secondary.main,borderRadius:d.n_}),A(n,"& .".concat(R.barElement),{padding:0}),A(n,"& .".concat(R.iconBox),A({},t.breakpoints.down("sm"),{display:"none"})),A(n,"& .".concat(R.searchBar),A({},t.breakpoints.down("sm"),{flexGrow:1,paddingLeft:"15vw"})),A(n,"& .".concat(R.icons),{paddingLeft:".1em",paddingRight:".1em"}),n})),V=function(){var e=(0,u.useRef)({}),n=(0,u.useRef)({}),t=(0,u.useState)(!1),i=t[0],c=t[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U,{children:(0,r.jsxs)(a.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,r.jsx)(Z.Z,{row:!0,children:(0,r.jsx)(l.Z,{onClick:function(){return c(!i)},children:(0,r.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,r.jsx)(Z.Z,{className:R.iconBox,row:!0,spacing:0,children:(0,r.jsx)(a.Z,{children:(0,r.jsx)(s.Z,{onClick:function(e){var t,r,o=e.currentTarget;null===(t=n.current.setAnchor)||void 0===t||t.call(null,o),null===(r=n.current.setOpen)||void 0===r||r.call(null,!0)},sx:{color:d.of,padding:"0 .1rem"},children:(0,r.jsx)(E.Z,{icon:o.Z,ref:e})})})})]})}),(0,r.jsx)(B,{open:i,setOpen:c}),(0,r.jsx)(D.Z,{onFetchSuccessAppend:function(n){var t;null===(t=e.current.indicate)||void 0===t||t.call(null,Object.keys(n).length>0)},ref:n})]})}},4427:function(e,n,t){"use strict";var r=t(5893),o=t(2429),i=t(9309),c=t(7169);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(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){a(e,n,t[n])}))}return e}n.Z=function(e){var n,t,s=e.children,u=e.sx,d=l((a(t={backgroundColor:c.lD,paddingRight:"3em"},"&.".concat(o.Z.selected),(a(n={backgroundColor:c.s7,fontWeight:400},"&.".concat(o.Z.focusVisible),{backgroundColor:c.s7}),a(n,"&:hover",{backgroundColor:c.s7}),n)),a(t,"&.".concat(o.Z.focusVisible),{backgroundColor:c.s7}),a(t,"&:hover",{backgroundColor:c.s7}),t),u);return(0,r.jsx)(i.Z,l({},e,{sx:d,children:s}))}},1142:function(e,n,t){"use strict";t.r(n);var r=t(5893),o=t(1496),i=t(7357),c=t(9008),a=t(1163),l=t(7294),s=t(5094),u=t(8750);function d(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var f="Server",p={preview:"".concat(f,"-preview"),fullView:"".concat(f,"-fullView")},g=(0,o.ZP)("div")((function(e){var n,t=e.theme;return d(n={},"& .".concat(p.preview),d({width:"25%",height:"100%"},t.breakpoints.down("md"),{width:"100%"})),d(n,"& .".concat(p.fullView),{display:"flex",flexDirection:"row",width:"100%",justifyContent:"center"}),n}));n.default=function(){var e=(0,l.useState)(!0),n=e[0],t=e[1],o=(0,a.useRouter)().query,d=o.server_name,f=o.server_state,h=o.uuid,v=o.vnc,m=((null===v||void 0===v?void 0:v.toString())||"").length>0,x=(null===d||void 0===d?void 0:d.toString())||"",j=(null===f||void 0===f?void 0:f.toString())||"",b=(null===h||void 0===h?void 0:h.toString())||"";return(0,l.useEffect)((function(){m&&t(!1)}),[m]),(0,r.jsxs)(g,{children:[(0,r.jsx)(c.default,{children:(0,r.jsx)("title",{children:x})}),(0,r.jsx)(u.Z,{}),n?(0,r.jsx)(i.Z,{className:p.preview,children:(0,r.jsx)(s.M,{onClickPreview:function(){t(!1)},serverName:x,serverState:j,serverUUID:b})}):(0,r.jsx)(i.Z,{className:p.fullView,children:(0,r.jsx)(s.S,{onClickCloseButton:function(){t(!0)},serverUUID:b,serverName:x})})]})}}},function(e){e.O(0,[412,894,528,62,94,774,888,179],(function(){return n=8954,e(e.s=n);var n}));var n=e.O();_N_E=n}]);