File: /www/server/panel/BTPanel/static/js/disk-main-aapanel.js
import{c as e,s,g as t,r as o,v as l,a8 as i,x as r,y as a,A as n,e as p,C as d,L as u,z as c,F as m,b2 as f,O as h,B as j,M as v,D as x,G as b,aA as g,bc as w,b7 as y,bd as _}from"./base-lib.js?v=1777008528";import{a as k,b as S}from"./index53.js?v=1777008528";import{u as C,_ as z}from"./utils-lib.js?v=1777008528";import"./__commonjsHelpers__.js?v=1777008528";import"./validator.js?v=1777008528";import"./index111.js?v=1777008528";import"./column.js?v=1777008528";import"./index108.js?v=1777008528";import"./index117.js?v=1777008528";import"./index112.js?v=1777008528";import"./store.js?v=1777008528";import"./store2.js?v=1777008528";import"./config.js?v=1777008528";import"./useController13.js?v=1777008528";import"./ssl.js?v=1777008528";import"./useStore7.js?v=1777008528";import"./useStore12.js?v=1777008528";import"./useController2.js?v=1777008528";import"./site.js?v=1777008528";import"./index110.js?v=1777008528";import"./useStore2.js?v=1777008528";import"./useStore3.js?v=1777008528";import"./useController3.js?v=1777008528";import"./useController4.js?v=1777008528";import"./useController5.js?v=1777008528";import"./useMethod2.js?v=1777008528";import"./index119.js?v=1777008528";import"./useController6.js?v=1777008528";import"./useMethod9.js?v=1777008528";import"./useMethod7.js?v=1777008528";import"./store3.js?v=1777008528";import"./hooks.js?v=1777008528";const A={class:"flex flex-1"},B={class:"flex flex-row items-start justify-between w-full"},M={class:"w-full pb-[.2rem] text-base truncate disk-list-title"},N={class:"text-base text-darkTertiary font-400 font-alibaba-bold disk-list-desc"},P={class:"flex flex-col justify-center items-center h-full"},H=z(e({__name:"disk-main-aapanel",props:{list:{default:()=>[]}},emits:["update:visible","openPopover","show","hide"],setup(e,{emit:z}){const{mainWidth:H}=C(),T=k();s(T);const D=e,F=t(()=>H.value<=1600?130:144),G=o(12),I=t(()=>G.value+4),L=o(null);let O=null;function W(e,s=120){O&&clearTimeout(O),O=setTimeout(()=>{L.value=e},s)}l(()=>{});const $=t(()=>{const e=Array.isArray(D.list)?[...D.list]:[],s=4-e.length;if(s>0)for(let t=0;t<s;t++)e.push({show:!1,data:{byte_size:[0,0,0],path:"",size:["0 B","0 B","0 B","0%","0.00 b","0"],filesystem:"",type:"",inodes:[0,0,0,"0%"],d_size:"None",rname:""},info:{type:"disk",title:"",range:0,desc:{total:"0",used:"0",total_unit:"",used_unit:""}},isPlaceholder:!0});return e}),q=(e,s,t="progress")=>{if(null!==L.value&&L.value!==s)return"#eaeaea";const{range:o}=e.info;return Number(o)>90?"#ef0808":Number(o)>80?"#ff9900":"var(--el-color-primary)"},E=e=>F.value-e*I.value*2,J=e=>{const s=E(e);return{left:(F.value-s)/2+"px",top:(F.value-s)/2+"px"}};return l(()=>{T.init()}),i(T.$reset),(e,s)=>{const t=g,o=w,l=y,i=_;return r(),a("div",A,[n("div",B,[p(i,{span:24,class:"w-full"},{default:d(()=>[p(o,{span:16,xl:16},{default:d(()=>[n("div",{class:u(["h-full flex-2 gap-[4px]",2===c($).length?"grid grid-cols-1 grid-rows-2":"grid grid-cols-2 grid-rows-2"])},[(r(!0),a(m,null,f(c($),(e,o)=>(r(),a(m,{key:e.info.title+"-"+o},[e.isPlaceholder?b("",!0):(r(),h(t,{key:0,trigger:"hover",width:400,placement:"bottom-start",teleported:!1,"popper-class":"el-popover-shadow","hide-after":0,onShow:e=>W(o),onHide:s[0]||(s[0]=e=>W(null))},{reference:d(()=>{var t,l,i,p;return[n("div",{class:u(["flex flex-wrap items-baseline cursor-pointer",{"is-inactive":null!==c(L)&&c(L)!==o}])},[n("span",M,j(e.info.title),1),n("span",{class:"text-[2.2rem] font-700 leading-[1.2] mr-4 disk-list-range",style:v({color:q(e,o,"list")})},j(e.info.range)+"%",5),n("span",N,["object"==typeof e.info.desc&&"disk"===e.info.type?(r(),a(m,{key:0},[n("span",{style:v({color:e.info.color})},[n("span",null,j(null==(t=e.info.desc)?void 0:t.used)+j(null==(l=e.info.desc)?void 0:l.used_unit),1)],4),s[2]||(s[2]=n("span",null,"/",-1)),n("span",null,j(null==(i=e.info.desc)?void 0:i.total)+j(null==(p=e.info.desc)?void 0:p.total_unit),1)],64)):(r(),a(m,{key:1},[x(j(e.info.desc),1)],64))])],2)]}),default:d(()=>[p(S,{item:e},null,8,["item"])]),_:2},1032,["onShow"]))],64))),128))],2)]),_:1}),p(o,{span:8,xl:8},{default:d(()=>[n("div",P,[n("div",{class:"flex relative",style:v({width:c(F)+"px",height:c(F)+"px"})},[(r(!0),a(m,null,f(c($),(e,o)=>(r(),h(t,{key:e.info.title,disabled:e.isPlaceholder,trigger:"hover",width:400,placement:"bottom-start",teleported:!1,"popper-class":"el-popover-shadow","show-after":100,"hide-after":0,transition:"none",onShow:e=>W(o),onHide:s[1]||(s[1]=e=>W(null))},{reference:d(()=>[n("div",{class:"flex absolute",style:v(J(o))},[p(l,{class:u(["cursor-pointer",{"mount-progress":"None"===e.data.path}]),type:"circle","show-text":!1,width:E(o),"stroke-width":c(G),color:q(e,o),percentage:e.info.range||0},null,8,["class","width","stroke-width","color","percentage"])],4)]),default:d(()=>[p(S,{item:e},null,8,["item"])]),_:2},1032,["disabled","onShow"]))),128))],4)])]),_:1})]),_:1})])])}}}),[["__scopeId","data-v-60645521"]]);export{H as default};