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 line
11 KiB
1 line
11 KiB
10 months ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{48312:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(57368)}])},37039:function(e,t,n){"use strict";var r=n(85893),i=n(67294),s=n(48263),a=n(5616);t.Z=e=>{let{calculateItemBreakpoints:t=()=>({xs:1}),layout:n,wrapperBoxProps:l,...c}=e,o=(0,i.useMemo)(()=>{let e=Object.entries(n);return e.map((e,n)=>{let[r,a]=e;return a?(0,i.createElement)(s.ZP,{...t(n,r),key:r,item:!0,...a}):void 0})},[t,n]);return(0,r.jsx)(a.Z,{...l,children:(0,r.jsx)(s.ZP,{container:!0,...c,children:o})})}},69836:function(e,t,n){"use strict";var r=n(85893),i=n(43800),s=n(23795),a=n(6010),l=n(55238);t.Z=e=>{let{children:t,sx:n,...c}=e;return(0,r.jsx)(s.Z,{underline:"hover",variant:"subtitle1",...c,sx:{color:a.lD,textDecorationColor:a.s7,...n},children:(0,r.jsxs)(l.Z,{row:!0,children:[t,(0,r.jsx)(i.Z,{sx:{marginLeft:".3em"}})]})})}},67978:function(e,t,n){"use strict";var r=n(67294),i=n(8100),s=n(98436),a=n(96262);t.Z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{baseUrl:n=s.Z,fetcher:l=a.Z,mod:c,...o}=t,{data:d,error:u,mutate:h}=(0,i.ZP)("".concat(n).concat(e),l,o),x=(0,r.useMemo)(()=>c&&d&&c(d),[d,c]),v=!u&&!d;return{altData:x,data:d,error:u,mutate:h,loading:v}}},48882:function(e,t,n){"use strict";n.d(t,{Z:function(){return api_converters_toAnvilOverviewList}});var api_converters_toAnvilOverviewHostList=e=>e.reduce((e,t)=>{let{hostName:n,hostType:r,hostUUID:i}=t;return e[i]={name:n,type:r,uuid:i},e},{}),api_converters_toAnvilOverviewList=e=>e.reduce((e,t)=>{let{anvilDescription:n,anvilName:r,anvilUUID:i,hosts:s}=t;return e[i]={description:n,hosts:api_converters_toAnvilOverviewHostList(s),name:r,uuid:i},e},{})},57368:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return pages}});var r=n(85893),i=n(96540),s=n(48263),a=n(5616),l=n(67720),c=n(9008),o=n.n(c),d=n(67294),u=n(98436),h=n(6010),x=n(8673),v=n(54490),api_converters_toAnvilDetail=e=>{let{anvil_name:t,anvil_state:n,anvil_uuid:r,hosts:i}=e,s=i.reduce((e,t)=>{let{host_name:n,host_uuid:r,maintenance_mode:i,server_count:s,state:a,state_percent:l}=t;return e[r]={name:n,maintenance:i,serverCount:s,state:a,stateProgress:l,uuid:r},e},{});return{hosts:s,name:t,state:n,uuid:r}},api_converters_toAnvilMemoryCalcable=e=>{let{allocated:t,reserved:n,total:r}=e,i=BigInt(t),s=BigInt(n),a=BigInt(r);return{allocated:i,reserved:s,total:a}},api_converters_toAnvilSharedStorageOverview=e=>{let{storage_groups:t,total_free:n,total_size:r}=e,i=BigInt(n),s=BigInt(r);return t.reduce((e,t)=>{let{storage_group_free:n,storage_group_name:r,storage_group_total:i,storage_group_uuid:s}=t,a=BigInt(n),l=BigInt(i);return e.storageGroups[s]={free:a,name:r,size:l,uuid:s},e},{storageGroups:{},totalFree:i,totalSize:s})},m=n(57632),j=n(55238),_=n(81796),p=n(74376),Z=n(84154),g=n(67978);let f=BigInt(100),S={degraded:h.hM,not_ready:h.Wd,optimal:h.Ej},P={offline:h.Wd,online:h.Ej};var Anvils_AnvilSummary=e=>{let{anvilUuid:t}=e,{data:n,loading:i}=(0,g.Z)("/anvil/".concat(t)),a=(0,d.useMemo)(()=>n&&api_converters_toAnvilDetail(n),[n]),{data:l,loading:c}=(0,g.Z)("/anvil/".concat(t,"/cpu")),o=(0,d.useMemo)(()=>l&&Object.values(l.hosts),[l]),{data:u,loading:w}=(0,g.Z)("/anvil/".concat(t,"/memory")),A=(0,d.useMemo)(()=>u&&api_converters_toAnvilMemoryCalcable(u),[u]),{data:y,loading:b}=(0,g.Z)("/anvil/".concat(t,"/store")),C=(0,d.useMemo)(()=>y&&api_converters_toAnvilSharedStorageOverview(y),[y]),M=(0,d.useMemo)(()=>[i,c,w,b].some(e=>e),[i,c,w,b]),I=(0,d.useMemo)(()=>a&&(0,r.jsx)(Z.$_,{inheritColour:!0,color:S[a.state],children:a.state}),[a]),U=(0,d.useMemo)(()=>a&&(0,r.jsx)(s.ZP,{alignItems:"center",columns:20,columnSpacing:"0.5em",container:!0,sx:{["& > .".concat(x.Z.item,":nth-child(-n + 4)")]:{marginBottom:"-.6em"}},children:Object.values(a.hosts).map(e=>{var t;let n;let{name:i,serverCount:a,state:l,stateProgress:c,uuid:o}=e,d=null!==(t=P[l])&&void 0!==t?t:h.s7,u=l;return["offline","online"].includes(l)?n=(0,r.jsx)(Z.$_,{variant:"caption",children:a}):u="".concat(c,"%"),[(0,r.jsx)(s.ZP,{item:!0,xs:7,childre
|