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