import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{_ as a}from"./index99.js?v=1763625242172";import{bU as r,gr as l,dM as t,gs as o,bY as n}from"./page_layout.js?v=1763625242172";import"./public.js?v=1763625242172";import{k as i,P as d,r as u,e as s,R as v,S as p,X as m,a3 as _,U as w,V as c,aj as k,N as b}from"./vue.js?v=1763625242172";import{au as f,dP as x,dV as g,dj as h}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const N={class:"p-20px"},D={class:"w-420px"},y={class:"w-420px"},$={class:"flex"},j={class:"w-150px"},U={class:"w-150px"},E={class:"w-420px"},R={class:"flex"},P={class:"w-150px"},V={class:"w-150px"},C={class:"w-420px"},H=i({__name:"index",setup(i,{expose:H}){const{t:M}=d(),S=r(),X=u(null),Y=u(!1),q=s({name:"",driver:"bridge",options:"",subnet:"",gateway:"",iprange:"",labels:"",subnet_v6:"",gateway_v6:"",remark:""}),z=[{label:"bridge",value:"bridge"},{label:"ipvlan",value:"ipvlan"},{label:"macvlan",value:"macvlan"},{label:"overlay",value:"overlay"}],A=e=>{e||(q.subnet_v6="",q.gateway_v6="")},B={name:{trigger:["blur","input"],validator:()=>""!==q.name.trim()||new Error(M("Docker.Network.form.index_2"))},subnet:{trigger:["blur","input"],validator:()=>""===q.subnet.trim()?new Error(M("Docker.Network.form.index_10")):!!l(q.subnet.trim())||new Error(M("Docker.Network.form.index_11"))},gateway:{trigger:["blur","input"],validator:()=>""===q.gateway.trim()?new Error(M("Docker.Network.form.index_12")):!!t(q.gateway.trim())||new Error(M("Docker.Network.form.index_13"))},iprange:{trigger:["blur","input"],validator:()=>""===q.iprange.trim()?new Error(M("Docker.Network.form.index_14")):!!l(q.iprange.trim())||new Error(M("Docker.Network.form.index_15"))},subnet_v6:{trigger:["blur","input"],validator:()=>""!==q.subnet_v6.trim()||new Error(M("Docker.Network.form.index_19"))},gateway_v6:{trigger:["blur","input"],validator:()=>""!==q.gateway_v6.trim()||new Error(M("Docker.Network.form.index_20"))}};return H({onConfirm:async()=>{var e;await(null==(e=X.value)?void 0:e.validate()),await o(b(q)),S.setRefresh(!0)}}),(r,l)=>{const t=f,o=x,i=g,d=h,u=n,s=a,b=e;return v(),p("div",N,[m(b,{ref_key:"formRef",ref:X,model:c(q),rules:B},{default:_((()=>[m(o,{label:r.$t("Docker.Network.form.index_1"),path:"name"},{default:_((()=>[w("div",D,[m(t,{value:c(q).name,"onUpdate:value":l[0]||(l[0]=e=>c(q).name=e),placeholder:r.$t("Docker.Network.form.index_2")},null,8,["value","placeholder"])])])),_:1},8,["label"]),m(o,{label:r.$t("Docker.Network.form.index_21"),path:"driver"},{default:_((()=>[w("div",y,[m(i,{value:c(q).driver,"onUpdate:value":l[1]||(l[1]=e=>c(q).driver=e),options:z},null,8,["value"])])])),_:1},8,["label"]),w("div",$,[m(o,{label:r.$t("Docker.Network.form.index_3"),path:"subnet"},{default:_((()=>[w("div",j,[m(t,{value:c(q).subnet,"onUpdate:value":l[2]||(l[2]=e=>c(q).subnet=e),placeholder:r.$t("Docker.Network.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),m(o,{label:r.$t("Docker.Network.form.index_5"),path:"gateway","label-width":"120"},{default:_((()=>[w("div",U,[m(t,{value:c(q).gateway,"onUpdate:value":l[3]||(l[3]=e=>c(q).gateway=e),placeholder:r.$t("Docker.Network.form.index_6")},null,8,["value","placeholder"])])])),_:1},8,["label"])]),m(o,{label:r.$t("Docker.Network.form.index_7"),path:"iprange"},{default:_((()=>[w("div",E,[m(t,{value:c(q).iprange,"onUpdate:value":l[4]||(l[4]=e=>c(q).iprange=e),placeholder:r.$t("Docker.Network.form.index_8")},null,8,["value","placeholder"])])])),_:1},8,["label"]),m(o,{label:r.$t("Docker.Network.form.index_16")},{default:_((()=>[m(d,{value:c(Y),"onUpdate:value":[l[5]||(l[5]=e=>k(Y)?Y.value=e:null),A]},null,8,["value"])])),_:1},8,["label"]),m(u,{show:c(Y),"display-directive":"show"},{default:_((()=>[w("div",R,[m(o,{label:r.$t("Docker.Network.form.index_17"),path:"subnet_v6"},{default:_((()=>[w("div",P,[m(t,{value:c(q).subnet_v6,"onUpdate:value":l[6]||(l[6]=e=>c(q).subnet_v6=e),placeholder:r.$t("Docker.Network.form.index_22")},null,8,["value","placeholder"])])])),_:1},8,["label"]),m(o,{label:r.$t("Docker.Network.form.index_18"),path:"gateway_v6","label-width":"120"},{default:_((()=>[w("div",V,[m(t,{value:c(q).gateway_v6,"onUpdate:value":l[7]||(l[7]=e=>c(q).gateway_v6=e),placeholder:r.$t("Docker.Network.form.index_23")},null,8,["value","placeholder"])])])),_:1},8,["label"])])])),_:1},8,["show"]),m(o,{label:r.$t("Docker.Network.form.index_9"),path:"remark","show-feedback":!1},{default:_((()=>[w("div",C,[m(s,{value:c(q).remark,"onUpdate:value":l[8]||(l[8]=e=>c(q).remark=e),rows:3,placeholder:r.$t("Docker.Network.form.index_9")},null,8,["value","placeholder"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{H as default};
