(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 Ue}});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(2929),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}}})),L=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";case"degraded":default:return"error"}},R=function(e){return!(-1===e.hosts.findIndex((function(e){return"offline"!==e.state})))},B=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:L(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:R(n[s]),onChange:function(){return E("/set_power",{anvil_uuid:n[s].anvil_uuid,is_on:!R(n[s])})}})})]})})},F=t(2822),G=t(5517),A=t(8867),I=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)(A.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)(I,{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;n70?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=new Map([["running","Running"],["idle","Idle"],["paused","Paused"],["in shutdown","Shutting Down"],["shut off","Off"],["crashed","Crashed"],["pmsuspended","PM Suspended"],["migrating","Migrating"]]),ye=(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}}})),ke=function(e){switch(e){case"running":return"ok";case"shut off":return"off";case"crashed":return"error";default:return"warning"}},Ne=function(e){var n,t=e.anvil,i=(0,m.useContext)(C).uuid,s=ye(),a=f("".concat("/cgi-bin","/get_servers?anvil_uuid=").concat(i)),d=a.data,c=a.isLoading,l=t.findIndex((function(e){return e.anvil_uuid===i})),u=ce(null===(n=t[l])||void 0===n?void 0:n.hosts);return(0,r.jsxs)(x,{children:[(0,r.jsx)("div",{className:s.headerPadding,children:(0,r.jsx)(Z,{text:"Servers"})}),c?(0,r.jsx)(de,{}):(0,r.jsx)(o.Z,{className:s.root,children:(0,r.jsx)(F.Z,{component:"nav",children:d&&d.servers.map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.Z,{button:!0,className:s.button,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:ke(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:we.get(e.server_state)||"Not Available"})]}),(0,r.jsx)(o.Z,{display:"flex",className:s.hostsBox,children:"shut off"!==e.server_state&&"crashed"!==e.server_state&&u.map((function(n,t){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{p:1,className:s.hostBox,children:(0,r.jsx)(k,{text:n.host_name,selected:e.server_host_uuid===n.host_uuid})},n.host_uuid),t!==u.length-1&&(0,r.jsx)(G.Z,{className:"".concat(s.divider," ").concat(s.verticalDivider),orientation:"vertical"})]})}))})]})},e.server_uuid),(0,r.jsx)(G.Z,{className:s.divider})]})}))})})]})},Oe=t(5258),Ce=t(7623),Pe=t(282),Te=[{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"}],De={width:"40em",height:"40em"},Ee=t(5918);function Se(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 Le(e){for(var n=1;n