import{c as e,r as a,o as l,V as s,q as t,v as o,x as r,e as m,B as p,y as d,Q as u,z as i,I as n,J as c,C as h,R as f,ab as g,U as V,ae as y,G as b,a9 as _}from"./base-lib.js?v=1761009159";import{_ as v}from"./index103.js?v=1761009159";import{aP as x,P as w,cq as U,jF as j,ag as C,k as E,ax as k,_ as q}from"./utils-lib.js?v=1761009159";import{f as I}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const D={class:"container-dialog"},P={class:"flex items-center"},z={class:"mt-[2.4rem]"},F={class:"flex items-center"},J=q(e({__name:"container-mirror",props:{compData:{default:()=>({})}},setup(e){const{refs:{currentConDetail:q},getCurrentCon:J}=x(),R=e,S=a("easy"),A=[{label:"简单模式",value:"easy"},{label:"高级模式",value:"more"}],B=l({repository:"",tag:"latest",stash:"official",message:"",author:"",isExport:[],path:"",name:""}),G=s([]),H=a(),N={repository:[{required:!0,trigger:["blur","change"],message:"请输入镜像名"}]},O=()=>{I({type:"dir",change:e=>{B.path=e}})},Q=async()=>{await H.value.validate();const e={id:R.compData.row.id,repository:B.repository,tag:B.tag};"more"==S.value&&(e.message=B.message,e.author=B.author,e.repository="".concat(""!=B.stash?B.stash+"/":"").concat(B.repository),B.isExport.length>0&&(e.path=B.path,e.name=B.name)),w({request:j({data:JSON.stringify(e)}),message:!0,success:async e=>{e.status&&(await J(q.value.Id),S.value="easy",K())}})},K=()=>{B.repository="",B.tag="latest",B.stash="official",B.message="",B.author="",B.isExport=[],B.path="",B.name="",H.value.clearValidate()};return t(async()=>{await w({request:U(),data:Array,success:e=>{G.value=e.map(e=>({label:e.name,value:"docker.io"===e.url?"official":e.namespace}))}})}),(e,a)=>{const l=C,s=g,t=E,x=k,w=V,U=y,j=v,q=b,I=_;return o(),r("div",D,[m(I,{ref_key:"cmdFormRef",ref:H,model:d(B),rules:N,"label-position":"right",onSubmit:a[10]||(a[10]=f(()=>{},["prevent"]))},{default:p(()=>[m(s,{style:{"margin-bottom":"1.5rem"},label:"创建方式"},{default:p(()=>[m(l,{type:"button",modelValue:d(S),"onUpdate:modelValue":a[0]||(a[0]=e=>u(S)?S.value=e:null),options:A},null,8,["modelValue"])]),_:1}),m(s,{prop:"repository",style:{"margin-bottom":"1.5rem"},label:"镜像名"},{default:p(()=>[m(t,{modelValue:d(B).repository,"onUpdate:modelValue":a[1]||(a[1]=e=>d(B).repository=e),width:"24rem",placeholder:"请输入镜像名"},null,8,["modelValue"])]),_:1}),m(s,{prop:"path",label:"版本号",display:"flex"},{default:p(()=>[i("div",P,[m(t,{modelValue:d(B).tag,"onUpdate:modelValue":a[2]||(a[2]=e=>d(B).tag=e),width:"24rem",placeholder:"请输入版本号"},null,8,["modelValue"]),a[11]||(a[11]=i("span",{class:"ml-[1rem] text-secondary text-small whitespace-nowrap"},"默认：latest",-1))])]),_:1}),n(i("div",null,[m(s,{prop:"path",label:"仓库地址"},{default:p(()=>[m(x,{modelValue:d(B).stash,"onUpdate:modelValue":a[3]||(a[3]=e=>d(B).stash=e),options:d(G),class:"!w-[24rem]",placeholder:"请选择仓库地址"},null,8,["modelValue","options"])]),_:1}),m(s,{prop:"path",label:"描述"},{default:p(()=>[m(t,{modelValue:d(B).message,"onUpdate:modelValue":a[4]||(a[4]=e=>d(B).message=e),width:"24rem",placeholder:"描述"},null,8,["modelValue"])]),_:1}),m(s,{prop:"path",label:"作者"},{default:p(()=>[m(t,{modelValue:d(B).author,"onUpdate:modelValue":a[5]||(a[5]=e=>d(B).author=e),width:"24rem",placeholder:"作者"},null,8,["modelValue"])]),_:1}),i("div",z,[m(U,{modelValue:d(B).isExport,"onUpdate:modelValue":a[6]||(a[6]=e=>d(B).isExport=e),class:"mb-[2rem] ml-[10rem]"},{default:p(()=>[m(w,{size:"default",label:"生成镜像并导出压缩包",value:"生成镜像并导出压缩包"})]),_:1},8,["modelValue"]),n(m(s,{label:" "},{default:p(()=>[m(j,{modelValue:d(B).path,"onUpdate:modelValue":a[7]||(a[7]=e=>d(B).path=e),class:"!w-[24rem]",icon:"el-folder-opened",onIconClick:O,onChangePassive:a[8]||(a[8]=e=>{B.path=B.path.replace(/\s+/g,"")}),placeholder:"请输入镜像路径"},null,8,["modelValue"])]),_:1},512),[[c,d(B).isExport.length>0]]),n(m(s,{prop:"path",label:"文件名"},{default:p(()=>[i("div",F,[m(t,{modelValue:d(B).name,"onUpdate:modelValue":a[9]||(a[9]=e=>d(B).name=e),width:"24rem",placeholder:"文件名"},null,8,["modelValue"]),a[12]||(a[12]=i("span",{class:"ml-[1rem]"},".tar",-1))])]),_:1},512),[[c,d(B).isExport.length>0]])])],512),[[c,"more"==d(S)]]),m(q,{type:"primary",class:"ml-[10rem]",onClick:Q},{default:p(()=>a[13]||(a[13]=[h("生成镜像",-1)])),_:1,__:[13]})]),_:1},8,["model"])])}}}),[["__scopeId","data-v-db198e42"]]);export{J as default};
