import{_ as R}from"./index-BRQskX9P.js?v=1773287522785";import{_ as U}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{k as x,R as D,r as f,e as L,$ as b,Z as C,a0 as a,a9 as c,_ as u,S as n,l as S,v as z,x as B,X as E}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{m as N,p as M}from"./index-BTglIPU2.js?v=1773287522785";import $ from"./index-Cy3Gp9Hk.js?v=1773287522785";import{_ as V}from"./index-BDlR_GtR.js?v=1773287522785";import{a1 as j,b as A,al as I}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{_ as J}from"./index.vue_vue_type_script_setup_true_lang-CSTYW8Te.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./theme-monokai-Bqt0uTuQ.js?v=1773287522785";import"./ace-CNnfDSio.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";import"./file-B5PwfK2h.js?v=1773287522785";import"./index-CZps0rIN.js?v=1773287522785";const O={class:"w-420px"},P={class:"w-420px"},X={class:"w-420px"},Z={class:"w-420px"},q={class:"w-420px"},F=x({__name:"index",props:{send:{},refresh:{}},setup(d,{expose:_}){const m=d,{t:l}=D(),p=f(null),e=L({name:"",data:"",env:"",save:!1,template:"",remark:""}),v={name:{trigger:["input","blur"],validator:()=>e.name?!0:new Error(l("Docker.ComposeNew.index_43"))}},g=()=>({mod_name:"docker",sub_mod_name:"com",def_name:"create",ws_callback:"create",project_name:e.name,config:e.data,env:e.env,remark:e.remark,add_template:e.save?1:0,...e.save?{template_name:e.template}:{}}),k=t=>{const o=f("");m.send(g(),{action:"create",callback:(w,r)=>{t();const i=JSON.parse(r.data);o.value+=i.msg,i.data===-1&&(i.status?(m.refresh(),N.success(i.msg)):N.error(i.msg))}}),M({title:l("Docker.ComposeNew.index_50"),width:640,content:()=>a(V,{class:"h-440px",lang:"log","pre-style":{fontSize:"12px"},content:o.value},null)})};return _({onConfirm:async({hide:t})=>{var o;return await((o=p.value)==null?void 0:o.validate()),k(t),!1}}),(t,o)=>{const w=A,r=j,i=I,y=U;return b(),C("div",null,[a(y,{ref_key:"formRef",ref:p,model:n(e),rules:v},{default:c(()=>[a(r,{label:t.$t("Docker.ComposeNew.index_42"),path:"name"},{default:c(()=>[u("div",O,[a(w,{value:n(e).name,"onUpdate:value":o[0]||(o[0]=s=>n(e).name=s),placeholder:t.$t("Docker.ComposeNew.index_43")},null,8,["value","placeholder"])])]),_:1},8,["label"]),a(r,{label:t.$t("Docker.ComposeNew.index_44"),path:"data"},{default:c(()=>[u("div",P,[a($,{value:n(e).data,"onUpdate:value":o[1]||(o[1]=s=>n(e).data=s),lang:"yaml",height:"240","show-tips":!1},null,8,["value"])])]),_:1},8,["label"]),a(r,{label:t.$t("Docker.ComposeNew.index_45")},{default:c(()=>[u("div",X,[a($,{value:n(e).env,"onUpdate:value":o[2]||(o[2]=s=>n(e).env=s),height:"120","show-tips":!1},null,8,["value"])])]),_:1},8,["label"]),a(r,{label:t.$t("Docker.ComposeNew.index_46")},{default:c(()=>[a(i,{checked:n(e).save,"onUpdate:checked":o[3]||(o[3]=s=>n(e).save=s)},null,8,["checked"])]),_:1},8,["label"]),S(a(r,{label:t.$t("Docker.ComposeNew.index_47"),path:"name"},{default:c(()=>[u("div",Z,[a(w,{value:n(e).template,"onUpdate:value":o[4]||(o[4]=s=>n(e).template=s),placeholder:t.$t("Docker.ComposeNew.index_48")},null,8,["value","placeholder"])])]),_:1},8,["label"]),[[z,n(e).save]]),a(r,{label:t.$t("Docker.ComposeNew.index_49"),path:"remark"},{default:c(()=>[u("div",q,[a(w,{checked:n(e).remark,"onUpdate:checked":o[5]||(o[5]=s=>n(e).remark=s),placeholder:t.$t("Docker.ComposeNew.index_49")},null,8,["checked","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),G=x({__name:"index",props:{refresh:{}},setup(d,{expose:_}){const m=d,l=f();return _({onConfirm:async()=>{await l.value.onConfirm(),m.refresh()}}),(e,v)=>(b(),C("div",null,[a(J,{ref_key:"formRef",ref:l,class:"pt-0px"},null,512)]))}}),H={class:"p-16px"},pe=x({__name:"index",props:{send:{},refresh:{}},setup(d,{expose:_}){const m=d,{t:l}=D(),p=f("common"),e=f(),v=B([{key:"common",label:l("Docker.ComposeNew.index_40"),isLazy:!0,data:m,component:F},{key:"template",label:l("Docker.ComposeNew.index_41"),isLazy:!0,data:m,component:G}]);return _({onConfirm:async k=>{await e.value.onConfirm(k)}}),(k,h)=>{const t=R;return b(),C("div",H,[a(t,{ref_key:"tabsRef",ref:e,value:n(p),"onUpdate:value":h[0]||(h[0]=o=>E(p)?p.value=o:null),class:"max-h-640px",options:n(v)},null,8,["value","options"])])}}});export{pe as default};
