"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2491],{71102:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(65043),a=i(89923),l=i(70579);const s=e=>{let{timeStart:t,setTimeStart:i,timeEnd:s,setTimeEnd:r,triggerSync:o,label:d="Filter:",startLabel:x="Start Time:",endLabel:c="End Time:"}=e;return(0,l.jsx)(a.xA9,{item:!0,xs:12,sx:{"& .filter-date-input-label, .end-time-input-label":{display:"none"},"& .MuiInputBase-adornedEnd.filter-date-date-time-input":{width:"100%",border:"1px solid #eaeaea",paddingLeft:"8px",paddingRight:"8px",borderRadius:"1px"},"& .MuiInputAdornment-root button":{height:"20px",width:"20px",marginRight:"5px"},"& .filter-date-input-wrapper":{height:"30px",width:"100%","& .MuiTextField-root":{height:"30px",width:"90%","& input.Mui-disabled":{color:"#000000",WebkitTextFillColor:"#101010"}}}},children:(0,l.jsxs)(a.azJ,{sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"auto 2fr auto",padding:0,[`@media (max-width: ${a.nmC.sm}px)`]:{padding:5},[`@media (max-width: ${a.nmC.md}px)`]:{gridTemplateColumns:"1fr",height:"auto"},gap:"5px"},children:[(0,l.jsx)(a.azJ,{sx:{fontSize:"14px",fontWeight:500,marginRight:"5px"},className:"muted",children:d}),(0,l.jsxs)(a.azJ,{customBorderPadding:"0px",sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"1fr 1fr",gap:"8px",paddingLeft:"8px",paddingRight:"8px",[`@media (max-width: ${a.nmC.md}px)`]:{height:"auto",gridTemplateColumns:"1fr"}},children:[(0,l.jsx)(a.e8j,{value:t,onChange:i,id:"stTime",secondsSelector:!1,pickerStartComponent:(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)(a.b1c,{}),(0,l.jsx)("span",{children:x})]})}),(0,l.jsx)(a.e8j,{value:s,onChange:r,id:"endTime",secondsSelector:!1,pickerStartComponent:(0,l.jsxs)(n.Fragment,{children:[(0,l.jsx)(a.b1c,{}),(0,l.jsx)("span",{children:c})]})})]}),o&&(0,l.jsx)(a.azJ,{sx:{alignItems:"flex-end",display:"flex",justifyContent:"flex-end"},children:(0,l.jsx)(a.$nd,{id:"sync",type:"button",variant:"callAction",onClick:o,icon:(0,l.jsx)(a.Fjq,{}),label:"Sync"})})]})})}},94141:(e,t,i)=>{i.d(t,{A:()=>x});var n=i(65043),a=i(22166),l=i(89923),s=i(21383),r=i(64159),o=i(49555),d=i(70579);const x=e=>{let{onClose:t,modalOpen:i,title:x,children:c,wideLimit:m=!0,titleIcon:p=null,iconColor:g="default",sx:h}=e;const u=(0,s.jL)(),[f,j]=(0,n.useState)(!1),C=(0,a.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{u((0,r.h0)(""))}),[u]),(0,n.useEffect)((()=>{if(C){if(""===C.message)return void j(!1);"error"!==C.type&&j(!0)}}),[C]);let y="";return C&&(y=C.detailedErrorMsg,(""===y||y&&y.length<5)&&(y=C.message)),(0,d.jsxs)(l.ngX,{onClose:t,open:i,title:x,titleIcon:p,widthLimit:m,sx:h,iconColor:g,children:[(0,d.jsx)(o.A,{isModal:!0}),(0,d.jsx)(l.qb_,{onClose:()=>{j(!1),u((0,r.h0)(""))},open:f,message:y,mode:"inline",variant:"error"===C.type?"error":"default",autoHideDuration:"error"===C.type?10:5,condensed:!0}),c]})}},71435:(e,t,i)=>{i.d(t,{CS:()=>s,Ez:()=>n,WJ:()=>a,Zb:()=>l});const n={RED:"#C83B51",GREEN:"#4CCB92",YELLOW:"#FFBD62"},a=(e,t)=>e<=t/2?"bad":2!==t&&e===t/2+1?"warn":e===t?"good":void 0,l=e=>{switch(e){case"offline":return"bad";case"online":return"good";default:return"warn"}},s=(e,t)=>e<=t/2?"bad":e===t/2+1?"warn":e===t?"good":void 0},42491:(e,t,i)=>{i.r(t),i.d(t,{default:()=>lt});var n=i(65043),a=i(22166),l=i(21383),s=i(39820),r=i(46537),o=i(64159),d=i(89923),x=i(33097),c=i.n(x);let m=function(e){return e.singleValue="singleValue",e.linearGraph="linearGraph",e.areaGraph="areaGraph",e.barChart="barChart",e.pieChart="pieChart",e.singleRep="singleRep",e.simpleWidget="simpleWidget",e}({});var p=i(56483),g=i(70579);const h=["#C4D4E9","#DCD1EE","#D1EEE7","#EEDED1","#AAF38F","#F9E6C5","#C83B51","#F4CECE","#D6D6D6"],u=e=>(0,p.hr)(e,"ns"),f=e=>parseInt(e).toString(10),j=[{id:1,title:"Uptime",data:"N/A",type:m.simpleWidget,widgetIcon:(0,g.jsx)(d.Owo,{}),labelDisplayFunction:p.hr},{id:50,title:"Capacity",data:[],dataOuter:[{name:"outer",value:100}],widgetConfiguration:{outerChart:{colorList:["#9c9c9c"],innerRadius:0,outerRadius:0,startAngle:0,endAngle:0},innerChart:{colorList:h,innerRadius:20,outerRadius:50,startAngle:90,endAngle:-200}},type:m.pieChart,innerLabel:"N/A",labelDisplayFunction:p.nO},{id:51,title:"Usable Capacity",data:[],dataOuter:[{name:"outer",value:100}],widgetConfiguration:{outerChart:{colorList:["#9c9c9c"],innerRadius:0,outerRadius:0,startAngle:0,endAngle:0},innerChart:{colorList:h,innerRadius:20,outerRadius:50,startAngle:90,endAngle:-200}},type:m.pieChart,innerLabel:"N/A",labelDisplayFunction:p.nO},{id:68,title:"Data Usage Growth",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.areaGraph,yAxisFormatter:p.nO,xAxisFormatter:p.yz},{id:52,title:"Object size distribution",data:[],widgetConfiguration:[{dataKey:"a",color:"#2781B0",background:{fill:"#EEF1F4"},greatestColor:"#081C42"}],customStructure:[{originTag:"LESS_THAN_1024_B",displayTag:"Less than 1024B"},{originTag:"BETWEEN_1024_B_AND_1_MB",displayTag:"Between 1024B and 1MB"},{originTag:"BETWEEN_1_MB_AND_10_MB",displayTag:"Between 1MB and 10MB"},{originTag:"BETWEEN_10_MB_AND_64_MB",displayTag:"Between 10MB and 64MB"},{originTag:"BETWEEN_64_MB_AND_128_MB",displayTag:"Between 64MB and 128MB"},{originTag:"BETWEEN_128_MB_AND_512_MB",displayTag:"Between 128MB and 512MB"},{originTag:"GREATER_THAN_512_MB",displayTag:"Greater than 512MB"}],type:m.barChart},{id:66,title:"Buckets",data:[],innerLabel:"N/A",type:m.singleRep,color:"#0071BC",fillColor:"#ADD5E0"},{id:44,title:"Objects",data:[],innerLabel:"N/A",type:m.singleRep,color:"#0071BC",fillColor:"#ADD5E0"},{id:63,title:"API Data Received Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000",strokeWidth:3}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:61,title:"Total Open FDs",data:[],innerLabel:"N/A",type:m.singleRep,color:"#22B573",fillColor:"#A6E8C4"},{id:62,title:"Total Goroutines",data:[],innerLabel:"N/A",type:m.singleRep,color:"#F7655E",fillColor:"#F4CECE"},{id:77,title:"Node CPU Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:60,title:"API Request Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:70,title:"API Data Sent Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:17,title:"Internode Data Transfer",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:p.nO,xAxisFormatter:p.yz},{id:73,title:"Node IO",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:p.nO,xAxisFormatter:p.yz},{id:80,title:"Time Since Last Heal Activity",data:"N/A",type:m.simpleWidget,widgetIcon:(0,g.jsx)(d.Sdx,{}),labelDisplayFunction:u},{id:81,title:"Time Since Last Scan Activity",data:"N/A",type:m.simpleWidget,widgetIcon:(0,g.jsx)(d.KLX,{}),labelDisplayFunction:u},{id:71,title:"API Request Error Rate",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz},{id:76,title:"Node Memory Usage",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:74,title:"Drive Used Capacity",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,xAxisFormatter:p.yz,yAxisFormatter:p.nO},{id:82,title:"Drives Free Inodes",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,disableYAxis:!0,xAxisFormatter:p.yz},{id:11,title:"Node Syscalls",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:8,title:"Node File Descriptors",data:[],widgetConfiguration:[{dataKey:"",keyLabel:"",lineColor:"#000",fillColor:"#000"}],type:m.linearGraph,yAxisFormatter:f,xAxisFormatter:p.yz},{id:500,mergedPanels:[{id:53,title:"Online",data:"N/A",type:m.singleValue},{id:69,title:"Offline",data:"N/A",type:m.singleValue}],title:"Servers"},{id:501,mergedPanels:[{id:9,title:"Online",data:"N/A",type:m.singleValue},{id:78,title:"Offline",data:"N/A",type:m.singleValue}],title:"Drives"},{id:502,mergedPanels:[{id:65,title:"Upload",data:"N/A",type:m.singleValue,labelDisplayFunction:p.nO},{id:64,title:"Download",data:"N/A",type:m.singleValue,labelDisplayFunction:p.nO}],title:"Network"}],C=(e,t)=>{if(0===e.length)return["","0"];if("mean"===t){const t=e.reduce(((e,t)=>e+parseFloat(t[1])),0);return["",Math.floor(t/e.length).toString()]}{const t=e.sort(((e,t)=>e[0]-t[0]));return t[t.length-1]}},y=(e,t)=>{if(!e)return t;const i=e.type;switch(t.type){case m.singleValue:case m.simpleWidget:if("stat"===i||"singlestat"===i){let i=c()(e,"targets[0].result[0].values",[]);null===i&&(i=[]);const n=c()(e,"options.reduceOptions.calcs[0]","lastNotNull"),a=C(i,n),l=t.labelDisplayFunction?t.labelDisplayFunction(a[1]):a[1];return{...t,data:l}}break;case m.pieChart:if("gauge"===i){const i=c()(e,"options.reduceOptions.calcs[0]","lastNotNull");let n=c()(e,"targets",[]).filter((e=>null!==e));const a=n.map((e=>(e.result&&Array.isArray(e.result)?e.result:[]).map((t=>{const i=c()(t,"values",[]),n=Object.keys(t.metric),a=i.sort(((e,t)=>parseInt(e[0][1])-parseInt(t[0][1]))),l=t.metric[n[0]],s=a[a.length-1];return{name:l,value:parseInt(s[1]),legend:e.legendFormat}})))),l=n[0].result&&n[0].result.length>0?n[0].result[0].values:[],s=C(l,i),r=t.labelDisplayFunction?t.labelDisplayFunction(s[1]):s[1];return{...t,data:a,innerLabel:r}}break;case m.linearGraph:case m.areaGraph:if("graph"===i){let i=c()(e,"targets",[]);null===i&&(i=[]);const n=[],a=[];i.forEach(((e,t)=>{let i=c()(e,"result",[]);const l=e.legendFormat;null===i&&(i=[]),i.forEach((e=>{const i=((e,t)=>{const i=Object.keys(e),n=new RegExp(`{{(${i.join("|")})}}`,"g");let a=t.replace(n,(t=>{const i=t.replace(/({{|}})/g,"");return e[i]}));const l=(a.match(/{{/g)||[]).length,s=(a.match(/}}/g)||[]).length;let r=a.replace(/{{(.*?)}}/g,"");return l===s&&0!==l&&0!==s&&(i.forEach((t=>{a=a.replace(t,e[t])})),r=a),r})(e.metric,l),s=`key_${t}${i}`;n.push({dataKey:s,keyLabel:i,lineColor:"",fillColor:""});let r=c()(e,"values",[]);null===r&&(r=[]),r.forEach((e=>{const t=a.findIndex((t=>t.name===e[0]));if(-1===t){let t={name:e[0]};t[s]=e[1],a.push(t)}else a[t][s]=e[1]}))}))}));const l=n.sort(((e,t)=>e.keyLabelt.keyLabel?1:0)).map(((e,t)=>({...e,lineColor:h[t]||(0,p.h4)(e.keyLabel),fillColor:h[t]||(0,p.h4)(e.keyLabel)}))),s=a.sort(((e,t)=>e.name-t.name));return{...t,widgetConfiguration:l,data:s}}break;case m.barChart:if("bargauge"===i){let i=c()(e,"targets[0].result",[]);null===i&&(i=[]);const n=(e,t)=>e[0]-t[0];let a=[];return a=t.customStructure?t.customStructure.map((e=>{const t=i.find((t=>t.metric.range===e.originTag)),a=c()(t,"values",[]).sort(n),l=a[a.length-1]||["","0"];return{name:e.displayTag,a:parseInt(l[1])}})):i.map((e=>{const t=Object.keys(e.metric),i=e.metric[t[0]],a=c()(e,"values",[]).sort(n),l=a[a.length-1]||["","0"];return{name:i,a:parseInt(l[1])}})),{...t,data:a}}break;case m.singleRep:if("stat"===i){let i=c()(e,"targets[0].result[0].values",[]);null===i&&(i=[]);const n=c()(e,"options.reduceOptions.calcs[0]","lastNotNull"),a=C(i,n),l=i.sort(((e,t)=>e[0]-t[0]));let s=[];1===l.length&&s.push({value:0}),l.forEach((e=>{s.push({value:parseInt(e[1])})}));const r=t.labelDisplayFunction?t.labelDisplayFunction(a[1]):a[1];return{...t,data:s,innerLabel:r}}}return t},v=e=>{const t=e.split(" "),i=()=>{let t=e;return isNaN(parseFloat(e))||(t=(0,p.dq)(parseFloat(e))),(0,g.jsx)(n.Fragment,{children:t})};return 2!==t.length?i():p.MD.includes(t[1])?(0,g.jsxs)("span",{className:"commonValue",children:[t[0],(0,g.jsx)("span",{className:"unitText",children:t[1]})]}):i()};var w=i(94574),b=i(50108),z=i(82291),S=i(52185),A=i(6026),I=i(38643),T=i(17869),J=i(86150),F=i(77403),N=i(47027);const $=e=>{let{panelItem:t}=e;const i=(0,l.jL)();return(0,g.jsx)(d.azJ,{sx:{alignItems:"right",gap:"10px","& .link-text":{color:"#2781B0",fontSize:"12px",fontWeight:600},"& .zoom-graph-icon":{backgroundColor:"transparent",border:0,padding:0,cursor:"pointer","& svg":{color:"#D0D0D0",height:16},"&:hover":{"& svg":{color:"#404143"}}}},children:(0,g.jsx)("button",{onClick:()=>{i((0,N.ZQ)(t))},className:"zoom-graph-icon",children:(0,g.jsx)(d.mSu,{})})})};var E=i(72663);const L=e=>{let{title:t,componentRef:i,data:a}=e;const[s,r]=n.useState(null),x=Boolean(s),c=(0,l.jL)(),m=()=>{if(null!==a&&a.length>0)((e,t)=>{let i=document.createElement("a");i.setAttribute("href","data:text/plain;charset=utf-8,"+t),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)})(null!==t?(t+"_"+Date.now().toString()+".csv").replace(/\s+/g,"").trim().toLowerCase():"widgetData_"+Date.now().toString()+".csv",(e=a,[Object.keys(e[0])].concat(e).map((e=>Object.values(e).toString())).join("\n")));else{let e;e={errorMessage:"Unable to download widget data",detailedError:"Unable to download widget data - data not available"},(e=>{c((0,o.C9)(e))})(e)}var e},p=e=>{"csv"===e?m():"png"===e&&(()=>{if(null!==t){const e=(t+"_"+Date.now().toString()+".png").replace(/\s+/g,"").trim().toLowerCase();(0,E.exportComponentAsPNG)(i,{fileName:e})}else{const e="widgetData_"+Date.now().toString()+".png";(0,E.exportComponentAsPNG)(i,{fileName:e})}})()};return(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)(d.azJ,{sx:{justifyItems:"center","& .download-icon":{backgroundColor:"transparent",border:0,padding:0,cursor:"pointer","& svg":{color:"#D0D0D0",height:16},"&:hover":{"& svg":{color:"#404143"}}}},children:[(0,g.jsx)("button",{className:"download-icon",onClick:e=>{r(e.currentTarget)},children:(0,g.jsx)(d.s3U,{})}),(0,g.jsx)(d.Vey,{id:"download-widget-main-menu",options:[{label:"Download as CSV",value:"csv"},{label:"Download as PNG",value:"png"}],selectedOption:"",onSelect:e=>p(e),hideTriggerAction:()=>{r(null)},open:x,anchorEl:s,anchorOrigin:"end"})]})})},k=e=>{let{active:t,payload:i,label:n,barChartConfiguration:a}=e;return t?(0,g.jsxs)(d.azJ,{sx:F.VI.customTooltip,children:[(0,g.jsx)(d.azJ,{sx:F.VI.timeStampTitle,children:n}),i&&i.map(((e,t)=>(0,g.jsxs)(d.azJ,{sx:F.VI.labelContainer,children:[(0,g.jsx)(d.azJ,{sx:F.VI.labelColor,style:{backgroundColor:a[t].color}}),(0,g.jsx)(d.azJ,{sx:{...F.VI.itemValue,"& span.valueContainer":{...F.VI.valueContainer}},children:(0,g.jsx)("span",{className:"valueContainer",children:e.value})})]},`pltiem-${t}-${n}`)))]}):null};var W=i(20649);const B=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),loadingAlign:{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"}}})),D=e=>{let{y:t,payload:i}=e;return(0,g.jsx)("text",{width:50,fontSize:"69.7%",textAnchor:"start",fill:"#333",transform:`translate(5,${t})`,fontWeight:400,dy:3,children:i.value})},R=e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,apiPrefix:x,zoomActivated:c=!1}=e;const m=(0,l.jL)(),[p,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)([]),[j,C]=(0,n.useState)(null),[v,w]=(0,n.useState)(!1),[F,N]=(0,n.useState)(window.innerWidth>=d.nmC.md),E=(0,n.useRef)(),R=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[R]),(0,n.useEffect)((()=>{const e=()=>{let e=!1;window.innerWidth>=d.nmC.md&&(e=!0),N(e)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),(0,n.useEffect)((()=>{if(p){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t.data),C(t),h(!1)})).catch((e=>{m((0,o.C9)(e)),h(!1)}))}}),[p,i,r,s,m,x]);const M=j?j.widgetConfiguration:[];let O=0,U=0;if(1===M.length){const e=M[0];u.forEach(((t,i)=>{t[e.dataKey]>U&&(U=t[e.dataKey],O=i)}))}return(0,g.jsx)(B,{children:(0,g.jsxs)(d.azJ,{className:c?"":"singleValueContainer",onMouseOver:()=>{w(!0)},onMouseLeave:()=>{w(!1)},children:[!c&&(0,g.jsxs)(d.xA9,{container:!0,children:[(0,g.jsx)(d.xA9,{item:!0,xs:10,sx:{alignItems:"start",justifyItems:"start"},children:(0,g.jsx)("div",{className:"titleContainer",children:t})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end"},children:v&&(0,g.jsx)($,{panelItem:i})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end"},children:(0,g.jsx)(L,{title:t,componentRef:E,data:u})})]}),p&&(0,g.jsx)(d.azJ,{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!p&&(0,g.jsx)("div",{ref:E,className:c?"zoomChartCont":"contentContainer",children:(0,g.jsx)(b.u,{width:"99%",children:(0,g.jsxs)(z.E,{data:u,layout:"vertical",barCategoryGap:1,children:[(0,g.jsx)(S.W,{type:"number",hide:!0}),(0,g.jsx)(A.h,{dataKey:"name",type:"category",interval:0,tick:(0,g.jsx)(D,{}),tickLine:!1,axisLine:!1,width:150,hide:!F,style:{fontSize:"12px",fontWeight:100}}),M.map((e=>(0,g.jsx)(I.y,{dataKey:e.dataKey,fill:e.color,background:e.background,barSize:c?25:12,children:1===M.length?(0,g.jsx)(n.Fragment,{children:u.map(((t,i)=>(0,g.jsx)(T.f,{fill:i===O?e.greatestColor:e.color},`chart-bar-${i.toString()}`)))}):null},`bar-${e.dataKey}`))),(0,g.jsx)(J.m,{cursor:{fill:"rgba(255, 255, 255, 0.3)"},content:(0,g.jsx)(k,{barChartConfiguration:M})})]})})})]})})};var M=i(877),O=i(87734),U=i(13839);const V=e=>{let{active:t,payload:i,label:n,linearConfiguration:a,yAxisFormatter:l}=e;return t?(0,g.jsxs)(d.azJ,{sx:F.VI.customTooltip,children:[(0,g.jsx)(d.azJ,{sx:F.VI.timeStampTitle,children:(0,p.yz)(n,!0)}),i&&i.map(((e,t)=>(0,g.jsxs)(d.azJ,{sx:F.VI.labelContainer,children:[(0,g.jsx)(d.azJ,{sx:F.VI.labelColor,style:{backgroundColor:a[t].lineColor}}),(0,g.jsx)(d.azJ,{sx:{...F.VI.itemValue,"& span.valueContainer":{...F.VI.valueContainer}},children:(0,g.jsxs)("span",{className:"valueContainer",children:[a[t].keyLabel,":"," ",l(e.value)]})})]},`lbPl-${t}-${a[t].keyLabel}`)))]}):null},P=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),"& .chartCont":{position:"relative",height:140,width:"100%"},"& .legendChart":{display:"flex",flexDirection:"column",flex:"0 1 auto",maxHeight:130,margin:0,overflowY:"auto",position:"relative",textAlign:"center",width:"100%",justifyContent:"flex-start",color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:12,[`@media (max-width: ${d.nmC.md}px)`]:{display:"none"}},"& .loadingAlign":{width:40,height:40,textAlign:"center",margin:"15px auto"}}})),G=e=>{let{title:t,timeStart:i,timeEnd:s,panelItem:r,apiPrefix:x,hideYAxis:c=!1,areaWidget:m=!1,yAxisFormatter:p=e=>e,xAxisFormatter:h=(e,t,i)=>e,zoomActivated:u=!1}=e;const f=(0,l.jL)(),[j,C]=(0,n.useState)(!1),[v,w]=(0,n.useState)(!1),[z,I]=(0,n.useState)([]),[T,F]=(0,n.useState)([]),[N,E]=(0,n.useState)(0),[k,B]=(0,n.useState)(null),D=(0,a.d4)((e=>e.dashboard.widgetLoadVersion)),R=(0,n.useRef)(null);(0,n.useEffect)((()=>{C(!0)}),[D]),(0,n.useEffect)((()=>{if(j){let e=0;if(null!==i&&null!==s){const t=s.toUnixInteger()-i.toUnixInteger(),n=Math.floor(t/60);e=n<1?15:n}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${r.id}/?step=${e}&${null!==i?`&start=${i.toUnixInteger()}`:""}${null!==i&&null!==s?"&":""}${null!==s?`end=${s.toUnixInteger()}`:""}`).then((e=>{const t=y(e,r);I(t.data),B(t),C(!1);let i=0;for(const n of t.data)for(const e in n){if("name"===e)continue;let t=parseInt(n[e]);isNaN(t)&&(t=0),i{f((0,o.C9)(e)),C(!1)}))}}),[j,r,s,i,f,x]);let G=Math.floor(z.length/5);(0,n.useEffect)((()=>{const e=z.map((e=>{const t=new Date(1e3*(null===e||void 0===e?void 0:e.name));return{...e,name:t}}));F(e)}),[z]);const _=k?null===k||void 0===k?void 0:k.widgetConfiguration:[],K=e=>{const{cx:t,cy:i,index:n}=e;return n%3!==0?null:(0,g.jsx)("circle",{cx:t,cy:i,r:3,strokeWidth:0,fill:"#07264A"})};let H=!1;return u&&(H=!0),(0,g.jsx)(P,{children:(0,g.jsxs)(d.azJ,{className:u?"":"singleValueContainer",onMouseOver:()=>{w(!0)},onMouseLeave:()=>{w(!1)},children:[!u&&(0,g.jsxs)(d.xA9,{container:!0,children:[(0,g.jsx)(d.xA9,{item:!0,xs:10,sx:{alignItems:"start"},children:(0,g.jsx)(d.azJ,{className:"titleContainer",children:t})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end",alignContent:"flex-end"},children:v&&(0,g.jsx)($,{panelItem:r})}),(0,g.jsx)(d.xA9,{item:!0,xs:1,sx:{display:"flex",justifyContent:"flex-end"},children:null!==R&&(0,g.jsx)(L,{title:t,componentRef:R,data:T})})]}),(0,g.jsx)("div",{ref:R,children:(0,g.jsxs)(d.azJ,{sx:u?{flexDirection:"column"}:{height:"100%",display:"grid",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},style:m?{gridTemplateColumns:"1fr"}:{},children:[j&&(0,g.jsx)(d.aHM,{className:"loadingAlign"}),!j&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(d.azJ,{className:u?"zoomChartCont":"chartCont",children:(0,g.jsx)(b.u,{width:"99%",children:(0,g.jsxs)(M.Q,{data:z,margin:{top:5,right:20,left:c?20:5,bottom:0},children:[m&&(0,g.jsx)("defs",{children:(0,g.jsxs)("linearGradient",{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,g.jsx)("stop",{offset:"0%",stopColor:"#2781B0",stopOpacity:1}),(0,g.jsx)("stop",{offset:"100%",stopColor:"#ffffff",stopOpacity:0}),(0,g.jsx)("stop",{offset:"95%",stopColor:"#ffffff",stopOpacity:.8})]})}),(0,g.jsx)(O.d,{strokeDasharray:m?"2 2":"5 5",strokeWidth:1,strokeOpacity:1,stroke:"#eee0e0",vertical:!m}),(0,g.jsx)(S.W,{dataKey:"name",tickFormatter:e=>h(e,H,!0),interval:G,tick:{fontSize:"68%",fontWeight:"normal",color:"#404143"},tickCount:10,stroke:"#082045"}),(0,g.jsx)(A.h,{type:"number",domain:[0,1.1*N],hide:c,tickFormatter:e=>p(e),tick:{fontSize:"68%",fontWeight:"normal",color:"#404143"},stroke:"#082045"}),_.map(((e,t)=>(0,g.jsx)(U.G,{type:"monotone",dataKey:e.dataKey,isAnimationActive:!1,stroke:m?"#D7E5F8":e.lineColor,fill:m?"url(#colorUv)":e.fillColor,fillOpacity:m?.65:0,strokeWidth:m?0:3,strokeLinecap:"round",dot:!!m&&(0,g.jsx)(K,{})},`area-${e.dataKey}-${t.toString()}`))),(0,g.jsx)(J.m,{content:(0,g.jsx)(V,{linearConfiguration:_,yAxisFormatter:p}),wrapperStyle:{zIndex:5e3}})]})})}),!m&&(0,g.jsxs)(n.Fragment,{children:[u&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)("strong",{children:"Series"}),(0,g.jsx)("br",{}),(0,g.jsx)("br",{})]}),(0,g.jsx)(d.azJ,{className:"legendChart",children:_.map(((e,t)=>(0,g.jsxs)(d.azJ,{className:"singleLegendContainer",children:[(0,g.jsx)(d.azJ,{className:"colorContainer",style:{backgroundColor:e.lineColor}}),(0,g.jsx)(d.azJ,{className:"legendLabel",children:e.keyLabel})]},`legend-${e.keyLabel}-${t.toString()}`)))})]})]})]})})]})})};var _=i(60163),K=i(4240);const H=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),"& .loadingAlign":{width:"100%",paddingTop:"15px",textAlign:"center",margin:"auto"},"& .pieChartLabel":{fontSize:60,color:c()(t,"signalColors.main","#07193E"),fontWeight:"bold",width:"100%","& .unitText":{color:c()(t,"mutedText","#87888d"),fontSize:12}},"& .chartContainer":{width:"100%",height:140}}})),Q=e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,apiPrefix:x}=e;const m=(0,l.jL)(),[p,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)([]),[j,C]=(0,n.useState)([]),[w,z]=(0,n.useState)(null),S=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[S]),(0,n.useEffect)((()=>{if(p){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t.data),C(t.dataOuter),z(t),h(!1)})).catch((e=>{m((0,o.C9)(e)),h(!1)}))}}),[p,i,r,s,m,x]);const A=w?w.widgetConfiguration:[],I=null===w||void 0===w?void 0:w.innerLabel,J=c()(A,"innerChart.colorList",[]),F=c()(A,"outerChart.colorList",[]);return(0,g.jsx)(H,{children:(0,g.jsxs)(d.azJ,{className:"singleValueContainer",children:[(0,g.jsx)(d.azJ,{className:"titleContainer",children:t}),p&&(0,g.jsx)(d.azJ,{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!p&&(0,g.jsxs)(d.azJ,{className:"contentContainer",children:[(0,g.jsx)("span",{className:"pieChartLabel",children:I&&v(I)}),(0,g.jsx)(d.azJ,{className:"chartContainer",children:(0,g.jsx)(b.u,{width:"99%",children:(0,g.jsxs)(_.r,{margin:{top:5,bottom:5},children:[j&&(0,g.jsx)(K.F,{data:j,cx:"50%",cy:"50%",dataKey:"value",innerRadius:c()(A,"outerChart.innerRadius",0),outerRadius:c()(A,"outerChart.outerRadius","80%"),startAngle:c()(A,"outerChart.startAngle",0),endAngle:c()(A,"outerChart.endAngle",360),fill:"#201763",children:j.map(((e,t)=>(0,g.jsx)(T.f,{fill:"undefined"===typeof F[t]?"#393939":F[t]},`cellOuter-${t}`)))}),u&&(0,g.jsx)(K.F,{data:u,dataKey:"value",cx:"50%",cy:"50%",innerRadius:c()(A,"innerChart.innerRadius",0),outerRadius:c()(A,"innerChart.outerRadius","80%"),startAngle:c()(A,"innerChart.startAngle",0),endAngle:c()(A,"innerChart.endAngle",360),fill:"#201763",children:u.map(((e,t)=>(0,g.jsx)(T.f,{fill:"undefined"===typeof J[t]?"#393939":J[t]},`cell-${t}`)))})]})})})]})]})})},q=w.Ay.span((e=>{let{theme:t}=e;return{display:"inline-flex",color:c()(t,"signalColors.main","#07193E"),alignItems:"center","& .icon":{color:c()(t,"signalColors.main","#07193E"),fill:c()(t,"signalColors.main","#07193E"),marginRight:5,marginLeft:12},"& .widgetLabel":{fontWeight:"bold",textTransform:"uppercase",marginRight:10},"& .widgetValue":{marginRight:25}}})),Y=e=>{let{iconWidget:t,title:i,panelItem:s,timeStart:r,timeEnd:x,apiPrefix:c,renderFn:m}=e;const p=(0,l.jL)(),[h,u]=(0,n.useState)(!1),[f,j]=(0,n.useState)(""),C=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));return(0,n.useEffect)((()=>{u(!0)}),[C]),(0,n.useEffect)((()=>{if(h){let e=0;if(null!==r&&null!==x){const t=x.toUnixInteger()-r.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${c}/info/widgets/${s.id}/?step=${e}&${null!==r?`&start=${r.toUnixInteger()}`:""}${null!==r&&null!==x?"&":""}${null!==x?`end=${x.toUnixInteger()}`:""}`).then((e=>{const t=y(e,s);j(t.data),u(!1)})).catch((e=>{p((0,o.C9)(e)),u(!1)}))}}),[h,s,x,r,p,c]),m?m({valueToRender:f,loading:h,title:i,id:s.id,iconWidget:t}):(0,g.jsxs)(n.Fragment,{children:[h&&(0,g.jsx)("div",{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!h&&(0,g.jsxs)(q,{children:[(0,g.jsx)("span",{className:"icon",children:t||null}),(0,g.jsxs)("span",{className:"widgetLabel",children:[i,": "]}),(0,g.jsx)("span",{className:"widgetValue",children:f})]})]})},X=e=>{let{children:t}=e;return(0,g.jsx)(d.azJ,{withBorders:!0,sx:{borderRadius:"3px",padding:15,height:136,maxWidth:"100%",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:5,height:"auto"},[`@media (max-width: ${d.nmC.md}px)`]:{display:"flex",flexFlow:"column",maxWidth:"initial"}},children:t})},Z=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",color:c()(t,"signalColors.main","#07193E"),maxWidth:"300px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",position:"relative",width:"100%"}})),ee=e=>{let{value:t,label:i="",icon:n=null,loading:a=!1}=e;return(0,g.jsx)(Z,{children:(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",width:"100%",padding:"0 8px 0 8px",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"0 10px 0 10px"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",flexFlow:"column",marginTop:"12px",zIndex:10,overflow:"hidden"},children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:i}),(0,g.jsx)(d.m_M,{tooltip:t,placement:"bottom",children:(0,g.jsx)(d.azJ,{sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",maxWidth:187,flexFlow:"row",fontSize:55,[`@media (max-width: ${d.nmC.sm}px)`]:{fontSize:35,maxWidth:200,flexFlow:"column"},[`@media (max-width: ${d.nmC.md}px)`]:{fontSize:35},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:36},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:50}},children:t})})]}),(0,g.jsx)(d.azJ,{sx:{display:"flex",flexFlow:"column",alignItems:"center",justifyContent:"flex-start",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},children:a?(0,g.jsx)(d.aHM,{style:{width:"16px",height:"16px"}}):n})]})})},te=e=>{let{title:t,value:i,loading:n}=e;return(0,g.jsx)(ee,{label:t,icon:(0,g.jsx)(d.brV,{}),value:i,loading:n})},ie=e=>{let{title:t,value:i,loading:n}=e;return(0,g.jsx)(ee,{label:t,icon:(0,g.jsx)(d.Sxe,{}),value:i,loading:n})},ne=(0,a.Ng)(null,{setErrorSnackMessage:o.C9})((e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,propLoading:d,apiPrefix:x}=e;const c=(0,l.jL)(),[m,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)(null),j=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[j]),(0,n.useEffect)((()=>{if(m){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t),h(!1)})).catch((e=>{c((0,o.C9)(e)),h(!1)}))}}),[m,i,r,s,c,x]);let C="";if(u){const e=parseInt(u.innerLabel||"0");C=isNaN(e)?"0":(0,p.dq)(e)}return 66===(v=i.id)?(0,g.jsx)(X,{children:(0,g.jsx)(te,{loading:m,title:t,value:u?C:""})}):44===v?(0,g.jsx)(X,{children:(0,g.jsx)(ie,{loading:m,title:t,value:u?C:""})}):null;var v})),ae=w.Ay.div((e=>{let{theme:t}=e;return{display:"flex",height:140,flexDirection:"column",justifyContent:"center","& .unitText":{color:c()(t,"mutedText","#87888d"),fontSize:12},"& .loadingAlign":{width:"100%",textAlign:"center",margin:"auto"},"& .metric":{fontSize:60,lineHeight:1,color:c()(t,"signalColors.main","#07193E"),fontWeight:700},"& .titleElement":{fontSize:10,color:c()(t,"mutedText","#87888d"),fontWeight:700},...(0,F.yE)(t)}})),le=e=>{let{title:t,panelItem:i,timeStart:s,timeEnd:r,apiPrefix:x,renderFn:c}=e;const m=(0,l.jL)(),[p,h]=(0,n.useState)(!1),[u,f]=(0,n.useState)(""),j=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{h(!0)}),[j]),(0,n.useEffect)((()=>{if(p){let e=0;if(null!==s&&null!==r){const t=r.toUnixInteger()-s.toUnixInteger(),i=Math.floor(t/60);e=i<1?15:i}W.A.invoke("GET",`/api/v1/${x}/info/widgets/${i.id}/?step=${e}&${null!==s?`&start=${s.toUnixInteger()}`:""}${null!==s&&null!==r?"&":""}${null!==r?`end=${r.toUnixInteger()}`:""}`).then((e=>{const t=y(e,i);f(t.data),h(!1)})).catch((e=>{m((0,o.C9)(e)),h(!1)}))}}),[p,i,r,s,m,x]);const C=v(u);return c?c({valueToRender:C,loading:p,title:t,id:i.id}):(0,g.jsxs)(ae,{children:[p&&(0,g.jsx)(d.azJ,{className:"loadingAlign",children:(0,g.jsx)(d.aHM,{})}),!p&&(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(d.azJ,{className:"metric",children:v(u)}),(0,g.jsx)(d.azJ,{className:"titleElement",children:t})]})]})},se=w.Ay.div((e=>{let{theme:t}=e;return{flex:1,display:"flex",alignItems:"center",flexFlow:"row","& .usableLabel":{color:c()(t,"mutedText","#87888d"),fontSize:"10px",display:"flex",flexFlow:"column",alignItems:"center",textAlign:"center"},"& .usedLabel":{color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:"14px"},"& .totalUsed":{display:"flex","& .value":{fontSize:"50px",fontFamily:"Inter",fontWeight:600,alignSelf:"flex-end",lineHeight:1},"& .unit":{color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:"14px",marginLeft:"12px",alignSelf:"flex-end"}},"& .ofUsed":{marginTop:"5px","& .value":{color:c()(t,"mutedText","#87888d"),fontWeight:"bold",fontSize:"14px",textAlign:"right"}},[`@media (max-width: ${d.nmC.sm}px)`]:{flexFlow:"column"}}})),re=e=>{let{value:t,timeStart:i,timeEnd:s,apiPrefix:r}=e;const x=(0,l.jL)(),[c,m]=(0,n.useState)(!1),[h,u]=(0,n.useState)(0),[f,j]=(0,n.useState)(0),[C,v]=(0,n.useState)(0),[w,b]=(0,n.useState)(0),z=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));(0,n.useEffect)((()=>{m(!0)}),[z]),(0,n.useEffect)((()=>{if(c){let e=0;if(null!==i&&null!==s){const t=s.toUnixInteger()-i.toUnixInteger(),n=Math.floor(t/60);e=n<1?15:n}W.A.invoke("GET",`/api/v1/${r}/info/widgets/${t.id}/?step=${e}&${null!==i?`&start=${i.toUnixInteger()}`:""}${null!==i&&null!==s?"&":""}${null!==s?`end=${s.toUnixInteger()}`:""}`).then((e=>{const i=y(e,t);let n=0,a=0,l=0;i.data.forEach((e=>{e.forEach((e=>{switch(e.legend){case"Total Usable":n+=e.value;break;case"Used Space":a+=e.value;break;case"Usable Free":l+=e.value}}))}));const s=Math.round(l/n*100);u(l),j(s),v(a),b(n),m(!1)})).catch((e=>{x((0,o.C9)(e)),m(!1)}))}}),[c,t,s,i,x,r]);const S=(0,p.GT)(C,!0,!1),A=[{value:h,color:"#D6D6D6",label:"Usable Available Space"},{value:C,color:(0,p.zv)(C,w),label:"Used Space"}];return(0,g.jsxs)(se,{children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600,[`@media (max-width: ${d.nmC.sm}px)`]:{alignSelf:"flex-start"}},children:"Capacity"}),(0,g.jsxs)(d.azJ,{sx:{position:"relative",width:110,height:110,marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:""}},children:[(0,g.jsxs)(d.azJ,{sx:{position:"absolute",display:"flex",flexFlow:"column",alignItems:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontWeight:"bold",fontSize:12},children:[`${f}%`,(0,g.jsx)("br",{}),(0,g.jsx)(d.azJ,{className:"usableLabel",children:"Free"})]}),(0,g.jsx)(_.r,{width:110,height:110,children:(0,g.jsx)(K.F,{data:A,cx:"50%",cy:"50%",dataKey:"value",outerRadius:50,innerRadius:40,startAngle:-70,endAngle:360,animationDuration:1,children:A.map(((e,t)=>(0,g.jsx)(T.f,{fill:e.color},`cellCapacity-${t}`)))})})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:""}},children:[(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"usedLabel",children:"Used:"}),(0,g.jsxs)(d.azJ,{className:"totalUsed",children:[(0,g.jsx)("div",{className:"value",children:S.total}),(0,g.jsx)("div",{className:"unit",children:S.unit})]}),(0,g.jsx)(d.azJ,{className:"ofUsed",children:(0,g.jsxs)("div",{className:"value",children:["Of: ",(0,p.qO)(w)]})})]}),(0,g.jsx)(d.azJ,{sx:{marginLeft:"15px",height:"100%",display:"flex",alignItems:"flex-start"},children:(0,g.jsx)(d.azJ,{children:c?(0,g.jsx)(d.aHM,{style:{width:"26px",height:"26px"}}):(0,g.jsx)(d.wNL,{})})})]})]})},oe=w.Ay.div((e=>{let{theme:t}=e;return{display:"grid",alignItems:"center",gap:8,height:33,paddingLeft:15,gridTemplateColumns:"20px 1.5fr .5fr 20px",background:c()(t,"boxBackground","#FBFAFA"),"& .min-icon":{height:"12px",width:"12px",fill:c()(t,"signalColors.good","#4CCB92")},"& .ok-icon":{height:"8px",width:"8px",fill:c()(t,"signalColors.good","#4CCB92"),color:c()(t,"signalColors.good","#4CCB92")},"& .timeStatLabel":{fontSize:"12px",color:c()(t,"signalColors.good","#4CCB92"),fontWeight:600},"& .timeStatValue":{fontSize:"12px",color:c()(t,"signalColors.good","#4CCB92")}}})),de=e=>{let{icon:t,label:i,value:n,loading:a=!1}=e;return(0,g.jsxs)(oe,{className:"dashboard-time-stat-item",children:[a?(0,g.jsx)(d.aHM,{style:{width:10,height:10}}):t,(0,g.jsx)(d.azJ,{className:"timeStatLabel",children:i}),(0,g.jsx)(d.azJ,{className:"timeStatValue",children:n}),"n/a"!==n?(0,g.jsx)(d.BK0,{className:"ok-icon"}):null]})},xe=e=>{let{valueToRender:t="",loading:i=!1,iconWidget:n=null}=e;return(0,g.jsx)(d.azJ,{sx:{display:"flex",height:"47px",borderRadius:"2px","& .dashboard-time-stat-item":{height:"100%",width:"100%"}},children:(0,g.jsx)(de,{loading:i,icon:n,label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Heal Activity"]}),value:t})})},ce=e=>{let{valueToRender:t="",loading:i=!1,iconWidget:n=null}=e;return(0,g.jsx)(d.azJ,{sx:{display:"flex",height:"47px",borderRadius:"2px","& .dashboard-time-stat-item":{height:"100%",width:"100%"}},children:(0,g.jsx)(de,{loading:i,icon:n,label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Scan Activity"]}),value:t})})},me=e=>{let{valueToRender:t="",loading:i=!1,iconWidget:n=null}=e;return(0,g.jsx)(d.azJ,{sx:{display:"flex",height:47,borderRadius:2,"& .dashboard-time-stat-item":{height:"100%",width:"100%"}},children:(0,g.jsx)(de,{loading:i,icon:n,label:(0,g.jsx)(d.azJ,{children:"Uptime"}),value:t})})},pe=function(e,t,i,n,a){let l=arguments.length>5&&void 0!==arguments[5]&&arguments[5];switch(e.type){case m.singleValue:return(0,g.jsx)(le,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a});case m.simpleWidget:let s,r=null;return 80===e.id?r=xe:81===e.id?r=ce:1===e.id&&(r=me),[80,81,1].includes(e.id)&&(s=e=>{let{valueToRender:t,loading:i,title:n,id:a,iconWidget:l}=e;return(0,g.jsx)(r,{valueToRender:t,loading:i,title:n,id:a,iconWidget:l})}),(0,g.jsx)(Y,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a,iconWidget:e.widgetIcon,renderFn:s});case m.pieChart:return 50===e.id?(0,g.jsx)(X,{children:(0,g.jsx)(re,{value:e,timeStart:t,timeEnd:i,apiPrefix:a})}):(0,g.jsx)(Q,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a});case m.linearGraph:case m.areaGraph:return(0,g.jsx)(G,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,hideYAxis:e.disableYAxis,xAxisFormatter:e.xAxisFormatter,yAxisFormatter:e.yAxisFormatter,apiPrefix:a,areaWidget:e.type===m.areaGraph,zoomActivated:l});case m.barChart:return(0,g.jsx)(R,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,apiPrefix:a,zoomActivated:l});case m.singleRep:const o=e.fillColor?e.fillColor:e.color;return(0,g.jsx)(ne,{title:e.title,panelItem:e,timeStart:t,timeEnd:i,propLoading:n,color:e.color,fillColor:o,apiPrefix:a});default:return null}},ge=[{sx:{minWidth:0,display:"grid",gap:"30px",gridTemplateColumns:"1fr 1fr 1fr 1fr",[`@media (max-width: ${d.nmC.sm}px)`]:{gridTemplateColumns:"1fr"},[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr 1fr"}},columns:[{componentId:66},{componentId:44},{componentId:500},{componentId:501}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:50},{componentId:502}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:80},{componentId:81},{componentId:1}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:68},{componentId:52}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:63},{componentId:70}]}],he=[{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"30px"},columns:[{componentId:60}]},{sx:{display:"grid",minWidth:0,gap:"30px",gridTemplateColumns:"1fr 1fr",[`@media (max-width: ${d.nmC.md}px)`]:{gridTemplateColumns:"1fr"}},columns:[{componentId:71,sx:{flex:1,width:"50%",flexShrink:0}},{componentId:17,sx:{flex:1,width:"50%",flexShrink:0}}]},{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"30px"},columns:[{componentId:73}]}],ue=[{sx:{display:"grid",minWidth:0,gridTemplateColumns:"1fr 1fr",gap:"30px"},columns:[{componentId:76},{componentId:77}]},{sx:{display:"grid",minWidth:0,gridTemplateColumns:"1fr 1fr",gap:"30px"},columns:[{componentId:82},{componentId:74}]}],fe=[{sx:{display:"grid",minWidth:0,gridTemplateColumns:"1fr 1fr",gap:"30px"},columns:[{componentId:11},{componentId:8}]}],je=e=>{let{children:t}=e;return(0,g.jsx)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"30px"},children:t})};var Ce=i(94141);const ye=e=>{let{value:t,modalOpen:i,timeStart:a,timeEnd:s,apiPrefix:r}=e;const o=(0,l.jL)();return t?(0,g.jsx)(Ce.A,{title:t.title,onClose:()=>{o((0,N.Nv)())},modalOpen:i,wideLimit:!1,sx:{padding:0},children:(0,g.jsx)(n.Fragment,{children:pe(t,a,s,!0,r,!0)})}):null};var ve=i(71102),we=i(35475);const be=w.Ay.div((e=>{let{theme:t}=e;return{...(0,F.yE)(t),"& .metricText":{fontSize:70,lineHeight:1.1,color:c()(t,"signalColors.main","#07193E"),fontWeight:"bold"},"& .unitText":{fontSize:10,color:c()(t,"mutedText","#87888d"),fontWeight:"normal"},"& .subHeaderContainer":{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},"& .subMessage":{fontSize:10,color:c()(t,"mutedText","#87888d"),"&.bold":{fontWeight:"bold"}},"& .headerContainer":{display:"flex",justifyContent:"space-between"},"& .viewAll":{fontSize:10,color:c()(t,"signalColors.danger","#C83B51"),textTransform:"capitalize","& a, & a:hover, & a:visited, & a:active":{color:c()(t,"signalColors.danger","#C83B51")}}}})),ze=e=>{let{title:t,metricValue:i,metricUnit:a,subMessage:l,moreLink:s,rightComponent:r,extraMargin:o=!1}=e;const x=()=>(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)("div",{className:"subHeaderContainer",children:[(0,g.jsxs)("div",{className:"leftSide",children:[(0,g.jsx)("div",{children:(0,g.jsxs)("span",{className:"metricText",children:[i,(0,g.jsx)("span",{className:"unitText",children:a})]})}),l&&(0,g.jsx)(d.azJ,{sx:{fontWeight:l.fontWeight||"normal"},children:l.message})]}),(0,g.jsx)("div",{className:"rightSide",children:r})]})}),c=()=>(0,g.jsx)(n.Fragment,{children:(0,g.jsxs)("div",{className:"headerContainer",children:[(0,g.jsx)("span",{className:"titleContainer",children:t}),s&&(0,g.jsx)(n.Fragment,{children:(0,g.jsx)("span",{className:"viewAll",children:(0,g.jsx)(we.N_,{to:s,children:"View All"})})})]})});return(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(d.azJ,{withBorders:!0,sx:{height:200,padding:16,margin:o?"10px 20px 10px 0":""},children:""!==i&&(0,g.jsxs)(be,{children:[(0,g.jsx)(c,{}),(0,g.jsx)(x,{})]})})})},Se=e=>{let{title:t,leftComponent:i,rightComponent:a}=e;return(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(ze,{title:t,metricValue:i,rightComponent:a})})},Ae=e=>{let{panelItem:t,timeStart:i,timeEnd:s,apiPrefix:r,statLabel:x}=e;const c=(0,l.jL)(),[m,p]=(0,n.useState)(!1),[h,u]=(0,n.useState)(""),f=(0,a.d4)((e=>e.dashboard.widgetLoadVersion));return(0,n.useEffect)((()=>{p(!0)}),[f]),(0,n.useEffect)((()=>{if(m){let e=0;if(null!==i&&null!==s){const t=s.toUnixInteger()-i.toUnixInteger(),n=Math.floor(t/60);e=n<1?15:n}W.A.invoke("GET",`/api/v1/${r}/info/widgets/${t.id}/?step=${e}&${null!==i?`&start=${i.toUnixInteger()}`:""}${null!==i&&null!==s?"&":""}${null!==s?`end=${s.toUnixInteger()}`:""}`).then((e=>{const i=y(e,t);u(i.data),p(!1)})).catch((e=>{c((0,o.C9)(e)),p(!1)}))}}),[m,t,s,i,c,r]),m?(0,g.jsx)(d.azJ,{sx:{width:"100%",paddingTop:"5px",textAlign:"center",margin:"auto"},children:(0,g.jsx)(d.aHM,{style:{width:12,height:12}})}):(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"stat-value",children:h}),x]})},Ie=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",color:c()(t,"signalColors.main","#07193E"),maxWidth:"321px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default","& .stat-text":{color:c()(t,"mutedText","#87888d"),fontSize:"12px",marginTop:"8px"}}})),Te=e=>{let{statItemLeft:t=null,statItemRight:i=null,icon:n=null,label:a=""}=e;return(0,g.jsx)(Ie,{children:(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",padding:"0 8px 0 8px",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"0 10px 0 10px"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",flexFlow:"column"},children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:a}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",gap:5,justifyContent:"space-between",paddingBottom:0,fontSize:55,flexFlow:"row",fontWeight:600,"& .stat-value":{textAlign:"center",height:"50px"},"& .min-icon":{marginRight:"8px",marginTop:"8px",height:"10px",width:"10px"},[`@media (max-width: ${d.nmC.sm}px)`]:{fontSize:35},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:45},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:50}},children:[t,i]})]}),(0,g.jsx)(d.azJ,{sx:{width:"20px",height:"20px",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},children:n})]})})},Je=w.Ay.div((e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",marginTop:"5px",gap:8,"&.online":{"& .min-icon":{margin:0,fill:c()(t,"signalColors.good","#4CCB92")}},"&.offline":{"& .min-icon":{margin:0,fill:c()(t,"signalColors.danger","#C51B3F")}},"& .indicatorText":{color:c()(t,"mutedText","#C51B3F"),fontSize:12}}})),Fe=e=>{let{info:t,timeStart:i,timeEnd:n,apiPrefix:a}=e;const{mergedPanels:l=[],id:s}=t,[r,o]=l,x=(0,g.jsx)(Ae,{panelItem:r,timeStart:i,timeEnd:n,apiPrefix:a,statLabel:(0,g.jsxs)(Je,{className:"online",children:[(0,g.jsx)(d.GQ2,{}),(0,g.jsx)(d.azJ,{className:"indicatorText",children:"Online"})]})}),c=(0,g.jsx)(Ae,{panelItem:o,timeStart:i,timeEnd:n,apiPrefix:a,statLabel:(0,g.jsxs)(Je,{className:"offline",children:[(0,g.jsx)(d.GQ2,{}),(0,g.jsx)(d.azJ,{className:"indicatorText",children:"Offline"})]})});let m=null,p="";return 500===s?(m=(0,g.jsx)(d.WXN,{}),p="Servers"):501===s&&(m=(0,g.jsx)(d.JUN,{}),p="Drives"),(0,g.jsx)(Te,{statItemLeft:x,statItemRight:c,icon:m,label:p})},Ne=w.Ay.div((e=>{let{theme:t}=e;return{"& .putLabel":{display:"flex",gap:10,alignItems:"center",marginTop:"10px","& .min-icon":{height:15,width:15,fill:c()(t,"signalColors.good","#4CCB92")},"& .getText":{fontSize:"18px",color:c()(t,"mutedText","#87888d"),fontWeight:"bold"},"& .valueText":{fontSize:50,fontFamily:"Inter",fontWeight:600}}}})),$e=e=>{let{value:t,loading:i}=e;return(0,g.jsxs)(Ne,{children:[(0,g.jsxs)(d.azJ,{className:"putLabel",children:[(0,g.jsx)(d.azJ,{className:"getText",children:"GET"}),i?(0,g.jsx)(d.aHM,{style:{width:"15px",height:"15px"}}):(0,g.jsx)(d.OFF,{})]}),(0,g.jsx)(d.azJ,{className:"valueText",children:t})]})},Ee=w.Ay.div((e=>{let{theme:t}=e;return{"& .putLabel":{display:"flex",gap:10,alignItems:"center",marginTop:"10px","& .min-icon":{height:15,width:15,fill:c()(t,"signalColors.info","#2781B0")},"& .putText":{fontSize:"18px",color:c()(t,"mutedText","#87888d"),fontWeight:"bold"},"& .valueText":{fontSize:50,fontFamily:"Inter",fontWeight:600}}}})),Le=e=>{let{value:t,loading:i}=e;return(0,g.jsxs)(Ee,{children:[(0,g.jsxs)(d.azJ,{className:"putLabel",children:[(0,g.jsx)(d.azJ,{className:"putText",children:"PUT"}),i?(0,g.jsx)(d.aHM,{style:{width:"15px",height:"15px"}}):(0,g.jsx)(d.z8D,{})]}),(0,g.jsx)(d.azJ,{className:"valueText",children:t})]})},ke=w.Ay.div((e=>{let{theme:t}=e;return{flex:1,display:"flex",alignItems:"center",flexFlow:"row",gap:"15px","& .unitText":{fontSize:"14px",color:c()(t,"mutedText","#87888d"),marginLeft:"5px"},"& .unit":{color:c()(t,"mutedText","#87888d"),fontSize:"18px",marginLeft:"12px",marginTop:"10px"},[`@media (max-width: ${d.nmC.sm}px)`]:{flexFlow:"column"}}})),We=e=>{let{value:t,timeStart:i,timeEnd:n,apiPrefix:a}=e;const{mergedPanels:l=[]}=t,[s,r]=l,o=(0,g.jsx)(le,{title:t.title,panelItem:s,timeStart:i,timeEnd:n,apiPrefix:a,renderFn:e=>{let{valueToRender:t,loading:i,title:n,id:a}=e;return(0,g.jsx)(Le,{value:t,loading:i,title:n,id:a})}}),x=(0,g.jsx)(le,{title:t.title,panelItem:r,timeStart:i,timeEnd:n,apiPrefix:a,renderFn:e=>{let{valueToRender:t,loading:i,title:n,id:a}=e;return(0,g.jsx)($e,{value:t,loading:i,title:n,id:a})}});return(0,g.jsxs)(ke,{children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:"Network"}),(0,g.jsx)(d.azJ,{sx:{position:"relative",width:110,height:110,marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:"0"}},children:(0,g.jsx)(d.azJ,{sx:{position:"absolute",display:"flex",flexFlow:"column",alignItems:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontWeight:"bold",fontSize:12},children:x})}),(0,g.jsx)(d.azJ,{sx:{display:"flex",alignItems:"center",marginLeft:"auto",[`@media (max-width: ${d.nmC.sm}px)`]:{marginLeft:"0"}},children:(0,g.jsx)(d.azJ,{sx:{display:"flex",alignItems:"center","& .value":{fontSize:"50px",fontFamily:"Inter"}},children:o})}),(0,g.jsx)(d.azJ,{sx:{marginLeft:"15px",height:"100%",display:"flex",alignItems:"flex-start","& .min-icon":{height:"15px",width:"15px"}},children:(0,g.jsx)(d.vhL,{})})]})},Be=e=>{let{info:t,timeStart:i,timeEnd:n,loading:a,apiPrefix:l}=e;const{mergedPanels:s=[],title:r="",id:o}=t,[d,x]=s;return[500,501].includes(o)?(0,g.jsx)(X,{children:(0,g.jsx)(Fe,{info:t,timeStart:i,timeEnd:n,apiPrefix:l})}):502===o?(0,g.jsx)(X,{children:(0,g.jsx)(We,{apiPrefix:l,timeEnd:n,timeStart:i,value:t})}):(0,g.jsx)(Se,{title:r,leftComponent:pe(d,i,n,a,l),rightComponent:pe(x,i,n,a,l)})},De=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",maxWidth:"321px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",color:c()(t,"signalColors.main","#07193E"),"& .mainBox":{flex:1,display:"flex",padding:"0 8px 0 8px",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"0 10px 0 10px"},"& .indicatorIcon":{width:"20px",height:"20px",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},"& .indicatorContainer":{flex:1,display:"flex",flexFlow:"column","& .indicatorLabel":{fontSize:"16px",fontWeight:600},"& .counterIndicator":{display:"flex",alignItems:"center",gap:"5px",justifyContent:"space-between",paddingBottom:0,fontSize:"55px",[`@media (max-width: ${d.nmC.sm}px)`]:{paddingBottom:10,fontSize:"35px"},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:"45px"},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:"50px"},flexFlow:"row",fontWeight:600,"& .stat-text":{color:c()(t,"mutedText","#87888D"),fontSize:"12px",marginTop:"8px"},"& .stat-value":{textAlign:"center",height:"50px"},"& .min-icon":{marginRight:"8px",marginTop:"8px",height:"10px",width:"10px"}},"& .onlineCounter":{display:"flex",alignItems:"center",marginTop:"5px","& .min-icon":{fill:c()(t,"signalColors.good","#4CCB92")}},"& .offlineCount":{display:"flex",alignItems:"center",marginTop:"8px","& .min-icon":{fill:c()(t,"signalColors.danger","#C51B3F")}}}}}})),Re=e=>{let{onlineCount:t=0,offlineCount:i=0,icon:n=null,label:a="",okStatusText:l="Online",notOkStatusText:s="Offline"}=e;return(0,g.jsx)(De,{children:(0,g.jsxs)(d.azJ,{className:"mainBox",children:[(0,g.jsxs)(d.azJ,{className:"indicatorContainer",children:[(0,g.jsx)(d.azJ,{className:"indicatorLabel",children:a}),(0,g.jsxs)(d.azJ,{className:"counterIndicator",children:[(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"stat-value",children:t}),(0,g.jsxs)(d.azJ,{className:"onlineCounter",children:[(0,g.jsx)(d.GQ2,{}),(0,g.jsx)("div",{className:"stat-text",children:l})]})]}),(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{className:"stat-value",children:i}),(0,g.jsxs)(d.azJ,{className:"offlineCount",children:[(0,g.jsx)(d.GQ2,{})," ",(0,g.jsx)("div",{className:"stat-text",children:s})]})]})]})]}),(0,g.jsx)(d.azJ,{className:"indicatorIcon",children:n})]})})};var Me=i(39835),Oe=i.n(Me),Ue=i(71435);const Ve=w.Ay.div((e=>{let{theme:t}=e;return{alignItems:"baseline",padding:"5px",display:"flex",gap:"5px","& .StatBox":{display:"flex",alignItems:"center",justifyContent:"center",flexFlow:"column","& .stat-text":{color:c()(t,"mutedText","#87888d"),fontSize:"12px"},"& .stat-value":{fontSize:"18px",color:c()(t,"signalColors.main","#07193E"),display:"flex",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& .stat-container":{display:"flex",alignItems:"center",justifyContent:"center",flexFlow:"column",marginLeft:"5px",maxWidth:"40px","&:first-of-type(svg)":{fill:c()(t,"mutedText","#87888d")},"& .stat-indicator":{marginRight:"0px",justifyContent:"center",alignItems:"center",textAlign:"center","& svg.min-icon":{width:"10px",height:"10px"},"&.good":{"& svg.min-icon":{fill:c()(t,"signalColors.good","#4CCB92")}},"&.warn":{"& svg.min-icon":{fill:c()(t,"signalColors.warning","#FFBD62")}},"&.bad":{"& svg.min-icon":{fill:c()(t,"signalColors.danger","#C51B3F")}}}}}}}})),Pe=w.Ay.div((e=>{let{theme:t}=e;return{display:"flex",alignItems:"flex-start",flexFlow:"column",flex:1,"& .server-state":{marginLeft:"8px","& .min-icon":{height:"14px",width:"14px"},"&.good":{"& svg.min-icon":{fill:c()(t,"signalColors.good","#4CCB92")}},"&.warn":{"& svg.min-icon":{fill:c()(t,"signalColors.warning","#FFBD62")}},"&.bad":{"& svg.min-icon":{fill:c()(t,"signalColors.danger","#C51B3F")}}}}})),Ge=e=>{let{label:t="",value:i="",statusColor:n="warn",hasStatus:a=!1}=e;return(0,g.jsx)(Ve,{children:(0,g.jsxs)(d.azJ,{className:"StatBox",children:[(0,g.jsxs)("div",{className:"stat-value",children:[i," ",(0,g.jsx)(d.azJ,{className:"stat-container",children:a?(0,g.jsx)(d.azJ,{className:`stat-indicator ${n}`,children:(0,g.jsx)(d.GQ2,{})}):(0,g.jsx)(d.azJ,{sx:{width:"12px",height:"12px"}})})]}),(0,g.jsx)("div",{className:"stat-text",children:t})]})})},_e=e=>{let{server:t}=e;const i=Object.keys(c()(t,"network",{})),n=i.length,a=t.drives?t.drives.length:0,l=i.reduce(((e,i)=>"online"===(t.network?t.network[i]:"")?e+1:e),0),s=t.drives?t.drives.filter((e=>"ok"===e.state)).length:0;return(0,g.jsx)(Pe,{children:(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",padding:"3px",gap:"15px",justifyContent:"space-between",width:"100%",paddingLeft:"20px",flexFlow:"row",[`@media (max-width: ${d.nmC.md}px)`]:{flexFlow:"column"}},children:[(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center"},children:[(0,g.jsx)(d.azJ,{sx:{fontWeight:600,textTransform:"none"},children:t.endpoint||""}),(null===t||void 0===t?void 0:t.state)&&(0,g.jsx)(d.azJ,{className:`server-state ${(0,Ue.Zb)(t.state)}`,children:(0,g.jsx)(d.GQ2,{})})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flex:"1.5",gap:"5%"},children:[(0,g.jsx)(Ge,{statusColor:(0,Ue.WJ)(s,a),label:"Drives",hasStatus:!0,value:`${s}/${a}`}),(0,g.jsx)(Ge,{statusColor:(0,Ue.CS)(l,n),label:"Network",hasStatus:!0,value:`${l}/${n}`}),(0,g.jsx)(Ge,{statusColor:"good",label:"Up time",value:null!==t&&void 0!==t&&t.uptime?(0,p.hr)(`${t.uptime}`):"N/A"})]}),(0,g.jsx)(Ge,{statusColor:"good",label:"",value:(0,g.jsxs)(d.azJ,{sx:{background:"rgb(235, 236, 237)",color:"#000000",paddingLeft:"10px",paddingRight:"10px",borderRadius:"2px",fontSize:"12px",marginTop:"5px","& .label":{fontWeight:600,marginRight:"3px"}},children:[(0,g.jsx)("span",{className:"label",children:"Version:"}),t.version?t.version:"N/A"]})})]})})},Ke=e=>{var t,i,a,l;let{drive:s}=e;const r=(0,w.DP)(),o=null!==(t=s.totalSpace)&&void 0!==t?t:0,x=null!==(i=s.usedSpace)&&void 0!==i?i:0,m=0!==o?Math.max(x/o*100,0):0,h=null!==(a=s.availableSpace)&&void 0!==a?a:0,u=0!==o?Math.max(h/o*100,0):0,f=(0,n.useMemo)((()=>{switch(s.state){case"offline":return Ue.Ez.RED;case"ok":return Ue.Ez.GREEN;default:return Ue.Ez.YELLOW}}),[s.state]),j=(0,n.useMemo)((()=>{switch(s.state){case"offline":return"Offline Drive";case"ok":return"Online Drive";default:return"Unknown"}}),[s.state]);return(0,g.jsxs)(d.azJ,{withBorders:!0,sx:{display:"flex",flexFlow:"row",padding:12,gap:24,alignItems:"center",[`@media (max-width: ${d.nmC.xs}px)`]:{flexFlow:"column",alignItems:"start"},"& .info-label":{color:c()(r,"mutedText","#87888d"),fontSize:12},"& .info-value":{fontSize:18,color:c()(r,"signalColors.main","#07193E"),display:"flex",fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"& .drive-endpoint":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",wordBreak:"break-all",fontWeight:600,fontSize:16,[`@media (max-width: ${d.nmC.sm}px)`]:{fontSize:10}},"& .percentage-row":{display:"flex",gap:4,alignItems:"center",fontSize:12,"& .percentage-value":{fontWeight:700}}},children:[(0,g.jsx)(d.cNv,{chartLabel:"Used Capacity",label:!0,usedBytes:x,totalBytes:o,width:"153",height:"153"}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column",gap:12,flex:1},children:[(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"row",gap:8,[`@media (max-width: ${d.nmC.xs}px)`]:{flexFlow:"column"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:"1 1 60%",[`@media (max-width: ${d.nmC.xs}px)`]:{flex:"1 1 100%"}},children:[(0,g.jsx)("label",{className:"info-label",children:"Drive Name"}),(0,g.jsx)(d.azJ,{className:"drive-endpoint",children:null!==(l=s.endpoint)&&void 0!==l?l:""})]}),(0,g.jsxs)(d.azJ,{sx:{flex:"1 1 20%",[`@media (max-width: ${d.nmC.xs}px)`]:{flex:"1 1 100%"}},children:[(0,g.jsx)("label",{className:"info-label",children:"Drive Status"}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"row",alignItems:"center",fontSize:12,fontWeight:600,gap:4,color:f,"& .min-icon":{height:8,width:8,flexShrink:0}},children:[(0,g.jsx)(d.GQ2,{}),j]})]})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"row",gap:36},children:[(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column"},children:[(0,g.jsx)("label",{className:"info-label",children:"Used Capacity"}),(0,g.jsx)(d.azJ,{className:"info-value",children:(0,p.nO)(x.toString())}),(0,g.jsxs)(d.azJ,{className:"percentage-row",children:[(0,g.jsxs)(d.azJ,{className:"percentage-value",children:[m.toFixed(2),"%"]}),(0,g.jsxs)(d.azJ,{children:["of ",(0,p.nO)(o.toString())]})]})]}),(0,g.jsx)(d.azJ,{sx:{width:1,backgroundColor:c()(r,"borderColor","#BBBBBB")}}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column"},children:[(0,g.jsx)("label",{className:"info-label",children:"Available Capacity"}),(0,g.jsx)(d.azJ,{className:"info-value",children:(0,p.nO)(h.toString())}),(0,g.jsxs)(d.azJ,{className:"percentage-row",children:[(0,g.jsxs)(d.azJ,{className:"percentage-value",children:[u.toFixed(2),"%"]}),(0,g.jsxs)(d.azJ,{children:["of ",(0,p.nO)(o.toString())]})]})]})]})]})]})},He=e=>{let{data:t}=e;const[i,a]=n.useState(t.length>1?"":t[0].endpoint+"-0"),l=e=>{a(e)};return(0,g.jsxs)(d.azJ,{children:[(0,g.jsxs)(d.azJ,{sx:{fontSize:18,lineHeight:2,fontWeight:700},children:["Servers (",t.length,")"]}),(0,g.jsx)(d.azJ,{children:t.map(((e,t)=>{var n,a;const s=`${e.endpoint}-${t}`,r=i===s;return(0,g.jsxs)(d.nD3,{expanded:r,onTitleClick:()=>{l(r?"":s)},id:"key",title:(0,g.jsx)(_e,{server:e,index:t}),sx:{marginBottom:15},children:[(0,g.jsxs)(d.azJ,{useBackground:!0,sx:{padding:"10px 30px",fontWeight:"bold"},children:["Drives (",null===(n=e.drives)||void 0===n?void 0:n.length,")"]}),(0,g.jsx)(d.azJ,{sx:{flex:1,display:"flex",flexDirection:"column",padding:"15px 30px",gap:15,[`@media (max-width: ${d.nmC.sm}px)`]:{padding:"10px 10px"}},children:null===(a=e.drives)||void 0===a?void 0:a.map(((e,t)=>(0,g.jsx)(Ke,{drive:e},`${e.endpoint}-${t}`)))})]},s)}))})]})},Qe=w.Ay.div((e=>{let{theme:t}=e;return{fontFamily:"Inter,sans-serif",color:c()(t,"signalColors.main","#07193E"),maxWidth:"300px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",position:"relative",width:"100%"}})),qe=e=>{let{counterValue:t,label:i="",icon:n=null,actions:a=null}=e;return(0,g.jsx)(Qe,{children:(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",width:"100%",padding:"0 8px 0 8px",position:"absolute",[`@media (max-width: ${d.nmC.md}px)`]:{padding:"0 10px 0 10px"}},children:[(0,g.jsxs)(d.azJ,{sx:{flex:1,display:"flex",flexFlow:"column",marginTop:"8px",zIndex:10,overflow:"hidden"},children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"16px",fontWeight:600},children:i}),(0,g.jsx)(d.m_M,{tooltip:t,placement:"bottom",children:(0,g.jsx)(d.azJ,{sx:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",maxWidth:187,flexFlow:"row",fontSize:t.toString().length>=5?50:55,[`@media (max-width: ${d.nmC.sm}px)`]:{flexFlow:"column",maxWidth:200,fontSize:t.toString().length>=5?20:35},[`@media (max-width: ${d.nmC.md}px)`]:{fontSize:t.toString().length>=5?28:35},[`@media (max-width: ${d.nmC.lg}px)`]:{fontSize:t.toString().length>=5?28:36},[`@media (max-width: ${d.nmC.xl}px)`]:{fontSize:t.toString().length>=5?45:50}},children:t})})]}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column",alignItems:"center",justifyContent:"flex-start",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},children:[n,(0,g.jsx)(d.azJ,{sx:{display:"flex"},children:a})]})]})})};var Ye=i(80882),Xe=i(99161),Ze=i(6681);const et=e=>{let{children:t}=e;return(0,g.jsx)(d.azJ,{withBorders:!0,sx:{padding:15,height:"136px",maxWidth:"100%",[`@media (max-width: ${d.nmC.sm}px)`]:{padding:5,maxWidth:"initial"}},children:t})},tt=e=>{var t,i,n,a,l,s,r,o,x,c;let{usage:m}=e;const h=m&&m.usage?m.usage.toString():"0",u=(e=>void 0===e?{total:"0",unit:"Mi"}:(0,p.GT)(e))(h),{lastScan:f="n/a",lastHeal:j="n/a",upTime:C="n/a"}={},y=(e=>e&&e.servers?[...e.servers].sort((function(e,t){var i,n;const a=(null===(i=e.endpoint)||void 0===i?void 0:i.toLowerCase())||"",l=(null===(n=t.endpoint)||void 0===n?void 0:n.toLowerCase())||"";return al?1:0})):[])(m);let v=[];y.forEach((e=>{var t;const i=null===(t=e.drives)||void 0===t?void 0:t.map((e=>e));i&&(v=[...v,...i])}));const w=Oe()(y,"state"),{offline:b=[],online:z=[]}=w,S=Oe()(v,"state"),{offline:A=[],ok:I=[]}=S;return(0,g.jsx)(d.azJ,{children:(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateRows:"1fr",gridTemplateColumns:"1fr",gap:27,marginBottom:40},children:[(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr",gap:"40px"},children:[(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateRows:"136px",gridTemplateColumns:"1fr 1fr 1fr",gap:20,[`@media (max-width: ${d.nmC.sm}px)`]:{gridTemplateColumns:"1fr"},[`@media (max-width: ${d.nmC.md}px)`]:{marginBottom:0}},children:[(0,g.jsx)(et,{children:(0,g.jsx)(qe,{label:"Buckets",icon:(0,g.jsx)(d.brV,{}),counterValue:m?(0,p.dq)(m.buckets):0,actions:(0,g.jsx)(we.N_,{to:Xe.zZ.BUCKETS,style:{zIndex:3,textDecoration:"none",top:"40px",position:"relative",marginRight:"75px"},children:(0,g.jsx)(Ze.A,{tooltip:"Browse",children:(0,g.jsx)(d.$nd,{id:"browse-dashboard",onClick:()=>{},label:"Browse",icon:(0,g.jsx)(d.flY,{}),variant:"regular",style:{padding:5,height:30,fontSize:14,marginTop:20}})})})})}),(0,g.jsx)(et,{children:(0,g.jsx)(qe,{label:"Objects",icon:(0,g.jsx)(d.Sxe,{}),counterValue:m?(0,p.dq)(m.objects):0})}),(0,g.jsx)(et,{children:(0,g.jsx)(Re,{onlineCount:z.length,offlineCount:b.length,label:"Servers",icon:(0,g.jsx)(d.WXN,{})})}),(0,g.jsx)(et,{children:(0,g.jsx)(Re,{offlineCount:(null===m||void 0===m||null===(t=m.backend)||void 0===t?void 0:t.offlineDrives)||A.length,onlineCount:(null===m||void 0===m||null===(i=m.backend)||void 0===i?void 0:i.onlineDrives)||I.length,label:"Drives",icon:(0,g.jsx)(d.JUN,{})})}),(0,g.jsxs)(d.azJ,{withBorders:!0,sx:{gridRowStart:"1",gridRowEnd:"3",gridColumnStart:"3",padding:15,display:"grid",justifyContent:"stretch"},children:[(0,g.jsx)(Ye.A,{usageValue:h,total:u.total,unit:u.unit}),(0,g.jsxs)(d.azJ,{sx:{display:"flex",flexFlow:"column",gap:"14px"},children:[(0,g.jsx)(de,{icon:(0,g.jsx)(d.Sdx,{}),label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Heal Activity"]}),value:j}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.Zui,{}),label:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{display:"inline",[`@media (max-width: ${d.nmC.sm}px)`]:{display:"none"}},children:"Time since last"})," ","Scan Activity"]}),value:f}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.Owo,{}),label:"Uptime",value:C})]})]})]}),(0,g.jsxs)(d.azJ,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"14px",[`@media (max-width: ${d.nmC.lg}px)`]:{gridTemplateColumns:"1fr"}},children:[(0,g.jsx)(de,{icon:(0,g.jsx)(d.NBP,{}),label:"Backend type",value:null!==(n=null===m||void 0===m||null===(a=m.backend)||void 0===a?void 0:a.backendType)&&void 0!==n?n:"Unknown"}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.eXQ,{}),label:"Standard storage class parity",value:null!==(l=null===m||void 0===m||null===(s=m.backend)||void 0===s||null===(r=s.standardSCParity)||void 0===r?void 0:r.toString())&&void 0!==l?l:"n/a"}),(0,g.jsx)(de,{icon:(0,g.jsx)(d.eXQ,{}),label:"Reduced redundancy storage class parity",value:null!==(o=null===m||void 0===m||null===(x=m.backend)||void 0===x||null===(c=x.rrSCParity)||void 0===c?void 0:c.toString())&&void 0!==o?o:"n/a"})]}),(0,g.jsx)(d.azJ,{sx:{display:"grid",gridTemplateRows:"auto",gridTemplateColumns:"1fr",gap:"auto"},children:(0,g.jsx)(He,{data:y})})]}),"not configured"===(null===m||void 0===m?void 0:m.advancedMetricsStatus)&&(0,g.jsx)(d.azJ,{children:(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsxs)(d.azJ,{children:[(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"MinIO Dashboard will display basic metrics as we couldn\u2019t connect to Prometheus successfully. Please try again in a few minutes. If the problem persists, you can review your configuration and confirm that Prometheus server is up and running."}),(0,g.jsx)(d.azJ,{sx:{paddingTop:20,fontSize:14},children:(0,g.jsx)("a",{href:"https://min.io/docs/minio/linux/operations/monitoring/collect-minio-metrics-using-prometheus.html",target:"_blank",rel:"noopener",children:"Read more about Prometheus on our Docs site."})})]})})})]})})},it=e=>{let{apiPrefix:t="admin",usage:i}=e;const a=(0,l.jL)(),o=(0,l.GV)((e=>e.dashboard.status)),x=(0,l.GV)((e=>e.dashboard.zoom.openZoom)),c=(0,l.GV)((e=>e.dashboard.zoom.widgetRender)),m=(0,l.GV)(r.s$),p=!(null===m||void 0===m||!m.includes("object-browser-only"));let h=!1;(null!==m&&void 0!==m&&m.includes("hide-menu")||p)&&(h=!0);const[u,f]=(0,n.useState)(null),[C,y]=(0,n.useState)(null),v=j,[w,b]=(0,n.useState)("info"),z=e=>e.reduce(((e,i,a)=>{const{columns:l=[]}=i,s=l.map(((e,i)=>{var l;return((e,i)=>(0,g.jsx)(n.Fragment,{children:e?(0,g.jsx)(n.Fragment,{children:(0,g.jsx)(d.azJ,{children:e.mergedPanels?(0,g.jsx)(Be,{info:e,timeStart:u,timeEnd:C,loading:!0,apiPrefix:t}):pe(e,u,C,!0,t,x)})}):null},`widget-${i}`))((l=e.componentId,v.find((e=>e.id===l))),`${a}-${i}`)}));return[...e,(0,g.jsx)(d.azJ,{sx:i.sx,children:s},`layout-row-${a}`)]}),[]),S="not configured"===(null===i||void 0===i?void 0:i.advancedMetricsStatus),A=(0,g.jsx)(d.azJ,{sx:{marginBottom:20},children:"info"===w?(0,g.jsxs)(d.xA9,{container:!0,children:[(0,g.jsx)(d.xA9,{item:!0,children:(0,g.jsx)(d.azJ,{sx:{fontSize:18,lineHeight:2,fontWeight:700},children:"Server Information"})}),(0,g.jsx)(d.xA9,{item:!0,xs:!0,children:(0,g.jsx)(d.xA9,{container:!0,direction:"row-reverse",children:(0,g.jsx)(d.xA9,{item:!0,children:(0,g.jsx)(d.$nd,{id:"sync",type:"button",variant:"callAction",onClick:()=>{a((0,s.i)())},disabled:"loading"===o,icon:(0,g.jsx)(d.Fjq,{}),label:"Sync"})})})})]}):(0,g.jsx)(ve.A,{timeStart:u,setTimeStart:f,timeEnd:C,setTimeEnd:y,triggerSync:()=>{a((0,N.pA)())}})});let I=[{tabConfig:{label:"Info",id:"info",disabled:!1},content:(0,g.jsxs)(n.Fragment,{children:[(!i||"loading"===o)&&(0,g.jsx)(d.z21,{}),i&&"idle"===o&&(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsx)(tt,{usage:i})]})]})},...[{tabConfig:{label:"Usage",id:"usage",disabled:S},content:(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsxs)(je,{children:["unavailable"===(null===i||void 0===i?void 0:i.advancedMetricsStatus)&&(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"It looks like Prometheus is not available or reachable at the moment."})}),v.length?z(ge):null]})]})},{tabConfig:{label:"Traffic",id:"traffic",disabled:S},content:(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsxs)(je,{children:["unavailable"===(null===i||void 0===i?void 0:i.advancedMetricsStatus)&&(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"It looks like Prometheus is not available or reachable at the moment."})}),v.length?z(he):null]})]})},{tabConfig:{label:"Resources",id:"resources",disabled:S},content:(0,g.jsxs)(n.Fragment,{children:[A,(0,g.jsxs)(je,{children:["unavailable"===(null===i||void 0===i?void 0:i.advancedMetricsStatus)&&(0,g.jsx)(d.lVp,{iconComponent:(0,g.jsx)(d.uMc,{}),title:"We can\u2019t retrieve advanced metrics at this time.",help:(0,g.jsx)(d.azJ,{sx:{fontSize:"14px"},children:"It looks like Prometheus is not available or reachable at the moment."})}),v.length?z(ue):null,(0,g.jsx)("h2",{style:{margin:0,borderBottom:"1px solid #dedede"},children:"Advanced"}),v.length?z(fe):null]})]})}]];return(0,g.jsxs)(d.Mxu,{sx:{padding:h?0:"2rem"},children:[x&&(0,g.jsx)(ye,{modalOpen:x,timeStart:u,timeEnd:C,widgetRender:0,value:c,apiPrefix:t}),(0,g.jsx)(d.tUM,{horizontal:!0,options:I,currentTabOrPath:w,onTabClick:e=>{b(e)}})]})};var nt=i(48793),at=i(88617);const lt=()=>{const e=(0,l.jL)(),[t,i]=(0,n.useState)(!1),d=(0,a.d4)((e=>e.dashboard.usage)),x=(0,a.d4)(r.s$),c=!(null===x||void 0===x||!x.includes("object-browser-only"));let m=!1;return(null!==x&&void 0!==x&&x.includes("hide-menu")||c)&&(m=!0),(0,n.useEffect)((()=>{t||(i(!0),e((0,s.i)()))}),[t,e]),(0,n.useEffect)((()=>{e((0,o.ph)("metrics"))}),[e]),(0,g.jsxs)(n.Fragment,{children:[!m&&(0,g.jsx)(nt.A,{label:"Metrics",actions:(0,g.jsx)(at.A,{})}),(0,g.jsx)(it,{usage:d})]})}}}]); //# sourceMappingURL=2491.b81bd18c.chunk.js.map