import{c as e,s as t,g as s,q as a,a6 as o,v as l,x as r,e as i,B as n,z as c,I as d,N as p,K as u,y as f,L as m,A as v,F as y,C as h,J as b,M as _,b5 as k,aS as x,az as g,c2 as j}from"./base-lib.js?v=1761009159";import{a as w}from"./index48.js?v=1761009159";import{_ as B}from"./utils-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./validator.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";import"./index112.js?v=1761009159";import"./index107.js?v=1761009159";import"./store3.js?v=1761009159";import"./store4.js?v=1761009159";import"./config.js?v=1761009159";import"./store5.js?v=1761009159";import"./hooks.js?v=1761009159";const C={class:"state-data flex items-center justify-center"},N={class:"flex flex-col items-center"},$={class:"percentage-value"},T={class:"state-bottom"},z={class:"text-small"},A={class:"text-small"},D={class:"state-header"},H={class:"pb-4px"},I={key:1},S=["href"],q={key:1,class:"pb-4px"},E=B(e({__name:"main-tile",props:{visible:{type:Boolean,default:!1},custom:{type:Boolean,default:!1},showDesc:{type:Boolean,default:!0},href:{default:""},info:{default:()=>({title:"",range:0})},disk:{type:Boolean,default:!1},data:{default:()=>({})},type:{default:""},alert:{type:Boolean,default:!1}},emits:["update:visible","openPopover","show","hide"],setup(e,{emit:B}){const E=e,F=w(),{virtualRef:J,popoverContent:K}=t(F),L=s(()=>{const{info:e,alert:t}=E,{desc:s,title:a,range:o,rangeText:l,disabled:r,type:i}=e,n=F.chartColorActive(o,t);let c=s,{color:d}=n;if("disk"===E.type&&"var(--el-color-primary)"===d){const{data:e}=E;d=Number(e.inodes[3].replace("%",""))>90?"#ef0808":Number(e.inodes[3].replace("%",""))>80?"#ff9900":"var(--el-color-primary)"}if("object"==typeof s&&("disk"===i||"mem"===i))try{c={used:s.used?s.used:"0",used_unit:s.used_unit?s.used_unit:"0",total:s.total?s.total:"0",total_unit:s.total_unit?s.total_unit:"0"}}catch(p){c="获取中"}return{type:i,title:a,color:d,range:o,disabled:!!r,desc:c||n.desc,rangeText:l||"",position:"bottom-start"}}),M=e=>{const{rangeText:t}=L.value;return t||"".concat(e,"%")};return a(()=>{F.init()}),o(F.$reset),(e,t)=>{const s=k,a=x,o=g,w=j;return l(),r("div",C,[i(o,{trigger:"hover","virtual-ref":f(J),width:e.custom?"auto":e.disk?300:400,offset:e.custom?1:0,placement:f(L).position,teleported:!1,"show-after":100,"auto-close":0,"popper-class":"el-popover-shadow",onShow:t[1]||(t[1]=t=>e.$emit("show")),onHide:t[2]||(t[2]=t=>e.$emit("hide"))},{reference:n(()=>{var o,i,_,k;return[c("div",{ref_key:"popoverContent",ref:K,class:"w-[135px] h-[180px] flex flex-col items-center"},[d((l(),p(s,{class:u(["cursor-pointer",{"mount-progress":"None"===e.data.path}]),type:"circle",width:115,"stroke-width":8,color:f(L).color,percentage:f(L).range||0,format:M,style:m("color:"+f(L).color)},{default:n(({percentage:e})=>[c("div",N,[c("span",$,v(e)+"%",1)])]),_:1},8,["class","color","percentage","style"])),[[w,void 0,"popover"]]),d(c("span",T,["object"!=typeof f(L).desc||"disk"!==f(L).type&&"mem"!==f(L).type?(l(),r(y,{key:1},[h(v(f(L).desc),1)],64)):(l(),r(y,{key:0},[c("span",{style:m({color:f(L).color})},[c("span",null,v(null==(o=f(L).desc)?void 0:o.used),1),c("span",z,v(null==(i=f(L).desc)?void 0:i.used_unit),1)],4),t[3]||(t[3]=c("span",null," / ",-1)),c("span",null,v(null==(_=f(L).desc)?void 0:_.total),1),c("span",A,v(null==(k=f(L).desc)?void 0:k.total_unit),1)],64))],512),[[b,e.showDesc]]),c("div",D,["disk"===e.type?(l(),p(a,{key:0,effect:"dark",placement:"top"},{content:n(()=>[c("p",H,["None"!==e.data.path?(l(),r(y,{key:0},[c("div",null,"别名："+v(e.data.rname),1),t[4]||(t[4]=c("div",null,"点击跳转目录",-1))],64)):(l(),r("div",I,"点击打开磁盘挂载插件"))])]),default:n(()=>[c("span",{class:"bt-link",style:m({color:f(L).color}),onClick:t[0]||(t[0]=t=>f(F).dirEvent(f(L).title,e.data.path))},v(f(L).title),5)]),_:1})):(l(),r(y,{key:1},[e.href?(l(),p(a,{key:0,class:"item",effect:"dark",content:"查看".concat(f(L).title,"描述"),placement:"top-start"},{default:n(()=>[c("a",{class:"border-dashed border-light border-b-[1px] hover:text-primary hover:border-primary",href:e.href,target:"_blank"},v(f(L).title),9,S)]),_:1},8,["content"])):(l(),r("span",q,v(f(L).title),1))],64))])],512)]}),default:n(()=>[_(e.$slots,"default",{},void 0,!0)]),_:3},8,["virtual-ref","width","offset","placement"])])}}}),[["__scopeId","data-v-1386dbf5"]]);export{E as default};
