import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{_ as a}from"./index97.js?v=1764830988434";import{bq as r,bu as l,gk as t,gl as o,di as n}from"./page_layout.js?v=1764830988434";import"./public.js?v=1764830988434";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=1764830988434";import{dR as f,au as x,dV as g,dj as h}from"./naive.js?v=1764830988434";import"./common.js?v=1764830988434";import"./__commonjsHelpers__.js?v=1764830988434";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"},V={class:"w-150px"},q={class:"w-150px"},C={class:"w-420px"},H=i({__name:"index",setup(i,{expose:H}){const{t:P}=d(),S=r(),W=u(null),z=u(!1),A=s({name:"",driver:"bridge",options:"",subnet:"",gateway:"",iprange:"",labels:"",subnet_v6:"",gateway_v6:"",remark:""}),B=[{label:"bridge",value:"bridge"},{label:"ipvlan",value:"ipvlan"},{label:"macvlan",value:"macvlan"},{label:"overlay",value:"overlay"}],F=e=>{e||(A.subnet_v6="",A.gateway_v6="")},G={name:{trigger:["blur","input"],validator:()=>""!==A.name.trim()||new Error(P("Docker.Network.form.index_2"))},subnet:{trigger:["blur","input"],validator:()=>""===A.subnet.trim()?new Error(P("Docker.Network.form.index_10")):!!o(A.subnet.trim())||new Error(P("Docker.Network.form.index_11"))},gateway:{trigger:["blur","input"],validator:()=>""===A.gateway.trim()?new Error(P("Docker.Network.form.index_12")):!!n(A.gateway.trim())||new Error(P("Docker.Network.form.index_13"))},iprange:{trigger:["blur","input"],validator:()=>""===A.iprange.trim()?new Error(P("Docker.Network.form.index_14")):!!o(A.iprange.trim())||new Error(P("Docker.Network.form.index_15"))},subnet_v6:{trigger:["blur","input"],validator:()=>""!==A.subnet_v6.trim()||new Error(P("Docker.Network.form.index_19"))},gateway_v6:{trigger:["blur","input"],validator:()=>""!==A.gateway_v6.trim()||new Error(P("Docker.Network.form.index_20"))}};return H({onConfirm:async()=>{var e;await(null==(e=W.value)?void 0:e.validate()),await t(b(A)),S.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:W,model:c(A),rules:G},{default:_(()=>[m(n,{label:r.$t("Docker.Network.form.index_1"),path:"name"},{default:_(()=>[w("div",D,[m(o,{value:c(A).name,"onUpdate:value":t[0]||(t[0]=e=>c(A).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(A).driver,"onUpdate:value":t[1]||(t[1]=e=>c(A).driver=e),options:B},null,8,["value"])])]),_:1},8,["label"]),w("div",$,[m(n,{label:r.$t("Docker.Network.form.index_3"),path:"subnet"},{default:_(()=>[w("div",j,[m(o,{value:c(A).subnet,"onUpdate:value":t[2]||(t[2]=e=>c(A).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",U,[m(o,{value:c(A).gateway,"onUpdate:value":t[3]||(t[3]=e=>c(A).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(A).iprange,"onUpdate:value":t[4]||(t[4]=e=>c(A).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(z),"onUpdate:value":[t[5]||(t[5]=e=>k(z)?z.value=e:null),F]},null,8,["value"])]),_:1},8,["label"]),m(u,{show:c(z),"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(A).subnet_v6,"onUpdate:value":t[6]||(t[6]=e=>c(A).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",q,[m(o,{value:c(A).gateway_v6,"onUpdate:value":t[7]||(t[7]=e=>c(A).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",C,[m(s,{value:c(A).remark,"onUpdate:value":t[8]||(t[8]=e=>c(A).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};
