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