Local modifications to ClusterLabs/Anvil by Alteeve
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
23 KiB

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[466],{96674:function(e,t,s){var n=s(85893),i=s(89256),r=s(62191),l=s(89262),o=s(59879),a=s(324),c=s(28721),u=s(73315),p=s(14440),d=s(55074),x=s(67294),m=s(77831),h=s(34635),g=s(91029);let v=e=>(0,n.jsx)(i.Z,{in:!0,children:(0,n.jsx)(r.Z,{...e})}),U=(0,l.ZP)("ul")({padding:0}),f=o.Z;t.Z=e=>{let{componentsProps:t,extendRenderInput:s,getGroupLabel:i,label:r,messageBoxProps:l,renderGroup:o,renderInput:S,sx:j,...I}=e,D=(0,x.useMemo)(()=>({paper:{sx:{backgroundColor:m.lD,["& .".concat(a.Z.groupLabel)]:{backgroundColor:m.lD}}},...t}),[t]),b=(0,x.useMemo)(()=>o||i&&(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)(f,{component:"div",className:a.Z.groupLabel,children:i(e.group)}),(0,n.jsx)(U,{className:a.Z.groupUl,children:e.children})]},e.key)),[i,o]),y=(0,x.useMemo)(()=>null!=S?S:e=>{let{fullWidth:t,InputProps:i,InputLabelProps:l,inputProps:o}=e,a={formControlProps:{fullWidth:t,ref:i.ref},inputLabelProps:l,inputProps:{className:i.className,endAdornment:i.endAdornment,inputProps:o,startAdornment:i.startAdornment},label:r};return null==s||s.call(null,a,e),(0,n.jsx)(g.Z,{...a})},[s,r,S]),P=(0,x.useMemo)(()=>({["& .".concat(c.Z.root," .").concat(a.Z.endAdornment)]:{right:"7px",["& .".concat(u.Z.root)]:{color:m.s7}},...j}),[j]);return(0,n.jsxs)(p.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,n.jsx)(d.Z,{PaperComponent:v,...I,componentsProps:D,renderGroup:b,renderInput:y,sx:P}),(0,n.jsx)(h.Z,{...l})]})}},56466:function(e,t,s){let n,i;s.d(t,{Z:function(){return V}});var r=s(85893),l=s(67294),o=s(14440),a=s(99514),c=s(92309),u=s(12641),p=s(25934),d=s(77831),x=s(98484),m=s(96674),h=s(77583),g=s(99429),v=s(56903),U=s(62800),f=s(65895),S=s(99576),j=s(91029),I=s(20408),D=s(28721),b=s(34635),y=s(6189);let P={inputWithLabelProps:{},messageBoxProps:{},selectWithLabelProps:{}},Z=e=>{let{id:t,label:s,inputWithLabelProps:n=P.inputWithLabelProps,messageBoxProps:i=P.messageBoxProps,selectItems:l,selectWithLabelProps:a=P.selectWithLabelProps}=e;return(0,r.jsxs)(o.Z,{children:[(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"row","& > :first-child":{flexGrow:1},"& > :not(:last-child)":{marginRight:".5em"},["&:hover\n .".concat(I.Z.root,"\n .").concat(D.Z.root,"\n .").concat(D.Z.notchedOutline)]:{borderColor:d.s7}},children:[(0,r.jsx)(j.Z,{id:t,label:s,...n}),(0,r.jsx)(y.Z,{formControlProps:{fullWidth:!1,sx:{minWidth:"min-content"}},id:"".concat(t,"-nested-select"),selectItems:l,...a})]}),(0,r.jsx)(b.Z,{...i})]})};Z.defaultProps=P;var M=s(23930),C=s(25137),G=s(52675),A=s(59278);let k=BigInt(0),B=[{value:"B"},{value:"KiB"},{value:"MiB"},{value:"GiB"},{value:"TiB"}],z=BigInt(65536),w=BigInt(104857600),T={backgroundColor:d.Ej,color:d.lD,"&:hover":{backgroundColor:d.Ej}},N=(e,t)=>{let{onButtonClick:s}=t;return(0,r.jsx)(g.Z,{disabled:void 0===s,onClick:s,sx:{minWidth:"unset",whiteSpace:"nowrap"},children:"Max: ".concat(e)})},O=function(){let{endAdornment:e,mainLabel:t,subLabel:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.jsxs)(o.Z,{sx:{alignItems:"center",display:"flex",flexDirection:"row",width:"100%","& > :first-child":{flexGrow:1}},children:[(0,r.jsxs)(o.Z,{sx:{display:"flex",flexDirection:"column"},children:[t&&(0,r.jsx)(A.Ac,{inverted:!0,text:t}),s&&(0,r.jsx)(A.Ac,{inverted:!0,text:s})]}),e]})},F=e=>{let t={},s=e.reduce((e,s)=>{let{anvilUUID:n,anvilName:i,anvilTotalMemory:l,anvilTotalAllocatedMemory:a,anvilTotalAvailableMemory:c,hosts:u,servers:p,storageGroups:d,files:x}=s,{anvilStorageGroups:m,anvilStorageGroupUUIDs:h}=d.reduce((t,s)=>{let l={...s,anvilUUID:n,anvilName:i,storageGroupSize:BigInt(s.storageGroupSize),storageGroupFree:BigInt(s.storageGroupFree),humanizedStorageGroupFree:""};return(0,U.Bh)(s.storageGroupFree,{fromUnit:"B",onSuccess:{string:(e,t)=>{l.humanizedStorageGroupFree="".concat(e," ").concat(t)}},precision:0,toUnit:"ibyte"}),t.anvilStorageGroupUUIDs.push(s.storageGroupUUID),t.anvilStorageGroups.push(l),e.storageGroups.push(l),e.storageGroupSelectItems.push({displayValue:O({endAdornment:(0,r.jsx)(A.Ac,{i