import{aP as a,P as e,cq as s,M as r,iE as l,K as t,_ as o}from"./utils-lib.js?v=1761009159";import{r as u,c as n,aA as i,g as m,q as c,a6 as d,v as p,x as v,e as f,y as g}from"./base-lib.js?v=1761009159";import{j as b,b as _}from"./form-item.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const{refs:{isRefreshTableList:h}}=a(),x=u([]),j=()=>{x.value=[]},y={class:"flex flex-col p-[1.6rem] lib-box"},k=o(n({__name:"index",props:{compData:{default:()=>({})}},setup(a,{expose:o}){const u=a,n=i("popupClose",()=>{}),{BtForm:k,submit:q,param:w}=t({data:()=>{var a;return{tag:"",name:"",id:(null==(a=u.compData.row)?void 0:a.id)||"",loading:!1}},options:()=>m(()=>[b("仓库名","name",x.value,{attrs:{class:"!w-[24rem]",placeholder:"请选择仓库名"},rules:[{required:!0,message:"请选择仓库名",trigger:"change"}]}),_("标签","tag",{attrs:{placeholder:"请输入版本，如：btphp_1.1",class:"!w-[24rem]"},rules:[{required:!0,message:"请输入版本，如：btphp_1.1",trigger:"blur"}]})]),submit:async(a,s,r)=>{await s(),(async(a,s)=>{let r={tag:a.value.tag,id:a.value.id,name:x.value.find(e=>e.url==a.value.name).name,url:x.value.find(e=>e.url==a.value.name).url};e({request:l({data:JSON.stringify(r)}),message:!0,success:({status:a})=>{a&&(h.value=!0,j(),s())}})})(a,n)}});return c(async()=>{(async(a,l)=>{e({request:s(),data:Array,success:e=>{var s;if(1===e.length){const a=e[0];"docker.io"==a.url&&"docker官方库"==a.name&&""==a.username&&(r.error("docker官方库不支持推送镜像"),l())}e.forEach(a=>{"docker.io"==a.url&&"docker官方库"==a.name&&""==a.username||x.value.push({value:a.url,label:"".concat(a.name).concat("docker.io"===a.url?"":"(".concat(a.url,")")),url:a.url,name:a.name})}),a.value.name=(null==(s=x.value[0])?void 0:s.value)||""}})})(w,n)}),d(()=>{j()}),o({onConfirm:q}),(a,e)=>(p(),v("div",y,[f(g(k))]))}}),[["__scopeId","data-v-70f02c15"]]);export{k as default};
