import{u as S,_ as T}from"./BLJwFLQ5.js";import{f as y}from"./5LXQy1qV.js";import{v as D,A as w,E as C,_ as x,o,p as c,q as p,y as h,w as U,c as v,t as B}from"./CibDhUcP.js";import{_ as P}from"./7Y0YHGTE.js";import{_ as A}from"./BECNrDz6.js";import{_ as K}from"./xhP_boNp.js";import{u as O}from"./CJnKyk0K.js";import{u as j}from"./fWHo1AcK.js";import"./CTMooejj.js";import"./Cw-gY-k8.js";import"./CW5dyef9.js";import"./nOI-3DST.js";import"./BpJC44XK.js";import"./CBXHUQO1.js";import"./BCJxuefG.js";const E=D({__name:"TableDiskUsage",props:{data:{type:Object,default:()=>({})}},setup(u,{expose:g}){g();const a=u,{pagination:t,resetPagination:n,resetSort:d}=S();n(),d(),t.resultsPerPage=2,t.totalResults=20;const{t:s}=w(),r=[{id:"id",isHidden:!0},{id:"dm",sortKey:"dm",label:s("DiskMount")},{id:"file",sortKey:"file",label:s("FileSystem")},{id:"pused",sortKey:"pused",label:s("PercentageUsed")},{id:"bused",sortKey:"bused",label:s("BytesUsed")},{id:"bfree",sortKey:"bfree",label:s("BytesFree")}],_=(e,l,b)=>{const f=Math.round(e/b*100);return`
  <div class="mb-2">${y(e)}</div>
  <div class="bg-gray-100 h-2 w-full rounded-full">
    <div class="bg-primary h-2 rounded-full" style="width: ${f}%">
      </div>
      `},m=C(()=>a.data?a.data.map((e,l)=>({id:{value:l,isHidden:!0},dm:{value:e.bytesTotal,showValue:`${e.diskMount}<br><span class="text-xs">${y(e.bytesTotal)}</span>`},file:e.fileSystem,pused:{value:e.percentageUsed,showValue:`${e.percentageUsed}%`,style:e.percentUsed>80?"red":"green"},bused:y(e.bytesUsed),bfree:{value:e.bytesFree,showValue:_(e.bytesFree,e.bytesUsed,e.bytesTotal)}})):[]),i={props:a,pagination:t,resetPagination:n,resetSort:d,t:s,cols:r,freeSpaceBar:_,rows:m};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}});function F(u,g,a,t,n,d){var r;const s=T;return(r=t.rows)!=null&&r.length?(o(),c(s,{key:0,cols:t.cols,rows:t.rows,name:"diskusage","disable-footer":["count","pagination"]},null,8,["rows"])):p("",!0)}const H=Object.assign(x(E,[["render",F],["__file","TableDiskUsage.vue"]]),{__name:"TableDiskUsage"}),V=D({__name:"disk",async setup(u,{expose:g}){g();let a,t;const{getChartData:n,getDiskUsageData:d}=O(),{data:s,error:r,status:_}=([a,t]=h(()=>n()),a=await a,t(),a),{data:m,error:i,status:e}=([a,t]=h(()=>d()),a=await a,t(),a),{t:l}=w(),b=[l("OverallDiskUsage"),l("sdaI0Transactions"),l("sdaI0Data")],{tracker:f}=j();f("page_view","page","disk");const k={getChartData:n,getDiskUsageData:d,data:s,error:r,status:_,diskUsageData:m,diskUsageError:i,diskUsageStatus:e,t:l,titles:b,tracker:f};return Object.defineProperty(k,"__isScriptSetup",{enumerable:!1,value:!0}),k}}),I={key:0,class:"grid gap-4"},M={key:1,class:"p-4"};function N(u,g,a,t,n,d){const s=H,r=P,_=A,m=K;return o(),c(m,{"modal-style":!0},{default:U(()=>[t.status!=="pending"&&t.diskUsageStatus!=="pending"?(o(),v("div",I,[t.data.data[0]?(o(),c(r,{key:0,pending:t.status==="pending",title:t.titles[0],"chart-data":t.data.data[0],"chart-options":t.data.data[0].options},{default:U(()=>{var i;return[(i=t.diskUsageData)!=null&&i.data?(o(),c(s,{key:0,data:t.diskUsageData.data},null,8,["data"])):p("",!0),t.diskUsageData.data.length?p("",!0):(o(),v("div",M,B(u.$t("NoDataAvailable")),1))]}),_:1},8,["pending","title","chart-data","chart-options"])):p("",!0),t.data.data[1]?(o(),c(r,{key:1,pending:t.status==="pending",title:t.titles[1],"chart-data":t.data.data[1],"chart-options":t.data.data[1].options},null,8,["pending","title","chart-data","chart-options"])):p("",!0),t.data.data[2]?(o(),c(r,{key:2,pending:t.status==="pending",title:t.titles[2],"chart-data":t.data.data[2],"chart-options":t.data.data[2].options},null,8,["pending","title","chart-data","chart-options"])):p("",!0)])):(o(),c(_,{key:1,error:t.error||t.diskUsageError},null,8,["error"]))]),_:1})}const st=x(V,[["render",N],["__file","disk.vue"]]);export{st as default};
