(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{5301:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(4990)}])},9297:function(e,n,t){"use strict";t.d(n,{C:function(){return h},k:function(){return m}});var r=t(5893),o=t(1458),a=t(1496),i=t(7169),c=(0,a.ZP)(o.Z)({height:"1em",borderRadius:i.n_,backgroundColor:i.v9});function s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var d="AllocationBar",l={barOk:"".concat(d,"-barOk"),barWarning:"".concat(d,"-barWarning"),barAlert:"".concat(d,"-barAlert"),underline:"".concat(d,"-underline")},u=(0,a.ZP)("div")((function(){var e;return s(e={},"& .".concat(l.barOk),{backgroundColor:i.Ej}),s(e,"& .".concat(l.barWarning),{backgroundColor:i.Wd}),s(e,"& .".concat(l.barAlert),{backgroundColor:i.hM}),s(e,"& .".concat(l.underline),{borderRadius:i.n_}),e})),h=function(e){var n=e.allocated;return(0,r.jsxs)(u,{children:[(0,r.jsx)(c,{classes:{bar:n>70?n>90?l.barAlert:l.barWarning:l.barOk},variant:"determinate",value:n}),(0,r.jsx)(o.Z,{className:l.underline,variant:"determinate",value:0})]})};function f(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var x="ProgressBar",g={barOk:"".concat(x,"-barOk"),barInProgress:"".concat(x,"-barInProgress"),underline:"".concat(x,"-underline")},v=(0,a.ZP)("div")((function(){var e;return f(e={},"& .".concat(g.barOk),{backgroundColor:i.Ej}),f(e,"& .".concat(g.barInProgress),{backgroundColor:i.Wd}),f(e,"& .".concat(g.underline),{borderRadius:i.n_}),e})),m=function(e){var n=e.progressPercentage;return(0,r.jsxs)(v,{children:[(0,r.jsx)(c,{classes:{bar:n<100?g.barInProgress:g.barOk},variant:"determinate",value:n}),(0,r.jsx)(o.Z,{className:g.underline,variant:"determinate",value:0})]})}},1706:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(1496),o=t(3946),a=t(7169),i=(0,r.ZP)(o.Z)({borderRadius:a.n_,backgroundColor:a.s7,"&:hover":{backgroundColor:a.lD},color:a.E5})},1200:function(e,n){"use strict";function t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t1&&void 0!==arguments[1]?arguments[1]:{},t=n.refreshInterval,a=void 0===t?5e3:t,i=n.onSuccess,c=(0,r.ZP)(e,o.Z,{refreshInterval:a,onSuccess:i}),s=c.data,d=c.error;return{data:s,isLoading:!d&&!s,isError:d}}},8336:function(e,n){"use strict";n.Z=function(e,n){return fetch(e,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}},4990:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return hn}});var r=t(5893),o=t(9008),a=t(7357),i=t(1496),c=t(9203),s=t(1905),d=t(7294),l=t(3366),u=t(7462),h=t(6010),f=t(7192),x=t(1796),g=t(8216),v=t(1964),m=t(7623),p=t(9632);const b=["className","color","edge","size","sx"],j=(0,i.ZP)("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,t.edge&&n[`edge${(0,g.Z)(t.edge)}`],n[`size${(0,g.Z)(t.size)}`]]}})((({ownerState:e})=>(0,u.Z)({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},"start"===e.edge&&{marginLeft:-8},"end"===e.edge&&{marginRight:-8},"small"===e.size&&{width:40,height:24,padding:7,[`& .${p.Z.thumb}`]:{width:16,height:16},[`& .${p.Z.switchBase}`]:{padding:4,[`&.${p.Z.checked}`]:{transform:"translateX(16px)"}}}))),Z=(0,i.ZP)(v.Z,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.switchBase,{[`& .${p.Z.input}`]:n.input},"default"!==t.color&&n[`color${(0,g.Z)(t.color)}`]]}})((({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.mode?e.palette.common.white:e.palette.grey[300],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${p.Z.checked}`]:{transform:"translateX(20px)"},[`&.${p.Z.disabled}`]:{color:"light"===e.palette.mode?e.palette.grey[100]:e.palette.grey[600]},[`&.${p.Z.checked} + .${p.Z.track}`]:{opacity:.5},[`&.${p.Z.disabled} + .${p.Z.track}`]:{opacity:"light"===e.palette.mode?.12:.2},[`& .${p.Z.input}`]:{left:"-100%",width:"300%"}})),(({theme:e,ownerState:n})=>(0,u.Z)({"&:hover":{backgroundColor:(0,x.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==n.color&&{[`&.${p.Z.checked}`]:{color:e.palette[n.color].main,"&:hover":{backgroundColor:(0,x.Fq)(e.palette[n.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${p.Z.disabled}`]:{color:"light"===e.palette.mode?(0,x.$n)(e.palette[n.color].main,.62):(0,x._j)(e.palette[n.color].main,.55)}},[`&.${p.Z.checked} + .${p.Z.track}`]:{backgroundColor:e.palette[n.color].main}}))),w=(0,i.ZP)("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,n)=>n.track})((({theme:e})=>({height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.mode?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.mode?.38:.3}))),_=(0,i.ZP)("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,n)=>n.thumb})((({theme:e})=>({boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),y=d.forwardRef((function(e,n){const t=(0,m.Z)({props:e,name:"MuiSwitch"}),{className:o,color:a="primary",edge:i=!1,size:c="medium",sx:s}=t,d=(0,l.Z)(t,b),x=(0,u.Z)({},t,{color:a,edge:i,size:c}),v=(e=>{const{classes:n,edge:t,size:r,color:o,checked:a,disabled:i}=e,c={root:["root",t&&`edge${(0,g.Z)(t)}`,`size${(0,g.Z)(r)}`],switchBase:["switchBase",`color${(0,g.Z)(o)}`,a&&"checked",i&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},s=(0,f.Z)(c,p.H,n);return(0,u.Z)({},n,s)})(x),y=(0,r.jsx)(_,{className:v.thumb,ownerState:x});return(0,r.jsxs)(j,{className:(0,h.Z)(v.root,o),sx:s,ownerState:x,children:[(0,r.jsx)(Z,(0,u.Z)({type:"checkbox",icon:y,checkedIcon:y,ref:n,ownerState:x},d,{classes:(0,u.Z)({},v,{root:v.switchBase})})),(0,r.jsx)(w,{className:v.track,ownerState:x})]})}));var k=y,A=t(3430),C=new Map([["optimal","Optimal"],["not_ready","Not Ready"],["degraded","Degraded"]]),N={uuid:"",setAnvilUuid:function(){return null}},P=(0,d.createContext)(N),S=function(e){var n=e.children,t=(0,d.useState)(""),o=t[0],a=t[1];return(0,r.jsx)(P.Provider,{value:{uuid:o,setAnvilUuid:function(e){a(e)}},children:n})},O=t(7169);function B(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var T="Decorator",R={ok:"".concat(T,"-ok"),warning:"".concat(T,"-warning"),error:"".concat(T,"-error"),off:"".concat(T,"-off")},L=(0,i.ZP)("div")((function(){var e;return B(e={width:"1.4em",height:"100%",borderRadius:O.n_},"&.".concat(R.ok),{backgroundColor:O.Ej}),B(e,"&.".concat(R.warning),{backgroundColor:O.Wd}),B(e,"&.".concat(R.error),{backgroundColor:O.hM}),B(e,"&.".concat(R.off),{backgroundColor:O.s7}),e})),E=function(e){var n=e.colour;return(0,r.jsx)(L,{className:R[n]})},z=t(8336);var I={anvilName:"".concat("SelectedAnvil","-anvilName")},$=(0,i.ZP)(a.Z)((function(){return e={display:"flex",flexDirection:"row",width:"100%"},n="& .".concat(I.anvilName),t={paddingLeft:0},n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e;var e,n,t})),D=function(e){switch(e){case"optimal":return"ok";case"not_ready":return"warning";default:return"error"}},M=function(e){return!(-1===e.hosts.findIndex((function(e){return"offline"!==e.state})))},F=function(e){var n=e.list,t=(0,d.useContext)(P).uuid,o=n.findIndex((function(e){return e.anvil_uuid===t}));return(0,r.jsx)($,{children:""!==t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{p:1,children:(0,r.jsx)(E,{colour:D(n[o].anvil_state)})}),(0,r.jsxs)(a.Z,{p:1,flexGrow:1,className:I.anvilName,children:[(0,r.jsx)(A.z,{text:n[o].anvil_name}),(0,r.jsx)(A.z,{text:C.get(n[o].anvil_state)||"State unavailable"})]}),(0,r.jsx)(a.Z,{p:1,children:(0,r.jsx)(k,{checked:M(n[o]),onChange:function(){return(0,z.Z)("".concat("/cgi-bin","/set_power"),{anvil_uuid:n[o].anvil_uuid,is_on:!M(n[o])})}})})]})})},G=t(8462),U=t(7720),W=t(891),H=function(e){var n=e.anvil;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(A.A,{text:n.anvil_name}),(0,r.jsx)(A.A,{text:C.get(n.anvil_state)||"State unavailable"})]})};function X(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.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};function Oe(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var Be="Network",Te={container:"".concat(Be,"-container"),root:"".concat(Be,"-root"),noPaddingLeft:"".concat(Be,"-noPaddingLeft"),divider:"".concat(Be,"-divider"),verticalDivider:"".concat(Be,"-verticalDivider")},Re=(0,i.ZP)("div")((function(e){var n,t=e.theme;return Oe(n={},"& .".concat(Te.container),Oe({width:"100%",overflow:"auto",height:"32vh",paddingRight:".3em"},t.breakpoints.down(O.li),{height:"100%",overflow:"hidden"})),Oe(n,"& .".concat(Te.root),{paddingTop:".7em",paddingBottom:".7em"}),Oe(n,"& .".concat(Te.noPaddingLeft),{paddingLeft:0}),Oe(n,"& .".concat(Te.divider),{backgroundColor:O.d}),Oe(n,"& .".concat(Te.verticalDivider),{height:"3.5em"}),n})),Le=function(e){switch(e){case"optimal":return"ok";case"degraded":default:return"warning";case"down":return"error"}},Ee=function(){var e=(0,d.useContext)(P).uuid,n=(0,s.Z)("".concat("/cgi-bin","/get_networks?anvil_uuid=").concat(e)),t=n.data,o=n.isLoading,i=Se(t);return(0,r.jsx)(c.s_,{children:(0,r.jsxs)(Re,{children:[(0,r.jsx)(A.z,{text:"Network"}),o?(0,r.jsx)(fe.Z,{}):(0,r.jsx)(a.Z,{className:Te.container,children:t&&i.bonds.map((function(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.Z,{display:"flex",flexDirection:"row",width:"100%",className:Te.root,children:[(0,r.jsx)(a.Z,{p:1,className:Te.noPaddingLeft,children:(0,r.jsx)(E,{colour:Le(e.bond_state)})}),(0,r.jsxs)(a.Z,{p:1,flexGrow:1,className:Te.noPaddingLeft,children:[(0,r.jsx)(A.A,{text:e.bond_name}),(0,r.jsx)(A.A,{text:"".concat(e.bond_speed,"Mbps")})]}),(0,r.jsx)(a.Z,{display:"flex",style:{paddingTop:".5em"},children:e.hosts.map((function(n,t){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{p:1,style:{paddingTop:0,paddingBottom:0},children:(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(A.A,{text:n.host_name,selected:!1}),(0,r.jsx)(A.A,{text:n.link.link_name})]})},n.host_name),t!==e.hosts.length-1&&(0,r.jsx)(U.Z,{className:"".concat(Te.divider," ").concat(Te.verticalDivider),orientation:"vertical",flexItem:!0})]})}))})]}),(0,r.jsx)(U.Z,{className:Te.divider})]})}))})]})})},ze=t(40),Ie=t(5861),$e=t(3321),De=t(7850),Me=t(8128),Fe=t(2428),Ge=t(2026),Ue=t(1797),We=(0,t(8169).Z)((0,r.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert"),He=new Map([["running","Running"],["idle","Idle"],["paused","Paused"],["in shutdown","Shutting Down"],["shut off","Off"],["crashed","Crashed"],["pmsuspended","PM Suspended"],["migrating","Migrating"]]),Xe=t(1706);function qe(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);tO.li?(0,r.jsxs)(a.Z,{className:ln.container,children:[(0,r.jsxs)(a.Z,{className:ln.child,children:[(0,r.jsx)(re,{list:n}),(0,r.jsx)(ge,{anvil:n.anvils})]}),(0,r.jsx)(a.Z,{className:ln.server,children:(0,r.jsx)(on,{anvil:n.anvils})}),(0,r.jsx)(a.Z,{className:ln.child,children:(0,r.jsx)(Ne,{})}),(0,r.jsxs)(a.Z,{className:ln.child,children:[(0,r.jsx)(Ee,{}),(0,r.jsx)(ve,{}),(0,r.jsx)(Pe,{})]})]}):(0,r.jsxs)(a.Z,{className:ln.container,children:[(0,r.jsxs)(a.Z,{className:ln.child,children:[(0,r.jsx)(on,{anvil:n.anvils}),(0,r.jsx)(re,{list:n}),(0,r.jsx)(ge,{anvil:n.anvils})]}),(0,r.jsxs)(a.Z,{className:ln.child,children:[(0,r.jsx)(Ee,{}),(0,r.jsx)(Ne,{}),(0,r.jsx)(ve,{}),(0,r.jsx)(Pe,{})]})]}))]})]})}}},function(e){e.O(0,[806,100,478,774,888,179],(function(){return n=5301,e(e.s=n);var n}));var n=e.O();_N_E=n}]);