import{c as g,a as v}from"./system-6400ae6b.js";import{t as y}from"./table-85dc8ff4.js";import{M as n,L as b,j as k,b as C}from"./ui-ba7aaa7e.js";import{e as B,P as K,Q as $,f as r,a4 as a,I as c,H as l,ab as F}from"./vue-bf422dc1.js";import"./index-8db2df2c.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";import"./global-0d825ba6.js";const L={name:"Environment"},I=B({...L,setup(w){const s=[{title:"目录",colKey:"dir"},{title:"名称",colKey:"param"},{colKey:"value",title:"大小"},{title:"操作",colKey:"opt"}],{fetchData:i,dataLoading:d,headerAffixedTop:m,lists:f}=y({fetchFun:v});i();const p=e=>e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(2)}KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(2)}MB`:`${(e/1024/1024/1024).toFixed(2)}GB`,u=async e=>{const t=await g({dir:e});t.code===1?(n.success(t.msg),i()):n.error(t.msg)};return(e,t)=>{const _=b,h=k,x=C;return K(),$("div",null,[r(x,{title:"缓存管理",bordered:!1},{default:a(()=>[r(h,{size:"small",data:c(f),"row-key":"id",columns:s,"vertical-align":"middle",loading:c(d),"header-affixed-top":c(m),"table-layout":"fixed","max-height":"100%"},{value:a(({row:o})=>[l(F(p(o.value)),1)]),opt:a(({row:o})=>[r(_,{theme:"success",hover:"color",onClick:M=>u(o.dir)},{default:a(()=>[l("清空")]),_:2},1032,["onClick"])]),_:1},8,["data","loading","header-affixed-top"])]),_:1})])}}});export{I as default};
