import{c as e,h as a,r as t,k as l,l as s,e as o,x as r,q as m,p,C as i,D as d,N as n,a7 as u,a4 as c}from"./base-lib.js?v=1761009159";import{I as f,a6 as h,j as b,b as g,e as _}from"./utils-lib.js?v=1761009159";import{B as j}from"./index199.js?v=1761009159";import{_ as v}from"./index101.js?v=1761009159";import{g as x,bi as y}from"./useStore4.js?v=1761009159";import{f as V}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./ace.js?v=1761009159";import"./index104.js?v=1761009159";import"./column.js?v=1761009159";const w={class:"flex flex-col p-[1.6rem] lib-box"},k={class:"flex items-center"},C={class:"w-[35rem] h-[29.3rem] ml-[10rem] mb-[1.5rem]"},U=_(e({__name:"create-mirror-dialog",props:{compData:{default:()=>({})}},emits:["close"],setup(e,{expose:_,emit:U}){const D=g(),I=U,{refs:{isRefreshTableList:S}}=x(),q=a({type:"path",path:"",data:"",tag:""}),N=t(),R={},z=[{label:"路径",value:"path"},{label:"内容",value:"data"}],B=()=>{V({type:"file",change:e=>{q.path=e}})};return _({onConfirm:async()=>{const e="data"===q.type;if(""===(e?q.data:q.path))return void D.error(e?"请输入内容":"请选择路径");const a=e?{data:q.data,tag:q.tag}:{path:q.path,tag:q.tag};await f({request:y({data:JSON.stringify(a)}),message:!0,success:({status:e})=>{e&&(I("close"),S.value=!0)}})}}),(e,a)=>{const t=h,f=v,g=u,_=j,x=b,y=c;return l(),s("div",w,[o(y,{ref_key:"cmdFormRef",ref:N,size:"default",model:p(q),rules:R,class:"relative w-full","label-position":"right",onSubmit:a[5]||(a[5]=n((()=>{}),["prevent"]))},{default:r((()=>[o(g,{prop:"path",style:{"margin-bottom":"1.5rem"},label:"Dockerfile"},{default:r((()=>[m("div",k,[o(t,{modelValue:p(q).type,"onUpdate:modelValue":a[0]||(a[0]=e=>p(q).type=e),options:z,class:"!w-[10rem]"},null,8,["modelValue"]),i(o(f,{modelValue:p(q).path,"onUpdate:modelValue":a[1]||(a[1]=e=>p(q).path=e),class:"w-[24rem] ml-[.5rem]",icon:"icon-file_mode",onIconClick:B,onChangePassive:a[2]||(a[2]=e=>{q.path=q.path.replace(/\s+/g,"")}),placeholder:"请输入或选择dockerfile文件"},null,8,["modelValue"]),[[d,"path"==p(q).type]])])])),_:1}),i(m("div",C,[o(_,{modelValue:p(q).data,"onUpdate:modelValue":a[3]||(a[3]=e=>p(q).data=e)},null,8,["modelValue"])],512),[[d,"data"==p(q).type]]),o(g,{prop:"path",label:"标签"},{default:r((()=>[o(x,{modelValue:p(q).tag,"onUpdate:modelValue":a[4]||(a[4]=e=>p(q).tag=e),type:"textarea",width:"35rem",placeholder:"请输入镜像名，例如：btnginx:1.24"},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])])}}}),[["__scopeId","data-v-9982db69"]]);export{U as default};
