← Back
Editing: index34.js
import{_ as e}from"./index103.js?v=VERSION_NUMBER";import{ay as a,a8 as t,K as s,c7 as i,n as r,L as l,p as o,c8 as n,u as m,aM as c,a6 as u,I as p,bB as d,e as f}from"./utils-lib.js?v=VERSION_NUMBER";import{c as h,a as v,u as _}from"./column.js?v=VERSION_NUMBER";import{k as b,r as g,c as y,w as k,p as x,aD as j,a4 as w,q as R,v as C,e as B,A as L,y as O,x as T}from"./base-lib.js?v=VERSION_NUMBER";import{b as q,N as W,f as A}from"./useMethods.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";const{refs:{customLimit:D,isRefreshWarehouseList:E}}=a(),H=b({isRefresh:!0}),I=g([]),N=[{active:!0,label:"添加仓库",onClick:()=>{r({component:()=>l((()=>import("./index228.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"添加仓库",area:54,btn:"添加"})}},{type:"link",label:"需求反馈",class:"ml-[2rem]",onClick:()=>{W()}}],P=e=>{r({component:()=>l((()=>import("./index228.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),title:"编辑仓库【".concat(e.name,"】"),area:54,btn:"编辑",compData:{row:e}})},J=async e=>{await o({title:"删除仓库【".concat(e.name,"】"),type:"calc",width:"35rem",content:"您真的要删除仓库【".concat(e.name,"】吗?")});const a={id:e.id};s({request:n({data:JSON.stringify(a)}),message:!0,loading:"正在删除...",success:()=>{E.value=!0}})},S=t([{label:"删除项目",value:"delete",event:async(e,a,t,s)=>{const{label:i,value:r}=s,l=async(e,a)=>{const{id:t}=e;if("delete"===r){const e={id:t};return await n({data:JSON.stringify(e)})}};await e({title:"批量".concat(i,"仓库"),content:"批量".concat(i,"已选的仓库,是否继续操作!"),column:[{label:"仓库名",prop:"name"},h()],onConfirm:async()=>(await a(l),E.value=!0,!1)})}}]),M=(e,a)=>{setTimeout((()=>{D.value.storage||((e,a)=>{setTimeout((()=>{e.value>900?a.value.limit=20:a.value.limit=10}),0)})(e,a)}),0)},V={class:"relative"},K={class:"flex items-center"},U=f(y({__name:"index",setup(t){const{refs:{isRefreshWarehouseList:r}}=a(),{mainHeight:l}=m(),{BtOperation:o}=c({options:N});k((()=>r.value),(e=>{e&&(H.isRefresh=!0,g())}));const{BtTable:n,BtPage:f,BtBatch:h,BtColumn:b,refresh:g,param:y}=u({request:e=>(async e=>{if(E.value=!1,!H.isRefresh)return{data:q({limit:e.limit,list:I.value,p:e.p})||[],total:I.value.length};H.isRefresh=!1;const a=await s({request:i(),data:Array});return I.value=a,{data:q({limit:e.limit,list:I.value,p:e.p})||[],total:I.value.length}})(e),columns:[v(),{label:"URL",prop:"url",minWidth:100},{label:"用户",prop:"namespace",minWidth:100,isCustom:!0},{label:"仓库名",prop:"name",minWidth:100,isCustom:!0},A({table:"images",prop:"remark",edit:async e=>{s({request:d({data:JSON.stringify({id:e.id,remark:e.remark})}),message:!0})},noPlace:!0,noCustom:!0,width:200}),_([{onClick:P,isHide:e=>"docker.io"==e.url&&"docker官方库"==e.name&&""==e.username,title:"编辑"},{onClick:J,isHide:e=>"docker.io"==e.url&&"docker官方库"==e.name&&""==e.username,title:"删除"}])],extension:[S]});return x((async()=>{M(l,y)})),j((()=>{p(["/btdocker/registry/registry_list"])})),w((()=>{H.isRefresh=!0,I.value=[]})),(a,t)=>{const s=e;return R(),C("div",V,[B(s,null,{"header-left":L((()=>[O("div",K,[B(T(o))])])),"header-right":L((()=>[B(T(b))])),content:L((()=>[B(T(n),{key:"wareTable","max-height":T(l)-220},null,8,["max-height"])])),"footer-left":L((()=>[B(T(h))])),"footer-right":L((()=>[B(T(f))])),popup:L((()=>t[0]||(t[0]=[]))),_:1})])}}}),[["__scopeId","data-v-7421d1e8"]]);export{U as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel