(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{5301:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return r(1864)}])},8750:function(e,n,r){"use strict";r.d(n,{Z:function(){return N}});var t=r(5893),i=r(7294),o=r(5258),a=r(1120),s=r(253),c=r(282),d=[{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"}],l={width:"40em",height:"40em"},u=r(7169),h=r(8008),f=r(2822),x=r(998),g=r(5517),p=r(5154),m=r(442),j=r(3430);function v(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function b(e){for(var n=1;ne.length)&&(n=e.length);for(var r=0,t=new Array(n);r1&&void 0!==arguments[1]?arguments[1]:5e3,r=(0,c.ZP)(e,u,{refreshInterval:n}),t=r.data,i=r.error;return{data:t,isLoading:!i&&!t,isError:i}},f=r(7294),x=r(9570),g=r(3430),p=r(7169),m=new Map([["optimal","Optimal"],["not_ready","Not Ready"],["degraded","Degraded"]]),j={uuid:"",setAnvilUuid:function(){return null}},v=(0,f.createContext)(j),b=function(e){var n=e.children,r=(0,f.useState)(""),i=r[0],o=r[1];return(0,t.jsx)(v.Provider,{value:{uuid:i,setAnvilUuid:function(e){o(e)}},children:n})},_=(0,a.Z)((function(){return{decorator:{width:"1.4em",height:"100%",borderRadius:p.n_},ok:{backgroundColor:p.Ej},warning:{backgroundColor:p.Wd},error:{backgroundColor:p.hM},off:{backgroundColor:p.s7}}})),w=function(e){var n=e.colour,r=_();return(0,t.jsx)("div",{className:"".concat(r.decorator," ").concat(r[n])})},Z=r(8336),y=(0,a.Z)((function(){return{root:{width:"100%","&:hover $child":{backgroundColor:p.Gf}},anvilName:{paddingLeft:0}}})),k=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";default:return"error"}},N=function(e){return!(-1===e.hosts.findIndex((function(e){return"offline"!==e.state})))},C=function(e){var n=e.list,r=(0,f.useContext)(v).uuid,i=y(),a=n.findIndex((function(e){return e.anvil_uuid===r}));return(0,t.jsx)(o.Z,{display:"flex",flexDirection:"row",width:"100%",children:""!==r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z,{p:1,children:(0,t.jsx)(w,{colour:k(n[a].anvil_state)})}),(0,t.jsxs)(o.Z,{p:1,flexGrow:1,className:i.anvilName,children:[(0,t.jsx)(g.z,{text:n[a].anvil_name}),(0,t.jsx)(g.z,{text:m.get(n[a].anvil_state)||"State unavailable"})]}),(0,t.jsx)(o.Z,{p:1,children:(0,t.jsx)(x.Z,{checked:N(n[a]),onChange:function(){return(0,Z.Z)("".concat("/cgi-bin","/set_power"),{anvil_uuid:n[a].anvil_uuid,is_on:!N(n[a])})}})})]})})},A=r(2822),O=r(5517),S=r(998),P=function(e){var n=e.anvil;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g.A,{text:n.anvil_name}),(0,t.jsx)(g.A,{text:m.get(n.anvil_state)||"State unavailable"})]})};function T(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r70?n>90?r.barAlert:r.barWarning:r.barOk},variant:"determinate",value:n}),(0,t.jsx)(G.Z,{variant:"determinate",value:0})]})},q=(0,z.Z)({root:{height:"1em",borderRadius:p.n_},colorPrimary:{backgroundColor:p.v9},bar:{borderRadius:p.n_}})(G.Z),$=(0,a.Z)((function(){return{barOk:{backgroundColor:p.Ej},barInProgress:{backgroundColor:p.Wd}}})),H=function(e){var n=e.progressPercentage,r=$();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{classes:{bar:n<100?r.barInProgress:r.barOk},variant:"determinate",value:n}),(0,t.jsx)(G.Z,{variant:"determinate",value:0})]})},V=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."]]);var X=(0,a.Z)((function(e){return{root:(n={overflow:"auto",height:"28vh",paddingLeft:".3em",paddingRight:".3em"},r=e.breakpoints.down(p.li),t={height:"100%",overflow:"hidden"},r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n),state:{paddingLeft:".7em",paddingRight:".7em",paddingTop:"1em"},bar:{paddingLeft:".7em",paddingRight:".7em"},header:{paddingTop:".3em",paddingRight:".7em"},label:{paddingTop:".3em"},decoratorBox:{paddingRight:".3em"}};var n,r,t})),J=function(e,n){var r=e.exec(n);return r?V.get(r[0])||"Error code not recognized":"Error code not found"},K=function(e){switch(e){case"online":return"ok";case"offline":return"off";default:return"warning"}},Q=function(e){var n=e.hosts,r=X(),i=/^[a-zA-Z]/,a=/^(message_[0-9]+)/;return(0,t.jsx)(o.Z,{className:r.root,children:n&&n.map((function(e){var n;return(0,t.jsxs)(s.Lg,{children:[(0,t.jsx)(s.V9,{children:(0,t.jsxs)(o.Z,{display:"flex",width:"100%",className:r.header,children:[(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(g.A,{text:e.host_name})}),(0,t.jsx)(o.Z,{className:r.decoratorBox,children:(0,t.jsx)(w,{colour:K(e.state)})}),(0,t.jsx)(o.Z,{children:(0,t.jsx)(g.A,{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,t.jsxs)(o.Z,{display:"flex",className:r.state,children:[(0,t.jsx)(o.Z,{className:r.label,children:(0,t.jsx)(g.A,{text:"Power: "})}),(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(x.Z,{checked:"online"===e.state,onChange:function(){return(0,Z.Z)("".concat("/cgi-bin","/set_power"),{host_uuid:e.host_uuid,is_on:!("online"===e.state)})}})}),(0,t.jsx)(o.Z,{className:r.label,children:(0,t.jsx)(g.A,{text:"Member: "})}),(0,t.jsx)(o.Z,{children:(0,t.jsx)(x.Z,{checked:"online"===e.state,disabled:!("online"===e.state),onChange:function(){return(0,Z.Z)("".concat("/cgi-bin","/set_membership"),{host_uuid:e.host_uuid,is_member:!("online"===e.state)})}})})]}),"online"!==e.state&&"offline"!==e.state&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z,{display:"flex",width:"100%",className:r.state,children:(0,t.jsx)(o.Z,{children:(0,t.jsx)(g.A,{text:J(a,e.state_message)})})}),(0,t.jsx)(o.Z,{display:"flex",width:"100%",className:r.bar,children:(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(H,{progressPercentage:e.state_percent})})})]})]},e.host_uuid)}))})},Y=r(2152),ee=function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.host_uuid}))},ne=function(e){var n=e.anvil,r=(0,f.useContext)(v).uuid,i=h("".concat("/cgi-bin","/get_status?anvil_uuid=").concat(r)),o=i.data,a=i.isLoading,c=n.findIndex((function(e){return e.anvil_uuid===r}));return(0,t.jsxs)(s.s_,{children:[(0,t.jsx)(g.z,{text:"Nodes"}),a?(0,t.jsx)(Y.Z,{}):(0,t.jsx)(t.Fragment,{children:-1!==c&&o&&(0,t.jsx)(Q,{hosts:ee(n[c].hosts).reduce((function(e,n,r){var t=o.hosts[r];return t&&e.push(t),e}),[])})})]})},re=function(){var e=(0,f.useContext)(v).uuid,n=h("".concat("/cgi-bin","/get_cpu?anvil_uuid=").concat(e)),r=n.data,i=n.isLoading,a=i||!r?{allocated:0,cores:0,threads:0}:r;return(0,t.jsxs)(s.s_,{children:[(0,t.jsx)(g.z,{text:"CPU"}),i?(0,t.jsx)(Y.Z,{}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(o.Z,{display:"flex",width:"100%",children:(0,t.jsxs)(o.Z,{flexGrow:1,style:{marginLeft:"1em",marginTop:"1em"},children:[(0,t.jsx)(g.A,{text:"Total Cores: ".concat(a.cores)}),(0,t.jsx)(g.A,{text:"Total Threads: ".concat(a.threads)}),(0,t.jsx)(g.A,{text:"Allocated Cores: ".concat(a.allocated)})]})})})]})},te=r(8600),ie=r.n(te),oe=(0,a.Z)((function(){return{fs:{paddingLeft:".7em",paddingRight:".7em",paddingTop:"1.2em"},bar:{paddingLeft:".7em",paddingRight:".7em"},decoratorBox:{paddingRight:".3em"}}})),ae=function(e){var n=e.group,r=oe();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{display:"flex",width:"100%",className:r.fs,children:[(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(g.A,{text:"Used: ".concat(ie()(n.storage_group_total-n.storage_group_free,{binary:!0}))})}),(0,t.jsx)(o.Z,{children:(0,t.jsx)(g.A,{text:"Free: ".concat(ie()(n.storage_group_free,{binary:!0}))})})]}),(0,t.jsx)(o.Z,{display:"flex",width:"100%",className:r.bar,children:(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(W,{allocated:(n.storage_group_total-n.storage_group_free)/n.storage_group_total*100})})}),(0,t.jsx)(o.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,t.jsx)(g.A,{text:"Total Storage: ".concat(ie()(n.storage_group_total,{binary:!0}))})})]})};var se=(0,a.Z)((function(e){return{header:{paddingTop:".1em",paddingRight:".7em"},root:(n={overflow:"auto",height:"78vh",paddingLeft:".3em",paddingRight:".3em"},r=e.breakpoints.down(p.li),t={height:"100%"},r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n)};var n,r,t})),ce=function(){var e=se(),n=(0,f.useContext)(v).uuid,r=h("".concat("/cgi-bin","/get_shared_storage?anvil_uuid=").concat(n)),i=r.data,a=r.isLoading;return(0,t.jsxs)(s.s_,{children:[(0,t.jsx)(g.z,{text:"Shared Storage"}),a?(0,t.jsx)(Y.Z,{}):(0,t.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,t.jsxs)(s.Lg,{children:[(0,t.jsx)(s.V9,{children:(0,t.jsx)(o.Z,{display:"flex",width:"100%",className:e.header,children:(0,t.jsx)(o.Z,{children:(0,t.jsx)(g.A,{text:n.storage_group_name})})})}),(0,t.jsx)(ae,{group:n},n.storage_group_uuid)]},n.storage_group_uuid)}))})]})},de=function(){var e=(0,f.useContext)(v).uuid,n=h("".concat("/cgi-bin","/get_memory?anvil_uuid=").concat(e)),r=n.data,i=n.isLoading,a=i||!r?{total:0,allocated:0,reserved:0}:r;return(0,t.jsxs)(s.s_,{children:[(0,t.jsx)(g.z,{text:"Memory"}),i?(0,t.jsx)(Y.Z,{}):(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsxs)(o.Z,{display:"flex",width:"100%",children:[(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(g.A,{text:"Allocated: ".concat(ie()(a.allocated,{binary:!0}))})}),(0,t.jsx)(o.Z,{children:(0,t.jsx)(g.A,{text:"Free: ".concat(ie()(a.total-a.allocated,{binary:!0}))})})]}),(0,t.jsx)(o.Z,{display:"flex",width:"100%",children:(0,t.jsx)(o.Z,{flexGrow:1,children:(0,t.jsx)(W,{allocated:a.allocated/a.total*100})})}),(0,t.jsx)(o.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,t.jsx)(g.A,{text:"Total: ".concat(ie()(a.total,{binary:!0})," | Reserved: ").concat(ie()(a.reserved,{binary:!0}))})})]})]})},le=function(e){var n=[],r={bonds:[]};return null===e||void 0===e||e.hosts.forEach((function(e){e.bonds.forEach((function(t){var i=n.findIndex((function(e){return e===t.bond_name}));-1===i?(n.push(t.bond_name),r.bonds.push({bond_name:t.bond_name,bond_uuid:t.bond_uuid,bond_speed:0,bond_state:"degraded",hosts:[{host_name:e.host_name,host_uuid:e.host_uuid,link:t.links[0].is_active?t.links[0]:t.links[1]}]})):r.bonds[i].hosts.push({host_name:e.host_name,host_uuid:e.host_uuid,link:t.links[0].is_active?t.links[0]:t.links[1]})}))})),r.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})),r};var ue=(0,a.Z)((function(e){return{container:(n={width:"100%",overflow:"auto",height:"32vh",paddingRight:".3em"},r=e.breakpoints.down(p.li),t={height:"100%",overflow:"hidden"},r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n),root:{paddingTop:".7em",paddingBottom:".7em"},noPaddingLeft:{paddingLeft:0},divider:{background:p.d},verticalDivider:{height:"3.5em"}};var n,r,t})),he=function(e){switch(e){case"optimal":return"ok";case"degraded":default:return"warning";case"down":return"error"}},fe=function(){var e=(0,f.useContext)(v).uuid,n=ue(),r=h("".concat("/cgi-bin","/get_networks?anvil_uuid=").concat(e)),i=r.data,a=r.isLoading,c=le(i);return(0,t.jsxs)(s.s_,{children:[(0,t.jsx)(g.z,{text:"Network"}),a?(0,t.jsx)(Y.Z,{}):(0,t.jsx)(o.Z,{className:n.container,children:i&&c.bonds.map((function(e){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(o.Z,{display:"flex",flexDirection:"row",width:"100%",className:n.root,children:[(0,t.jsx)(o.Z,{p:1,className:n.noPaddingLeft,children:(0,t.jsx)(w,{colour:he(e.bond_state)})}),(0,t.jsxs)(o.Z,{p:1,flexGrow:1,className:n.noPaddingLeft,children:[(0,t.jsx)(g.A,{text:e.bond_name}),(0,t.jsx)(g.A,{text:"".concat(e.bond_speed,"Mbps")})]}),(0,t.jsx)(o.Z,{display:"flex",style:{paddingTop:".5em"},children:e.hosts.map((function(r,i){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Z,{p:1,style:{paddingTop:0,paddingBottom:0},children:(0,t.jsxs)(o.Z,{children:[(0,t.jsx)(g.A,{text:r.host_name,selected:!1}),(0,t.jsx)(g.A,{text:r.link.link_name})]})},r.host_name),i!==e.hosts.length-1&&(0,t.jsx)(O.Z,{className:"".concat(n.divider," ").concat(n.verticalDivider),orientation:"vertical",flexItem:!0})]})}))})]}),(0,t.jsx)(O.Z,{className:n.divider})]})}))})]})},xe=r(7812),ge=r(282),pe=r(2318),me=r(5681),je=r(5639),ve=r(797),be=r(9067),_e=r(8513),we=r(1959),Ze=new Map([["running","Running"],["idle","Idle"],["paused","Paused"],["in shutdown","Shutting Down"],["shut off","Off"],["crashed","Crashed"],["pmsuspended","PM Suspended"],["migrating","Migrating"]]);function ye(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);rp.li?(0,t.jsxs)(o.Z,{className:e.container,children:[(0,t.jsxs)(o.Z,{className:e.child,children:[(0,t.jsx)(F,{list:r}),(0,t.jsx)(ne,{anvil:r.anvils})]}),(0,t.jsx)(o.Z,{className:e.server,children:(0,t.jsx)(Ae,{anvil:r.anvils})}),(0,t.jsx)(o.Z,{className:e.child,children:(0,t.jsx)(ce,{})}),(0,t.jsxs)(o.Z,{className:e.child,children:[(0,t.jsx)(fe,{}),(0,t.jsx)(re,{}),(0,t.jsx)(de,{})]})]}):(0,t.jsxs)(o.Z,{className:e.container,children:[(0,t.jsxs)(o.Z,{className:e.child,children:[(0,t.jsx)(Ae,{anvil:r.anvils}),(0,t.jsx)(F,{list:r}),(0,t.jsx)(ne,{anvil:r.anvils})]}),(0,t.jsxs)(o.Z,{className:e.child,children:[(0,t.jsx)(fe,{}),(0,t.jsx)(ce,{}),(0,t.jsx)(re,{}),(0,t.jsx)(de,{})]})]}))]})]})}}},function(e){e.O(0,[321,291,774,888,179],(function(){return n=5301,e(e.s=n);var n}));var n=e.O();_N_E=n}]);