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