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

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{6538:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Qe}});var r=t(5893),i=t(6265),o=t(6049),s=t(1120),a=t(8788),d=(0,s.Z)((function(){return{innerHeader:{position:"relative",padding:"0 .7em"},header:{top:"-.3em",left:"-.3em",padding:"1.4em 0",position:"absolute",content:'""',borderColor:a.d,borderWidth:"1px",borderRadius:a.n_,borderStyle:"solid",width:"100%"}}})),c=function(e){var n=e.children,t=d();return(0,r.jsxs)(o.Z,{className:t.innerHeader,whiteSpace:"pre-wrap",children:[(0,r.jsx)("div",{className:t.header}),n]})},l=(0,s.Z)((function(){return{innerBody:{borderWidth:"1px",borderRadius:a.n_,borderStyle:"solid",borderColor:a.d,marginTop:"1.4em",marginBottom:"1.4em",paddingBottom:".7em",position:"relative"}}})),u=function(e){var n=e.children,t=l();return(0,r.jsx)(o.Z,{className:t.innerBody,children:n})},h=(0,s.Z)((function(){return{paper:{padding:"2.1em",backgroundColor:a.v9,opacity:.8,zIndex:999},container:{margin:"1em",position:"relative"},square:{content:'""',position:"absolute",width:"2.1em",height:"2.1em",border:"1px",borderColor:a.lD,borderWidth:"1px",borderRadius:a.n_,borderStyle:"solid",padding:0,margin:0},topSquare:{top:"-.3em",left:"-.3em"},bottomSquare:{bottom:"-.3em",right:"-.3em"}}})),x=function(e){var n=e.children,t=h();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})]})},p=t(5723),g=function(){return fetch.apply(void 0,arguments).then((function(e){return e.json()}))},f=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,t=(0,p.ZP)(e,g,{refreshInterval:n}),r=t.data,i=t.error;return{data:r,isLoading:!i&&!r,isError:i}},m=t(7294),j=t(9570),v=t(2318),b=t(4670),_=(0,b.Z)({root:{color:a.lD}})(v.Z),Z=function(e){var n=e.text;return(0,r.jsx)(_,{variant:"h4",children:n})},w=(0,s.Z)((function(){return{selected:{color:a.lD},unselected:{color:a.UZ}}})),y=function(e){var n=e.text,t=e.selected,i=w();return(0,r.jsx)(v.Z,{variant:"subtitle1",className:t?i.selected:i.unselected,children:n})};y.defaultProps={selected:!0};var k=y,N=new Map([["optimal","Optimal"],["not_ready","Not Ready"],["degraded","Degraded"]]),O={uuid:"",setAnvilUuid:function(){return null}},C=(0,m.createContext)(O),P=function(e){var n=e.children,t=(0,m.useState)(""),i=t[0],o=t[1];return(0,r.jsx)(C.Provider,{value:{uuid:i,setAnvilUuid:function(e){o(e)}},children:n})},T=(0,s.Z)((function(){return{decorator:{width:"1.4em",height:"100%",borderRadius:a.n_},ok:{backgroundColor:a.Ej},warning:{backgroundColor:a.Wd},error:{backgroundColor:a.hM},off:{backgroundColor:a.s7}}})),D=function(e){var n=e.colour,t=T();return(0,r.jsx)("div",{className:"".concat(t.decorator," ").concat(t[n])})},E=function(e,n){fetch("".concat("/cgi-bin").concat(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})},S=(0,s.Z)((function(){return{root:{width:"100%","&:hover $child":{backgroundColor:a.Gf}},anvilName:{paddingLeft:0}}})),B=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";case"degraded":default:return"error"}},L=function(e){return!(-1===e.hosts.findIndex((function(e){return"offline"!==e.state})))},R=function(e){var n=e.list,t=(0,m.useContext)(C).uuid,i=S(),s=n.findIndex((function(e){return e.anvil_uuid===t}));return(0,r.jsx)(o.Z,{display:"flex",flexDirection:"row",width:"100%",children:""!==t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{p:1,children:(0,r.jsx)(D,{colour:B(n[s].anvil_state)})}),(0,r.jsxs)(o.Z,{p:1,flexGrow:1,className:i.anvilName,children:[(0,r.jsx)(Z,{text:n[s].anvil_name}),(0,r.jsx)(Z,{text:N.get(n[s].anvil_state)||"State unavailable"})]}),(0,r.jsx)(o.Z,{p:1,children:(0,r.jsx)(j.Z,{checked:L(n[s]),onChange:function(){return E("/set_power",{anvil_uuid:n[s].anvil_uuid,is_on:!L(n[s])})}})})]})})},F=t(2822),G=t(5517),I=t(998),A=function(e){var n=e.anvil;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{text:n.anvil_name}),(0,r.jsx)(k,{text:N.get(n.anvil_state)||"State unavailable"})]})},M=function(e){var n=[],t=[],r=[];return e.forEach((function(e){"optimal"===e.anvil_state?n.push(e):"not_ready"===e.anvil_state?t.push(e):r.push(e)})),[].concat(r,t,n)},U=(0,s.Z)((function(e){return{root:(0,i.Z)({width:"100%",overflow:"auto",height:"30vh"},e.breakpoints.down("md"),{height:"100%",overflow:"hidden"}),divider:{background:a.d},button:{"&:hover":{backgroundColor:a.$T},paddingLeft:0},anvil:{paddingLeft:0}}})),W=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";case"degraded":return"error";default:return"off"}},q=function(e){var n=e.list,t=(0,m.useContext)(C),i=t.uuid,s=t.setAnvilUuid,a=U();return(0,m.useEffect)((function(){""===i&&s(M(n)[0].anvil_uuid)}),[i,n,s]),(0,r.jsx)(F.Z,{component:"nav",className:a.root,"aria-label":"mailbox folders",children:M(n).map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G.Z,{className:a.divider}),(0,r.jsx)(I.Z,{button:!0,className:a.button,onClick:function(){return s(e.anvil_uuid)},children:(0,r.jsxs)(o.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,r.jsx)(o.Z,{p:1,children:(0,r.jsx)(D,{colour:W(e.anvil_state)})}),(0,r.jsx)(o.Z,{p:1,flexGrow:1,className:a.anvil,children:(0,r.jsx)(A,{anvil:e})})]})},e.anvil_uuid)]})}))})};function z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function H(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $=function(e){var n=e.list,t=[];return null===n||void 0===n||n.anvils.forEach((function(e){var n=f("".concat("/cgi-bin","/get_status?anvil_uuid=").concat(e.anvil_uuid)).data;t.push(H(H({},e),n))})),(0,r.jsxs)(x,{children:[(0,r.jsx)(R,{list:t}),(0,r.jsx)(q,{list:M(t)})]})},X=t(3681),J=(0,b.Z)({root:{height:"1em",borderRadius:a.n_},colorPrimary:{backgroundColor:a.v9},bar:{borderRadius:a.n_}})(X.Z),K=(0,s.Z)((function(){return{barOk:{backgroundColor:a.Ej},barWarning:{backgroundColor:a.Wd},barAlert:{backgroundColor:a.hM}}})),Q=function(e){var n=e.allocated,t=K();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(J,{classes:{bar:n>70?n>90?t.barAlert:t.barWarning:t.barOk},variant:"determinate",value:n}),(0,r.jsx)(X.Z,{variant:"determinate",value:0})]})},V=(0,b.Z)({root:{height:"1em",borderRadius:a.n_},colorPrimary:{backgroundColor:a.v9},bar:{borderRadius:a.n_}})(X.Z),Y=(0,s.Z)((function(){return{barOk:{backgroundColor:a.Ej},barInProgress:{backgroundColor:a.Wd}}})),ee=function(e){var n=e.progressPercentage,t=Y();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V,{classes:{bar:n<100?t.barInProgress:t.barOk},variant:"determinate",value:n}),(0,r.jsx)(X.Z,{variant:"determinate",value:0})]})},ne=new Map([["message_0222","The node is in an unknown state."],["message_0223","The node is a full cluster member."],["message_0224","The node is coming online; the cluster resource manager is running (step 2/3)."],["message_0225","The node is coming online; the node is a consensus cluster member (step 1/3)."],["message_0226","The node has booted, but it is not (yet) joining the cluster."]]),te=(0,s.Z)((function(e){return{root:(0,i.Z)({overflow:"auto",height:"28vh",paddingLeft:".3em"},e.breakpoints.down("md"),{height:"100%",overflow:"hidden"}),state:{paddingLeft:".7em",paddingRight:".7em",paddingTop:"1em"},bar:{paddingLeft:".7em",paddingRight:".7em"},header:{paddingTop:".3em",paddingRight:".7em"},label:{paddingTop:".3em"},decoratorBox:{paddingRight:".3em"}}})),re=function(e,n){var t=e.exec(n);return t?ne.get(t[0])||"Error code not recognized":"Error code not found"},ie=function(e){switch(e){case"online":return"ok";case"offline":return"off";default:return"warning"}},oe=function(e){var n=e.hosts,t=te(),i=/^[a-zA-Z]/,s=/^(message_[0-9]+)/;return(0,r.jsx)(o.Z,{className:t.root,children:n&&n.map((function(e){var n;return(0,r.jsxs)(u,{children:[(0,r.jsx)(c,{children:(0,r.jsxs)(o.Z,{display:"flex",width:"100%",className:t.header,children:[(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(k,{text:e.host_name})}),(0,r.jsx)(o.Z,{className:t.decoratorBox,children:(0,r.jsx)(D,{colour:ie(e.state)})}),(0,r.jsx)(o.Z,{children:(0,r.jsx)(k,{text:(null===e||void 0===e||null===(n=e.state)||void 0===n?void 0:n.replace(i,(function(e){return e.toUpperCase()})))||"Not Available"})})]})}),(0,r.jsxs)(o.Z,{display:"flex",className:t.state,children:[(0,r.jsx)(o.Z,{className:t.label,children:(0,r.jsx)(k,{text:"Power: "})}),(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(j.Z,{checked:"online"===e.state,onChange:function(){return E("/set_power",{host_uuid:e.host_uuid,is_on:!("online"===e.state)})}})}),(0,r.jsx)(o.Z,{className:t.label,children:(0,r.jsx)(k,{text:"Member: "})}),(0,r.jsx)(o.Z,{children:(0,r.jsx)(j.Z,{checked:"online"===e.state,disabled:!("online"===e.state),onChange:function(){return E("/set_membership",{host_uuid:e.host_uuid,is_member:!("online"===e.state)})}})})]}),"online"!==e.state&&"offline"!==e.state&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{display:"flex",width:"100%",className:t.state,children:(0,r.jsx)(o.Z,{children:(0,r.jsx)(k,{text:re(s,e.state_message)})})}),(0,r.jsx)(o.Z,{display:"flex",width:"100%",className:t.bar,children:(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(ee,{progressPercentage:e.state_percent})})})]})]},e.host_uuid)}))})},se=t(5477),ae=(0,s.Z)((function(){return{root:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:"3em"},spinner:{color:a.lD,variant:"indeterminate",size:"50em"}}})),de=function(){var e=ae();return(0,r.jsx)("div",{className:e.root,children:(0,r.jsx)(se.Z,{className:e.spinner})})},ce=function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.host_uuid}))},le=function(e){var n=e.anvil,t=(0,m.useContext)(C).uuid,i=f("".concat("/cgi-bin","/get_status?anvil_uuid=").concat(t)),o=i.data,s=i.isLoading,a=n.findIndex((function(e){return e.anvil_uuid===t}));return(0,r.jsxs)(x,{children:[(0,r.jsx)(Z,{text:"Nodes"}),s?(0,r.jsx)(de,{}):(0,r.jsx)(r.Fragment,{children:-1!==a&&o&&(0,r.jsx)(oe,{hosts:ce(n[a].hosts).map((function(e,n){return o.hosts[n]}))})})]})},ue=function(){var e=(0,m.useContext)(C).uuid,n=f("".concat("/cgi-bin","/get_cpu?anvil_uuid=").concat(e)),t=n.data,i=n.isLoading,s=i||!t?{allocated:0,cores:0,threads:0}:t;return(0,r.jsxs)(x,{children:[(0,r.jsx)(Z,{text:"CPU"}),i?(0,r.jsx)(de,{}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.Z,{display:"flex",width:"100%",children:(0,r.jsxs)(o.Z,{flexGrow:1,style:{marginLeft:"1em",marginTop:"1em"},children:[(0,r.jsx)(k,{text:"Total Cores: ".concat(s.cores)}),(0,r.jsx)(k,{text:"Total Threads: ".concat(s.threads)}),(0,r.jsx)(k,{text:"Allocated Cores: ".concat(s.allocated)})]})})})]})},he=t(8600),xe=t.n(he),pe=(0,s.Z)((function(){return{fs:{paddingLeft:".7em",paddingRight:".7em",paddingTop:"1.2em"},bar:{paddingLeft:".7em",paddingRight:".7em"},decoratorBox:{paddingRight:".3em"}}})),ge=function(e){var n=e.group,t=pe();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.Z,{display:"flex",width:"100%",className:t.fs,children:[(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(k,{text:"Used: ".concat(xe()(n.storage_group_total-n.storage_group_free,{binary:!0}))})}),(0,r.jsx)(o.Z,{children:(0,r.jsx)(k,{text:"Free: ".concat(xe()(n.storage_group_free,{binary:!0}))})})]}),(0,r.jsx)(o.Z,{display:"flex",width:"100%",className:t.bar,children:(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(Q,{allocated:(n.storage_group_total-n.storage_group_free)/n.storage_group_total*100})})}),(0,r.jsx)(o.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,r.jsx)(k,{text:"Total Storage: ".concat(xe()(n.storage_group_total,{binary:!0}))})})]})},fe=(0,s.Z)((function(e){return{header:{paddingTop:".1em",paddingRight:".7em"},root:(0,i.Z)({overflow:"auto",height:"78vh",paddingLeft:".3em"},e.breakpoints.down("md"),{height:"100%"})}})),me=function(){var e=fe(),n=(0,m.useContext)(C).uuid,t=f("".concat("/cgi-bin","/get_shared_storage?anvil_uuid=").concat(n)),i=t.data,s=t.isLoading;return(0,r.jsxs)(x,{children:[(0,r.jsx)(Z,{text:"Shared Storage"}),s?(0,r.jsx)(de,{}):(0,r.jsx)(o.Z,{className:e.root,children:(null===i||void 0===i?void 0:i.storage_groups)&&i.storage_groups.map((function(n){return(0,r.jsxs)(u,{children:[(0,r.jsx)(c,{children:(0,r.jsx)(o.Z,{display:"flex",width:"100%",className:e.header,children:(0,r.jsx)(o.Z,{children:(0,r.jsx)(k,{text:n.storage_group_name})})})}),(0,r.jsx)(ge,{group:n},n.storage_group_uuid)]},n.storage_group_uuid)}))})]})},je=function(){var e=(0,m.useContext)(C).uuid,n=f("".concat("/cgi-bin","/get_memory?anvil_uuid=").concat(e)),t=n.data,i=n.isLoading,s=i||!t?{total:0,allocated:0,reserved:0}:t;return(0,r.jsxs)(x,{children:[(0,r.jsx)(Z,{text:"Memory"}),i?(0,r.jsx)(de,{}):(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsxs)(o.Z,{display:"flex",width:"100%",children:[(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(k,{text:"Allocated: ".concat(xe()(s.allocated,{binary:!0}))})}),(0,r.jsx)(o.Z,{children:(0,r.jsx)(k,{text:"Free: ".concat(xe()(s.total-s.allocated,{binary:!0}))})})]}),(0,r.jsx)(o.Z,{display:"flex",width:"100%",children:(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(Q,{allocated:s.allocated/s.total*100})})}),(0,r.jsx)(o.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,r.jsx)(k,{text:"Total: ".concat(xe()(s.total,{binary:!0})," | Reserved: ").concat(xe()(s.reserved,{binary:!0}))})})]})]})},ve=function(e){var n=[],t={bonds:[]};return null===e||void 0===e||e.hosts.forEach((function(e){e.bonds.forEach((function(r){var i=n.findIndex((function(e){return e===r.bond_name}));-1===i?(n.push(r.bond_name),t.bonds.push({bond_name:r.bond_name,bond_uuid:r.bond_uuid,bond_speed:0,bond_state:"degraded",hosts:[{host_name:e.host_name,host_uuid:e.host_uuid,link:r.links[0].is_active?r.links[0]:r.links[1]}]})):t.bonds[i].hosts.push({host_name:e.host_name,host_uuid:e.host_uuid,link:r.links[0].is_active?r.links[0]:r.links[1]})}))})),t.bonds.forEach((function(e){var n=e.hosts[0].link.link_speed>e.hosts[1].link.link_speed?1:0;e.bond_speed=e.hosts[n].link.link_speed,e.bond_state=e.hosts[n].link.link_state})),t},be=(0,s.Z)((function(e){return{container:(0,i.Z)({width:"100%",overflow:"auto",height:"32vh"},e.breakpoints.down("md"),{height:"100%",overflow:"hidden"}),root:{paddingTop:".7em",paddingBottom:".7em"},noPaddingLeft:{paddingLeft:0},divider:{background:a.d},verticalDivider:{height:"3.5em"}}})),_e=function(e){switch(e){case"optimal":return"ok";case"degraded":return"warning";case"down":return"error";default:return"warning"}},Ze=function(){var e=(0,m.useContext)(C).uuid,n=be(),t=f("".concat("/cgi-bin","/get_networks?anvil_uuid=").concat(e)),i=t.data,s=t.isLoading,a=ve(i);return(0,r.jsxs)(x,{children:[(0,r.jsx)(Z,{text:"Network"}),s?(0,r.jsx)(de,{}):(0,r.jsx)(o.Z,{className:n.container,children:i&&a.bonds.map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.Z,{display:"flex",flexDirection:"row",width:"100%",className:n.root,children:[(0,r.jsx)(o.Z,{p:1,className:n.noPaddingLeft,children:(0,r.jsx)(D,{colour:_e(e.bond_state)})}),(0,r.jsxs)(o.Z,{p:1,flexGrow:1,className:n.noPaddingLeft,children:[(0,r.jsx)(k,{text:e.bond_name}),(0,r.jsx)(k,{text:"".concat(e.bond_speed,"Mbps")})]}),(0,r.jsx)(o.Z,{display:"flex",style:{paddingTop:".5em"},children:e.hosts.map((function(t,i){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{p:1,style:{paddingTop:0,paddingBottom:0},children:(0,r.jsxs)(o.Z,{children:[(0,r.jsx)(k,{text:t.host_name,selected:!1}),(0,r.jsx)(k,{text:t.link.link_name})]})},t.host_name),i!==e.hosts.length-1&&(0,r.jsx)(G.Z,{className:"".concat(n.divider," ").concat(n.verticalDivider),orientation:"vertical",flexItem:!0})]})}))})]}),(0,r.jsx)(G.Z,{className:n.divider})]})}))})]})},we=t(1385),ye=t(7812),ke=t(282),Ne=t(5675),Oe=t(5639),Ce=t(3258),Pe=t(9067),Te=t(8513),De=t(1959),Ee=new Map([["running","Running"],["idle","Idle"],["paused","Paused"],["in shutdown","Shutting Down"],["shut off","Off"],["crashed","Crashed"],["pmsuspended","PM Suspended"],["migrating","Migrating"]]),Se=(0,s.Z)((function(e){return{root:(0,i.Z)({width:"100%",overflow:"auto",height:"78vh"},e.breakpoints.down("md"),{height:"100%"}),divider:{background:a.d},verticalDivider:{height:"75%",paddingTop:"1em"},button:{"&:hover":{backgroundColor:a.$T},paddingLeft:0},headerPadding:{paddingLeft:".3em"},hostsBox:{padding:"1em",paddingRight:0},hostBox:{paddingTop:0},checkbox:{paddingTop:".8em"},menuItem:{backgroundColor:a.lD,paddingRight:"3em","&:hover":{backgroundColor:a.lD}},editButton:{borderRadius:8,backgroundColor:a.s7,"&:hover":{backgroundColor:a.lD}},editButtonBox:{paddingTop:".3em"},dropdown:{paddingTop:".8em",paddingBottom:".8em"},power:{color:a.E5},on:{color:a.Ej},off:{color:a.hM},all:{paddingTop:".5em",paddingLeft:".3em"}}})),Be=function(e){switch(e){case"running":return"ok";case"shut off":return"off";case"crashed":return"error";default:return"warning"}},Le=["on","off"],Re=function(e){var n,t=e.anvil,i=(0,m.useState)(null),s=i[0],d=i[1],c=(0,m.useState)(!1),l=c[0],u=c[1],h=(0,m.useState)(!1),p=h[0],g=h[1],j=(0,m.useState)([]),b=j[0],_=j[1],w=(0,m.useContext)(C).uuid,y=Se(),N=f("".concat("/cgi-bin","/get_servers?anvil_uuid=").concat(w)),O=N.data,P=N.isLoading,T=t.findIndex((function(e){return e.anvil_uuid===w})),S=ce(null===(n=t[T])||void 0===n?void 0:n.hosts);return(0,r.jsxs)(x,{children:[(0,r.jsxs)(o.Z,{className:y.headerPadding,display:"flex",children:[(0,r.jsx)(o.Z,{flexGrow:1,children:(0,r.jsx)(Z,{text:"Servers"})}),(0,r.jsx)(o.Z,{className:y.editButtonBox,children:(0,r.jsx)(ye.Z,{className:y.editButton,style:{color:a.E5},onClick:function(){return u(!l)},children:l?(0,r.jsx)(De.Z,{}):(0,r.jsx)(Pe.Z,{})})})]}),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{className:y.headerPadding,display:"flex",children:(0,r.jsxs)(o.Z,{flexGrow:1,className:y.dropdown,children:[(0,r.jsx)(ke.Z,{variant:"contained",startIcon:(0,r.jsx)(Te.Z,{}),onClick:function(e){d(e.currentTarget)},style:{textTransform:"none"},children:(0,r.jsx)(v.Z,{className:y.power,variant:"subtitle1",children:"Power"})}),(0,r.jsx)(Ne.Z,{anchorEl:s,keepMounted:!0,open:Boolean(s),onClose:function(){return d(null)},children:Le.map((function(e){return(0,r.jsx)(Oe.Z,{onClick:function(){return function(e){d(null),b.length&&E("/set_power",{server_uuid_list:b,is_on:"on"===e})}(e)},className:y.menuItem,children:(0,r.jsx)(v.Z,{className:y[e],variant:"subtitle1",children:e.replace(/^[a-z]/,(function(e){return e.toUpperCase()}))})},e)}))})]})}),(0,r.jsxs)(o.Z,{display:"flex",children:[(0,r.jsx)(o.Z,{children:(0,r.jsx)(Ce.Z,{style:{color:a.lD},color:"secondary",checked:p,onChange:function(){_(p?[]:O.servers.map((function(e){return e.server_uuid}))),g(!p)}})}),(0,r.jsx)(o.Z,{className:y.all,children:(0,r.jsx)(k,{text:"All"})})]})]}),P?(0,r.jsx)(de,{}):(0,r.jsx)(o.Z,{className:y.root,children:(0,r.jsx)(F.Z,{component:"nav",children:O&&O.servers.map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(I.Z,{button:!0,className:y.button,children:(0,r.jsxs)(o.Z,{display:"flex",flexDirection:"row",width:"100%",children:[l&&(0,r.jsx)(o.Z,{className:y.checkbox,children:(0,r.jsx)(Ce.Z,{style:{color:a.lD},color:"secondary",checked:void 0!==b.find((function(n){return n===e.server_uuid})),onChange:function(){return function(e){var n=b.indexOf(e);-1===n?b.push(e):b.splice(n,1),_((0,we.Z)(b))}(e.server_uuid)}})}),(0,r.jsx)(o.Z,{p:1,children:(0,r.jsx)(D,{colour:Be(e.server_state)})}),(0,r.jsxs)(o.Z,{p:1,flexGrow:1,children:[(0,r.jsx)(k,{text:e.server_name}),(0,r.jsx)(k,{text:Ee.get(e.server_state)||"Not Available"})]}),(0,r.jsx)(o.Z,{display:"flex",className:y.hostsBox,children:"shut off"!==e.server_state&&"crashed"!==e.server_state&&S.map((function(n,t){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{p:1,className:y.hostBox,children:(0,r.jsx)(k,{text:n.host_name,selected:e.server_host_uuid===n.host_uuid})},n.host_uuid),t!==S.length-1&&(0,r.jsx)(G.Z,{className:"".concat(y.divider," ").concat(y.verticalDivider),orientation:"vertical"})]})}))})]})},e.server_uuid),(0,r.jsx)(G.Z,{className:y.divider})]})}))})})]})},Fe=t(5258),Ge=t(7623),Ie=[{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:"Help",image:"/pngs/help_icon_on.png",uri:"https://alteeve.com/w/Support"}],Ae={width:"40em",height:"40em"},Me=t(7159);function Ue(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function We(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ue(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ue(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qe=(0,s.Z)((function(){return(0,Ge.Z)({list:{width:"200px"},divider:{background:a.d},text:{paddingTop:".5em",paddingLeft:"1.5em"}})})),ze=function(e){var n=e.open,t=e.setOpen,i=qe();return(0,r.jsx)(Me.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:i.list,children:[(0,r.jsx)(I.Z,{button:!0,children:(0,r.jsx)(Z,{text:"Admin"})}),(0,r.jsx)(G.Z,{className:i.divider}),Ie.map((function(e){return(0,r.jsx)(I.Z,{button:!0,component:"a",href:-1!==e.uri.search(/^https?:/)?e.uri:"".concat("/cgi-bin").concat(e.uri),children:(0,r.jsxs)(o.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,r.jsx)(o.Z,{children:(0,r.jsx)("img",We({alt:"",src:e.image},Ae),"icon")}),(0,r.jsx)(o.Z,{flexGrow:1,className:i.text,children:(0,r.jsx)(k,{text:e.text})})]})},e.image)}))]})})})};function He(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?He(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):He(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xe=(0,s.Z)((function(e){return(0,Ge.Z)({appBar:{paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5),paddingLeft:e.spacing(3),paddingRight:e.spacing(3),borderBottom:"solid 1px",borderBottomColor:a.hM},input:{height:"2.8em",width:"30vw",backgroundColor:e.palette.secondary.main,borderRadius:a.n_},barElement:{padding:0},icons:(0,i.Z)({},e.breakpoints.down("sm"),{display:"none"}),searchBar:(0,i.Z)({},e.breakpoints.down("sm"),{flexGrow:1,paddingLeft:"15vw"})})})),Je=function(){var e=Xe(),n=(0,m.useState)(!1),t=n[0],i=n[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Fe.Z,{position:"static",className:e.appBar,children:(0,r.jsxs)(o.Z,{display:"flex",justifyContent:"space-between",flexDirection:"row",children:[(0,r.jsx)(o.Z,{className:e.barElement,children:(0,r.jsx)(ke.Z,{onClick:function(){return i(!t)},children:(0,r.jsx)("img",{alt:"",src:"/pngs/logo.png",width:"160",height:"40"})})}),(0,r.jsx)(o.Z,{className:"".concat(e.barElement," ").concat(e.icons),children:Ie.map((function(e){return(0,r.jsx)("a",{href:-1!==e.uri.search(/^https?:/)?e.uri:"".concat("/cgi-bin").concat(e.uri),children:(0,r.jsx)("img",$e({alt:"",src:e.image},Ae),"icon")},e.uri)}))})]})}),(0,r.jsx)(ze,{open:t,setOpen:i})]})},Ke=(0,s.Z)((function(e){var n,t;return{child:(n={width:"22%",height:"100%"},(0,i.Z)(n,e.breakpoints.down("lg"),{width:"25%"}),(0,i.Z)(n,e.breakpoints.down("md"),{width:"100%"}),n),server:(t={width:"35%",height:"100%"},(0,i.Z)(t,e.breakpoints.down("lg"),{width:"25%"}),(0,i.Z)(t,e.breakpoints.down("md"),{width:"100%"}),t),container:(0,i.Z)({display:"flex",flexDirection:"row",width:"100%",justifyContent:"space-between"},e.breakpoints.down("md"),{display:"block"})}})),Qe=function(){var e=Ke(),n=f("".concat("/cgi-bin","/get_anvils")).data;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(P,{children:[(0,r.jsx)(Je,{}),(null===n||void 0===n?void 0:n.anvils)&&(0,r.jsxs)(o.Z,{className:e.container,children:[(0,r.jsxs)(o.Z,{className:e.child,children:[(0,r.jsx)($,{list:n}),(0,r.jsx)(le,{anvil:n.anvils})]}),(0,r.jsx)(o.Z,{className:e.server,children:(0,r.jsx)(Re,{anvil:n.anvils})}),(0,r.jsx)(o.Z,{className:e.child,children:(0,r.jsx)(me,{})}),(0,r.jsxs)(o.Z,{className:e.child,children:[(0,r.jsx)(Ze,{}),(0,r.jsx)(ue,{}),(0,r.jsx)(je,{})]})]})]})})}},5301:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(6538)}])}},function(e){e.O(0,[642,774,888,179],(function(){return n=5301,e(e.s=n);var n}));var n=e.O();_N_E=n}]);