← Back
Editing: index33.js
import{_ as e}from"./index103.js?v=VERSION_NUMBER";import{ay as a,a8 as t,K as s,c4 as i,p as l,c5 as n,n as o,L as r,c6 as m,u as c,aM as u,a6 as p,R as d}from"./utils-lib.js?v=VERSION_NUMBER";import{c as f,a as h,u as v}from"./column.js?v=VERSION_NUMBER";import{k as b,r as g,c as y,w as C,e as _,aQ as N,aB as j,p as w,a4 as x,q as R,M as k,A as L,y as B,x as O}from"./base-lib.js?v=VERSION_NUMBER";import{b as T,N as W}from"./useMethods.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";const{refs:{customLimit:q,isRefreshStorageList:A}}=a(),M=b({isRefresh:!0}),S=g([]),D=[{active:!0,label:"添加存储卷",onClick:()=>{o({component:()=>r((()=>import("./index227.js?v=VERSION_NUMBER")),__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:()=>{A.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:()=>{A.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),A.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)},P={class:"flex items-center"},I=y({__name:"index",setup(t){const{refs:{isRefreshStorageList:l}}=a(),{mainHeight:n}=c(),{BtOperation:o}=u({options:D});C((()=>l.value),(e=>{e&&(M.isRefresh=!0,g())}));const{BtTable:r,BtPage:m,BtBatch:f,BtColumn:b,refresh:g,param:y}=p({request:e=>(async e=>{if(A.value=!1,!M.isRefresh)return{data:T({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length};M.isRefresh=!1;const a=await s({request:i(),data:Array});return S.value=a,{data:T({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length}})(e),columns:[h({key:"Name"}),{label:"存储卷",prop:"Name",minWidth:100,render:e=>_(N,{placement:"top"},{default:()=>_("div",null,[e.Name]),content:()=>_("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((()=>{M.isRefresh=!0,S.value=[]})),(a,t)=>{const s=e;return R(),k(s,{class:""},{"header-left":L((()=>[B("div",P,[_(O(o))])])),"header-right":L((()=>[_(O(b))])),content:L((()=>[_(O(r),{key:"storageTable","max-height":O(n)-220},null,8,["max-height"])])),"footer-left":L((()=>[_(O(f))])),"footer-right":L((()=>[_(O(m))])),popup:L((()=>t[0]||(t[0]=[]))),_:1})}}});export{I as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel