import{u as P,_ as A}from"./Cc3064wI.js";import{f as y}from"./4Fu3KWqy.js";import{v as B,A as K,B as O,_ as C,o,p,q as g,y as x,w as S,c as T,t as j}from"./CChoqk00.js";import{_ as F}from"./Ba4kvkeX.js";import{_ as H}from"./BR_ubjDa.js";import{_ as V}from"./ncYpbZOT.js";import{u as E}from"./B1YZX18f.js";import{u as I}from"./DTzhji9-.js";import"./DgZ9OEJo.js";import"./MHEJVwNG.js";import"./Du23p2ZK.js";import"./oBAm95WQ.js";import"./dbr-bJEC.js";import"./D7TmchvX.js";import"./BBOawLyY.js";const M=B({__name:"TableDiskUsage",props:{data:{type:Object,default:()=>({})}},setup(m,{expose:f}){f();const a=m,{pagination:t,resetPagination:n,resetSort:d}=P();n(),d(),t.resultsPerPage=2,t.totalResults=20;const{t:s}=K(),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")}],u=(e,l,c)=>{const _=Math.round(e/c*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: ${_}%">
      </div>
      `},b=O(()=>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:u(e.bytesFree,e.bytesUsed,e.bytesTotal)}})):[]),i={props:a,pagination:t,resetPagination:n,resetSort:d,t:s,cols:r,freeSpaceBar:u,rows:b};return Object.defineProperty(i,"__isScriptSetup",{enumerable:!1,value:!0}),i}});function N(m,f,a,t,n,d){var r;const s=A;return(r=t.rows)!=null&&r.length?(o(),p(s,{key:0,cols:t.cols,rows:t.rows,name:"diskusage","disable-footer":["count","pagination"]},null,8,["rows"])):g("",!0)}const q=Object.assign(C(M,[["render",N],["__file","TableDiskUsage.vue"]]),{__name:"TableDiskUsage"}),z=B({__name:"disk",async setup(m,{expose:f}){f();let a,t;const{getChartData:n,getDiskUsageData:d}=E(),{data:s,error:r,status:u}=([a,t]=x(()=>n()),a=await a,t(),a),{data:b,error:i,status:e}=([a,t]=x(()=>d()),a=await a,t(),a),l=["OverallDiskUsage","sdaI0Transactions","sdaI0Data"],{tracker:c}=I();c("page_view","page","disk");const _={getChartData:n,getDiskUsageData:d,data:s,error:r,status:u,diskUsageData:b,diskUsageError:i,diskUsageStatus:e,titles:l,tracker:c};return Object.defineProperty(_,"__isScriptSetup",{enumerable:!1,value:!0}),_}}),R={key:0,class:"grid gap-4"},G={key:1,class:"p-4"};function J(m,f,a,t,n,d){const s=q,r=F,u=H,b=V;return o(),p(b,{"modal-style":!0},{default:S(()=>{var i,e,l,c,_,k,h,U,v;return[t.status!=="pending"&&t.diskUsageStatus!=="pending"?(o(),T("div",R,[(i=t.data)!=null&&i.data[0]?(o(),p(r,{key:0,pending:t.status==="pending",title:t.titles[0],"chart-data":(e=t.data)==null?void 0:e.data[0],"chart-options":(l=t.data)==null?void 0:l.data[0].options},{default:S(()=>{var D,w;return[(D=t.diskUsageData)!=null&&D.data?(o(),p(s,{key:0,data:t.diskUsageData.data},null,8,["data"])):g("",!0),(w=t.diskUsageData.data)!=null&&w.length?g("",!0):(o(),T("div",G,j(m.$t("NoDataAvailable")),1))]}),_:1},8,["pending","title","chart-data","chart-options"])):g("",!0),(c=t.data)!=null&&c.data[1]?(o(),p(r,{key:1,pending:t.status==="pending",title:t.titles[1],"chart-data":(_=t.data)==null?void 0:_.data[1],"chart-options":(k=t.data)==null?void 0:k.data[1].options},null,8,["pending","title","chart-data","chart-options"])):g("",!0),(h=t.data)!=null&&h.data[2]?(o(),p(r,{key:2,pending:t.status==="pending",title:t.titles[2],"chart-data":(U=t.data)==null?void 0:U.data[2],"chart-options":(v=t.data)==null?void 0:v.data[2].options},null,8,["pending","title","chart-data","chart-options"])):g("",!0)])):(o(),p(u,{key:1,error:t.error||t.diskUsageError},null,8,["error"]))]}),_:1})}const it=C(z,[["render",J],["__file","disk.vue"]]);export{it as default};
