(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{6187:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var r=t(5893),i=t(6265),o=t(7294),s=t(5258),a=t(1120),d=t(7748),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"},h=t(8788),x=t(7159),p=t(2822),g=t(998),f=t(5517),m=t(7623),j=t(442),v=t(4724);function b(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){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:5e3,t=(0,c.ZP)(e,l,{refreshInterval:n}),r=t.data,i=t.error;return{data:r,isLoading:!i&&!r,isError:i}},h=t(7294),x=t(9570),p=t(4724),g=t(8788),f=new Map([["optimal","Optimal"],["not_ready","Not Ready"],["degraded","Degraded"]]),m={uuid:"",setAnvilUuid:function(){return null}},j=(0,h.createContext)(m),v=function(e){var n=e.children,t=(0,h.useState)(""),i=t[0],o=t[1];return(0,r.jsx)(j.Provider,{value:{uuid:i,setAnvilUuid:function(e){o(e)}},children:n})},b=(0,a.Z)((function(){return{decorator:{width:"1.4em",height:"100%",borderRadius:g.n_},ok:{backgroundColor:g.Ej},warning:{backgroundColor:g.Wd},error:{backgroundColor:g.hM},off:{backgroundColor:g.s7}}})),_=function(e){var n=e.colour,t=b();return(0,r.jsx)("div",{className:"".concat(t.decorator," ").concat(t[n])})},Z=t(8870),w=(0,a.Z)((function(){return{root:{width:"100%","&:hover $child":{backgroundColor:g.Gf}},anvilName:{paddingLeft:0}}})),k=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";case"degraded":default:return"error"}},y=function(e){return!(-1===e.hosts.findIndex((function(e){return"offline"!==e.state})))},N=function(e){var n=e.list,t=(0,h.useContext)(j).uuid,i=w(),o=n.findIndex((function(e){return e.anvil_uuid===t}));return(0,r.jsx)(s.Z,{display:"flex",flexDirection:"row",width:"100%",children:""!==t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{p:1,children:(0,r.jsx)(_,{colour:k(n[o].anvil_state)})}),(0,r.jsxs)(s.Z,{p:1,flexGrow:1,className:i.anvilName,children:[(0,r.jsx)(p.z,{text:n[o].anvil_name}),(0,r.jsx)(p.z,{text:f.get(n[o].anvil_state)||"State unavailable"})]}),(0,r.jsx)(s.Z,{p:1,children:(0,r.jsx)(x.Z,{checked:y(n[o]),onChange:function(){return(0,Z.Z)("".concat("/cgi-bin","/set_power"),{anvil_uuid:n[o].anvil_uuid,is_on:!y(n[o])})}})})]})})},O=t(2822),C=t(5517),P=t(998),A=function(e){var n=e.anvil;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{text:n.anvil_name}),(0,r.jsx)(p.A,{text:f.get(n.anvil_state)||"State unavailable"})]})},D=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)},T=(0,a.Z)((function(e){return{root:(0,i.Z)({width:"100%",overflow:"auto",height:"30vh",paddingRight:".3em"},e.breakpoints.down(g.li),{height:"100%",overflow:"hidden"}),divider:{background:g.d},button:{"&:hover":{backgroundColor:g.$T},paddingLeft:0},anvil:{paddingLeft:0}}})),L=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";case"degraded":return"error";default:return"off"}},E=function(e){var n=e.list,t=(0,h.useContext)(j),i=t.uuid,o=t.setAnvilUuid,a=T();return(0,h.useEffect)((function(){""===i&&o(D(n)[0].anvil_uuid)}),[i,n,o]),(0,r.jsx)(O.Z,{component:"nav",className:a.root,"aria-label":"mailbox folders",children:D(n).map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Z,{className:a.divider}),(0,r.jsx)(P.Z,{button:!0,className:a.button,onClick:function(){return o(e.anvil_uuid)},children:(0,r.jsxs)(s.Z,{display:"flex",flexDirection:"row",width:"100%",children:[(0,r.jsx)(s.Z,{p:1,children:(0,r.jsx)(_,{colour:L(e.anvil_state)})}),(0,r.jsx)(s.Z,{p:1,flexGrow:1,className:a.anvil,children:(0,r.jsx)(A,{anvil:e})})]})},e.anvil_uuid)]})}))})};function S(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 B(e){for(var n=1;n70?n>90?t.barAlert:t.barWarning:t.barOk},variant:"determinate",value:n}),(0,r.jsx)(z.Z,{variant:"determinate",value:0})]})},U=(0,F.Z)({root:{height:"1em",borderRadius:g.n_},colorPrimary:{backgroundColor:g.v9},bar:{borderRadius:g.n_}})(z.Z),W=(0,a.Z)((function(){return{barOk:{backgroundColor:g.Ej},barInProgress:{backgroundColor:g.Wd}}})),q=function(e){var n=e.progressPercentage,t=W();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U,{classes:{bar:n<100?t.barInProgress:t.barOk},variant:"determinate",value:n}),(0,r.jsx)(z.Z,{variant:"determinate",value:0})]})},H=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."]]),V=(0,a.Z)((function(e){return{root:(0,i.Z)({overflow:"auto",height:"28vh",paddingLeft:".3em",paddingRight:".3em"},e.breakpoints.down(g.li),{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"}}})),$=function(e,n){var t=e.exec(n);return t?H.get(t[0])||"Error code not recognized":"Error code not found"},X=function(e){switch(e){case"online":return"ok";case"offline":return"off";default:return"warning"}},J=function(e){var n=e.hosts,t=V(),i=/^[a-zA-Z]/,o=/^(message_[0-9]+)/;return(0,r.jsx)(s.Z,{className:t.root,children:n&&n.map((function(e){var n;return(0,r.jsxs)(d.Lg,{children:[(0,r.jsx)(d.V9,{children:(0,r.jsxs)(s.Z,{display:"flex",width:"100%",className:t.header,children:[(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(p.A,{text:e.host_name})}),(0,r.jsx)(s.Z,{className:t.decoratorBox,children:(0,r.jsx)(_,{colour:X(e.state)})}),(0,r.jsx)(s.Z,{children:(0,r.jsx)(p.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,r.jsxs)(s.Z,{display:"flex",className:t.state,children:[(0,r.jsx)(s.Z,{className:t.label,children:(0,r.jsx)(p.A,{text:"Power: "})}),(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.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,r.jsx)(s.Z,{className:t.label,children:(0,r.jsx)(p.A,{text:"Member: "})}),(0,r.jsx)(s.Z,{children:(0,r.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,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{display:"flex",width:"100%",className:t.state,children:(0,r.jsx)(s.Z,{children:(0,r.jsx)(p.A,{text:$(o,e.state_message)})})}),(0,r.jsx)(s.Z,{display:"flex",width:"100%",className:t.bar,children:(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(q,{progressPercentage:e.state_percent})})})]})]},e.host_uuid)}))})},K=t(6061),Q=function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.host_uuid}))},Y=function(e){var n=e.anvil,t=(0,h.useContext)(j).uuid,i=u("".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)(d.s_,{children:[(0,r.jsx)(p.z,{text:"Nodes"}),s?(0,r.jsx)(K.Z,{}):(0,r.jsx)(r.Fragment,{children:-1!==a&&o&&(0,r.jsx)(J,{hosts:Q(n[a].hosts).map((function(e,n){return o.hosts[n]}))})})]})},ee=function(){var e=(0,h.useContext)(j).uuid,n=u("".concat("/cgi-bin","/get_cpu?anvil_uuid=").concat(e)),t=n.data,i=n.isLoading,o=i||!t?{allocated:0,cores:0,threads:0}:t;return(0,r.jsxs)(d.s_,{children:[(0,r.jsx)(p.z,{text:"CPU"}),i?(0,r.jsx)(K.Z,{}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(s.Z,{display:"flex",width:"100%",children:(0,r.jsxs)(s.Z,{flexGrow:1,style:{marginLeft:"1em",marginTop:"1em"},children:[(0,r.jsx)(p.A,{text:"Total Cores: ".concat(o.cores)}),(0,r.jsx)(p.A,{text:"Total Threads: ".concat(o.threads)}),(0,r.jsx)(p.A,{text:"Allocated Cores: ".concat(o.allocated)})]})})})]})},ne=t(8600),te=t.n(ne),re=(0,a.Z)((function(){return{fs:{paddingLeft:".7em",paddingRight:".7em",paddingTop:"1.2em"},bar:{paddingLeft:".7em",paddingRight:".7em"},decoratorBox:{paddingRight:".3em"}}})),ie=function(e){var n=e.group,t=re();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{display:"flex",width:"100%",className:t.fs,children:[(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(p.A,{text:"Used: ".concat(te()(n.storage_group_total-n.storage_group_free,{binary:!0}))})}),(0,r.jsx)(s.Z,{children:(0,r.jsx)(p.A,{text:"Free: ".concat(te()(n.storage_group_free,{binary:!0}))})})]}),(0,r.jsx)(s.Z,{display:"flex",width:"100%",className:t.bar,children:(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(M,{allocated:(n.storage_group_total-n.storage_group_free)/n.storage_group_total*100})})}),(0,r.jsx)(s.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,r.jsx)(p.A,{text:"Total Storage: ".concat(te()(n.storage_group_total,{binary:!0}))})})]})},oe=(0,a.Z)((function(e){return{header:{paddingTop:".1em",paddingRight:".7em"},root:(0,i.Z)({overflow:"auto",height:"78vh",paddingLeft:".3em",paddingRight:".3em"},e.breakpoints.down(g.li),{height:"100%"})}})),se=function(){var e=oe(),n=(0,h.useContext)(j).uuid,t=u("".concat("/cgi-bin","/get_shared_storage?anvil_uuid=").concat(n)),i=t.data,o=t.isLoading;return(0,r.jsxs)(d.s_,{children:[(0,r.jsx)(p.z,{text:"Shared Storage"}),o?(0,r.jsx)(K.Z,{}):(0,r.jsx)(s.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)(d.Lg,{children:[(0,r.jsx)(d.V9,{children:(0,r.jsx)(s.Z,{display:"flex",width:"100%",className:e.header,children:(0,r.jsx)(s.Z,{children:(0,r.jsx)(p.A,{text:n.storage_group_name})})})}),(0,r.jsx)(ie,{group:n},n.storage_group_uuid)]},n.storage_group_uuid)}))})]})},ae=function(){var e=(0,h.useContext)(j).uuid,n=u("".concat("/cgi-bin","/get_memory?anvil_uuid=").concat(e)),t=n.data,i=n.isLoading,o=i||!t?{total:0,allocated:0,reserved:0}:t;return(0,r.jsxs)(d.s_,{children:[(0,r.jsx)(p.z,{text:"Memory"}),i?(0,r.jsx)(K.Z,{}):(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsxs)(s.Z,{display:"flex",width:"100%",children:[(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(p.A,{text:"Allocated: ".concat(te()(o.allocated,{binary:!0}))})}),(0,r.jsx)(s.Z,{children:(0,r.jsx)(p.A,{text:"Free: ".concat(te()(o.total-o.allocated,{binary:!0}))})})]}),(0,r.jsx)(s.Z,{display:"flex",width:"100%",children:(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(M,{allocated:o.allocated/o.total*100})})}),(0,r.jsx)(s.Z,{display:"flex",justifyContent:"center",width:"100%",children:(0,r.jsx)(p.A,{text:"Total: ".concat(te()(o.total,{binary:!0})," | Reserved: ").concat(te()(o.reserved,{binary:!0}))})})]})]})},de=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},ce=(0,a.Z)((function(e){return{container:(0,i.Z)({width:"100%",overflow:"auto",height:"32vh",paddingRight:".3em"},e.breakpoints.down(g.li),{height:"100%",overflow:"hidden"}),root:{paddingTop:".7em",paddingBottom:".7em"},noPaddingLeft:{paddingLeft:0},divider:{background:g.d},verticalDivider:{height:"3.5em"}}})),le=function(e){switch(e){case"optimal":return"ok";case"degraded":return"warning";case"down":return"error";default:return"warning"}},ue=function(){var e=(0,h.useContext)(j).uuid,n=ce(),t=u("".concat("/cgi-bin","/get_networks?anvil_uuid=").concat(e)),i=t.data,o=t.isLoading,a=de(i);return(0,r.jsxs)(d.s_,{children:[(0,r.jsx)(p.z,{text:"Network"}),o?(0,r.jsx)(K.Z,{}):(0,r.jsx)(s.Z,{className:n.container,children:i&&a.bonds.map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.Z,{display:"flex",flexDirection:"row",width:"100%",className:n.root,children:[(0,r.jsx)(s.Z,{p:1,className:n.noPaddingLeft,children:(0,r.jsx)(_,{colour:le(e.bond_state)})}),(0,r.jsxs)(s.Z,{p:1,flexGrow:1,className:n.noPaddingLeft,children:[(0,r.jsx)(p.A,{text:e.bond_name}),(0,r.jsx)(p.A,{text:"".concat(e.bond_speed,"Mbps")})]}),(0,r.jsx)(s.Z,{display:"flex",style:{paddingTop:".5em"},children:e.hosts.map((function(t,i){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{p:1,style:{paddingTop:0,paddingBottom:0},children:(0,r.jsxs)(s.Z,{children:[(0,r.jsx)(p.A,{text:t.host_name,selected:!1}),(0,r.jsx)(p.A,{text:t.link.link_name})]})},t.host_name),i!==e.hosts.length-1&&(0,r.jsx)(C.Z,{className:"".concat(n.divider," ").concat(n.verticalDivider),orientation:"vertical",flexItem:!0})]})}))})]}),(0,r.jsx)(C.Z,{className:n.divider})]})}))})]})},he=t(1385),xe=t(7812),pe=t(282),ge=t(2318),fe=t(5675),me=t(5639),je=t(3258),ve=t(9067),be=t(8513),_e=t(1959),Ze=new Map([["running","Running"],["idle","Idle"],["paused","Paused"],["in shutdown","Shutting Down"],["shut off","Off"],["crashed","Crashed"],["pmsuspended","PM Suspended"],["migrating","Migrating"]]),we=(0,a.Z)((function(e){return{root:(0,i.Z)({width:"100%",overflow:"auto",height:"78vh",paddingRight:".3em"},e.breakpoints.down(g.li),{height:"100%",overflow:"hidden"}),divider:{background:g.d},verticalDivider:{height:"75%",paddingTop:"1em"},button:{"&:hover":{backgroundColor:g.$T},paddingLeft:0},headerPadding:{paddingLeft:".3em"},hostsBox:{padding:"1em",paddingRight:0},hostBox:{paddingTop:0},checkbox:{paddingTop:".8em"},menuItem:{backgroundColor:g.lD,paddingRight:"3em","&:hover":{backgroundColor:g.lD}},editButton:{borderRadius:8,backgroundColor:g.s7,"&:hover":{backgroundColor:g.lD}},editButtonBox:{paddingTop:".3em"},dropdown:{paddingTop:".8em",paddingBottom:".8em"},power:{color:g.E5},on:{color:g.Ej},off:{color:g.hM},all:{paddingTop:".5em",paddingLeft:".3em"}}})),ke=function(e){switch(e){case"running":return"ok";case"shut off":return"off";case"crashed":return"error";default:return"warning"}},ye=["on","off"],Ne=function(e){var n,t=e.anvil,i=(0,h.useState)(null),o=i[0],a=i[1],c=(0,h.useState)(!1),l=c[0],x=c[1],f=(0,h.useState)(!1),m=f[0],v=f[1],b=(0,h.useState)([]),w=b[0],k=b[1],y=(0,h.useContext)(j).uuid,N=we(),A=u("".concat("/cgi-bin","/get_servers?anvil_uuid=").concat(y)),D=A.data,T=A.isLoading,L=t.findIndex((function(e){return e.anvil_uuid===y})),E=Q(null===(n=t[L])||void 0===n?void 0:n.hosts);return(0,r.jsxs)(d.s_,{children:[(0,r.jsxs)(s.Z,{className:N.headerPadding,display:"flex",children:[(0,r.jsx)(s.Z,{flexGrow:1,children:(0,r.jsx)(p.z,{text:"Servers"})}),(0,r.jsx)(s.Z,{className:N.editButtonBox,children:(0,r.jsx)(xe.Z,{className:N.editButton,style:{color:g.E5},onClick:function(){return x(!l)},children:l?(0,r.jsx)(_e.Z,{}):(0,r.jsx)(ve.Z,{})})})]}),l&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{className:N.headerPadding,display:"flex",children:(0,r.jsxs)(s.Z,{flexGrow:1,className:N.dropdown,children:[(0,r.jsx)(pe.Z,{variant:"contained",startIcon:(0,r.jsx)(be.Z,{}),onClick:function(e){a(e.currentTarget)},style:{textTransform:"none"},children:(0,r.jsx)(ge.Z,{className:N.power,variant:"subtitle1",children:"Power"})}),(0,r.jsx)(fe.Z,{anchorEl:o,keepMounted:!0,open:Boolean(o),onClose:function(){return a(null)},children:ye.map((function(e){return(0,r.jsx)(me.Z,{onClick:function(){return function(e){a(null),w.length&&(0,Z.Z)("".concat("/cgi-bin","/set_power"),{server_uuid_list:w,is_on:"on"===e})}(e)},className:N.menuItem,children:(0,r.jsx)(ge.Z,{className:N[e],variant:"subtitle1",children:e.replace(/^[a-z]/,(function(e){return e.toUpperCase()}))})},e)}))})]})}),(0,r.jsxs)(s.Z,{display:"flex",children:[(0,r.jsx)(s.Z,{children:(0,r.jsx)(je.Z,{style:{color:g.lD},color:"secondary",checked:m,onChange:function(){k(m?[]:D.servers.map((function(e){return e.server_uuid}))),v(!m)}})}),(0,r.jsx)(s.Z,{className:N.all,children:(0,r.jsx)(p.A,{text:"All"})})]})]}),T?(0,r.jsx)(K.Z,{}):(0,r.jsx)(s.Z,{className:N.root,children:(0,r.jsx)(O.Z,{component:"nav",children:D&&D.servers.map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.Z,{button:!0,className:N.button,component:"a",href:"/server?uuid=".concat(e.server_uuid,"&server_name=").concat(e.server_name),children:(0,r.jsxs)(s.Z,{display:"flex",flexDirection:"row",width:"100%",children:[l&&(0,r.jsx)(s.Z,{className:N.checkbox,children:(0,r.jsx)(je.Z,{style:{color:g.lD},color:"secondary",checked:void 0!==w.find((function(n){return n===e.server_uuid})),onChange:function(){return function(e){var n=w.indexOf(e);-1===n?w.push(e):w.splice(n,1),k((0,he.Z)(w))}(e.server_uuid)}})}),(0,r.jsx)(s.Z,{p:1,children:(0,r.jsx)(_,{colour:ke(e.server_state)})}),(0,r.jsxs)(s.Z,{p:1,flexGrow:1,children:[(0,r.jsx)(p.A,{text:e.server_name}),(0,r.jsx)(p.A,{text:Ze.get(e.server_state)||"Not Available"})]}),(0,r.jsx)(s.Z,{display:"flex",className:N.hostsBox,children:"shut off"!==e.server_state&&"crashed"!==e.server_state&&E.map((function(n,t){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{p:1,className:N.hostBox,children:(0,r.jsx)(p.A,{text:n.host_name,selected:e.server_host_uuid===n.host_uuid})},n.host_uuid),t!==E.length-1&&(0,r.jsx)(C.Z,{className:"".concat(N.divider," ").concat(N.verticalDivider),orientation:"vertical"})]})}))})]})},e.server_uuid),(0,r.jsx)(C.Z,{className:N.divider})]})}))})})]})},Oe=t(6187),Ce=function(){var e=(0,h.useState)(void 0),n=e[0],t=e[1];return(0,h.useEffect)((function(){var e=function(){t(window.innerWidth)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),n},Pe=(0,a.Z)((function(e){var n;return{child:(n={width:"22%",height:"100%"},(0,i.Z)(n,e.breakpoints.down(g.li),{width:"50%"}),(0,i.Z)(n,e.breakpoints.down("md"),{width:"100%"}),n),server:(0,i.Z)({width:"35%",height:"100%"},e.breakpoints.down("md"),{width:"100%"}),container:(0,i.Z)({display:"flex",flexDirection:"row",width:"100%",justifyContent:"space-between"},e.breakpoints.down("md"),{display:"block"})}})),Ae=function(){var e=Pe(),n=Ce(),t=u("".concat("/cgi-bin","/get_anvils")).data;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.default,{children:(0,r.jsx)("title",{children:"Dashboard"})}),(0,r.jsxs)(v,{children:[(0,r.jsx)(Oe.Z,{}),(null===t||void 0===t?void 0:t.anvils)&&n&&(n>g.li?(0,r.jsxs)(s.Z,{className:e.container,children:[(0,r.jsxs)(s.Z,{className:e.child,children:[(0,r.jsx)(R,{list:t}),(0,r.jsx)(Y,{anvil:t.anvils})]}),(0,r.jsx)(s.Z,{className:e.server,children:(0,r.jsx)(Ne,{anvil:t.anvils})}),(0,r.jsx)(s.Z,{className:e.child,children:(0,r.jsx)(se,{})}),(0,r.jsxs)(s.Z,{className:e.child,children:[(0,r.jsx)(ue,{}),(0,r.jsx)(ee,{}),(0,r.jsx)(ae,{})]})]}):(0,r.jsxs)(s.Z,{className:e.container,children:[(0,r.jsxs)(s.Z,{className:e.child,children:[(0,r.jsx)(Ne,{anvil:t.anvils}),(0,r.jsx)(R,{list:t}),(0,r.jsx)(Y,{anvil:t.anvils})]}),(0,r.jsxs)(s.Z,{className:e.child,children:[(0,r.jsx)(ue,{}),(0,r.jsx)(se,{}),(0,r.jsx)(ee,{}),(0,r.jsx)(ae,{})]})]}))]})]})}},5301:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(1316)}])}},function(e){e.O(0,[642,254,774,888,179],(function(){return n=5301,e(e.s=n);var n}));var n=e.O();_N_E=n}]);