import{_ as e}from"./index105.js?v=1761009159";import{aP as a,ap as t,P as s,cn as i,p as l,co as n,n as o,Q as r,cp as m,u as c,b2 as u,an as p,V as d}from"./utils-lib.js?v=1761009159";import{c as f,a as h,u as v}from"./column.js?v=1761009159";import{o as b,r as g,c as y,w as C,e as N,aS as _,aD as j,q as w,a6 as x,v as R,N as k,B,z as L,y as O}from"./base-lib.js?v=1761009159";import{b as T,N as W}from"./useMethods.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const{refs:{customLimit:q,isRefreshStorageList:S}}=a(),A=b({isRefresh:!0}),P=g([]),D=[{active:!0,label:"添加存储卷",onClick:()=>{o({component:()=>r(()=>import("./index229.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),title:"添加存储卷",area:58,btn:"添加"})}},{label:"清理存储卷",onClick:async()=>{await l({type:"calc",title:"清理存储卷",content:"您真的要清理所有未被容器使用的存储卷吗？（可能不会包含您自己创建的卷）"}),s({request:m(),message:!0,loading:"正在清理存储卷，请稍后...",success:()=>{S.value=!0}})}},{type:"link",label:"需求反馈",class:"ml-[2rem]",onClick:()=>{W()}}],E=async e=>{await l({type:"calc",title:"删除存储卷【".concat(e.Name,"】"),content:"您真的要删除存储卷【".concat(e.Name,"】吗？")}),s({request:n({data:JSON.stringify({name:e.Name})}),message:!0,success:()=>{S.value=!0}})},H=t([{label:"删除项目",value:"delete",event:async(e,a,t,s)=>{const{label:i,value:l}=s,o=async(e,a)=>{const{Name:t}=e;if("delete"===l)return await n({data:JSON.stringify({name:t})})};await e({title:"批量".concat(i,"存储卷"),content:"批量".concat(i,"已选的存储卷，是否继续操作！"),column:[{label:"存储卷",prop:"Name"},f()],onConfirm:async()=>(await a(o),S.value=!0,!1)})}}]),J=(e,a)=>{setTimeout(()=>{q.value.storage||((e,a)=>{setTimeout(()=>{e.value>900?a.value.limit=20:a.value.limit=10},0)})(e,a)},0)},M={class:"flex items-center"},V=y({__name:"index",setup(t){const{refs:{isRefreshStorageList:l}}=a(),{mainHeight:n}=c(),{BtOperation:o}=u({options:D});C(()=>l.value,e=>{e&&(A.isRefresh=!0,g())});const{BtTable:r,BtPage:m,BtBatch:f,BtColumn:b,refresh:g,param:y}=p({request:e=>(async e=>{if(S.value=!1,!A.isRefresh)return{data:T({limit:e.limit,list:P.value,p:e.p})||[],total:P.value.length};A.isRefresh=!1;const a=await s({request:i(),data:Array});return P.value=a,{data:T({limit:e.limit,list:P.value,p:e.p})||[],total:P.value.length}})(e),columns:[h({key:"Name"}),{label:"存储卷",prop:"Name",minWidth:100,render:e=>N(_,{placement:"top"},{default:()=>N("div",null,[e.Name]),content:()=>N("div",null,[e.Name])})},{label:"挂载点",prop:"Mountpoint",minWidth:100,isCustom:!0,showOverflowTooltip:!0},{label:"所属容器",prop:"container",minWidth:100,isCustom:!0},{label:"设备",prop:"Driver",minWidth:100,isCustom:!0},{label:"创建时间",prop:"CreatedAt",minWidth:100,isCustom:!0,render:e=>d(e.CreatedAt)},{label:"标签",prop:"Labels",minWidth:100,showOverflowTooltip:!0,isCustom:!0,render:e=>{if(!e.Labels)return j("span","");return(Object.entries(e.Labels)||[]).map(e=>"".concat(e[0],":").concat(e[1])).join(",")}},v([{onClick:E,title:"删除"}])],extension:[H]});return w(async()=>{J(n,y)}),x(()=>{A.isRefresh=!0,P.value=[]}),(a,t)=>{const s=e;return R(),k(s,{class:""},{"header-left":B(()=>[L("div",M,[N(O(o))])]),"header-right":B(()=>[N(O(b))]),content:B(()=>[N(O(r),{key:"storageTable","max-height":O(n)-220},null,8,["max-height"])]),"footer-left":B(()=>[N(O(f))]),"footer-right":B(()=>[N(O(m))]),popup:B(()=>t[0]||(t[0]=[])),_:1})}}});export{V as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
