import{_ as y}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as $}from"./index-CZps0rIN.js?v=1773287522785";import{bm as E,h6 as U}from"./index-BTglIPU2.js?v=1773287522785";import{f as m,d as R}from"./check-CNel7fTH.js?v=1773287522785";import{k as C,R as I,r as v,e as B,$ as S,Z as V,a0 as o,a9 as l,_ as i,S as t,X as G,N as O}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as X,b as Z,a6 as j,a8 as q,aG as z}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const A={class:"p-20px"},F={class:"w-420px"},H={class:"w-420px"},J={class:"flex"},K={class:"w-150px"},L={class:"w-150px"},M={class:"w-420px"},P={class:"flex"},Q={class:"w-150px"},T={class:"w-150px"},W={class:"w-420px"},se=C({__name:"index",setup(Y,{expose:f}){const{t:s}=I(),w=E(),_=v(null),p=v(!1),e=B({name:"",driver:"bridge",options:"",subnet:"",gateway:"",iprange:"",labels:"",subnet_v6:"",gateway_v6:"",remark:""}),c=[{label:"bridge",value:"bridge"},{label:"ipvlan",value:"ipvlan"},{label:"macvlan",value:"macvlan"},{label:"overlay",value:"overlay"}],k=r=>{r||(e.subnet_v6="",e.gateway_v6="")},b={name:{trigger:["blur","input"],validator:()=>e.name.trim()===""?new Error(s("Docker.Network.form.index_2")):!0},subnet:{trigger:["blur","input"],validator:()=>e.subnet.trim()===""?new Error(s("Docker.Network.form.index_10")):m(e.subnet.trim())?!0:new Error(s("Docker.Network.form.index_11"))},gateway:{trigger:["blur","input"],validator:()=>e.gateway.trim()===""?new Error(s("Docker.Network.form.index_12")):R(e.gateway.trim())?!0:new Error(s("Docker.Network.form.index_13"))},iprange:{trigger:["blur","input"],validator:()=>e.iprange.trim()===""?new Error(s("Docker.Network.form.index_14")):m(e.iprange.trim())?!0:new Error(s("Docker.Network.form.index_15"))},subnet_v6:{trigger:["blur","input"],validator:()=>e.subnet_v6.trim()===""?new Error(s("Docker.Network.form.index_19")):!0},gateway_v6:{trigger:["blur","input"],validator:()=>e.gateway_v6.trim()===""?new Error(s("Docker.Network.form.index_20")):!0}};return f({onConfirm:async()=>{var r;await((r=_.value)==null?void 0:r.validate()),await U(O(e)),w.setRefresh(!0)}}),(r,a)=>{const d=Z,u=X,g=j,N=q,h=z,x=$,D=y;return S(),V("div",A,[o(D,{ref_key:"formRef",ref:_,model:t(e),rules:b},{default:l(()=>[o(u,{label:r.$t("Docker.Network.form.index_1"),path:"name"},{default:l(()=>[i("div",F,[o(d,{value:t(e).name,"onUpdate:value":a[0]||(a[0]=n=>t(e).name=n),placeholder:r.$t("Docker.Network.form.index_2")},null,8,["value","placeholder"])])]),_:1},8,["label"]),o(u,{label:r.$t("Docker.Network.form.index_21"),path:"driver"},{default:l(()=>[i("div",H,[o(g,{value:t(e).driver,"onUpdate:value":a[1]||(a[1]=n=>t(e).driver=n),options:c},null,8,["value"])])]),_:1},8,["label"]),i("div",J,[o(u,{label:r.$t("Docker.Network.form.index_3"),path:"subnet"},{default:l(()=>[i("div",K,[o(d,{value:t(e).subnet,"onUpdate:value":a[2]||(a[2]=n=>t(e).subnet=n),placeholder:r.$t("Docker.Network.form.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"]),o(u,{label:r.$t("Docker.Network.form.index_5"),path:"gateway","label-width":"120"},{default:l(()=>[i("div",L,[o(d,{value:t(e).gateway,"onUpdate:value":a[3]||(a[3]=n=>t(e).gateway=n),placeholder:r.$t("Docker.Network.form.index_6")},null,8,["value","placeholder"])])]),_:1},8,["label"])]),o(u,{label:r.$t("Docker.Network.form.index_7"),path:"iprange"},{default:l(()=>[i("div",M,[o(d,{value:t(e).iprange,"onUpdate:value":a[4]||(a[4]=n=>t(e).iprange=n),placeholder:r.$t("Docker.Network.form.index_8")},null,8,["value","placeholder"])])]),_:1},8,["label"]),o(u,{label:r.$t("Docker.Network.form.index_16")},{default:l(()=>[o(N,{value:t(p),"onUpdate:value":[a[5]||(a[5]=n=>G(p)?p.value=n:null),k]},null,8,["value"])]),_:1},8,["label"]),o(h,{show:t(p),"display-directive":"show"},{default:l(()=>[i("div",P,[o(u,{label:r.$t("Docker.Network.form.index_17"),path:"subnet_v6"},{default:l(()=>[i("div",Q,[o(d,{value:t(e).subnet_v6,"onUpdate:value":a[6]||(a[6]=n=>t(e).subnet_v6=n),placeholder:r.$t("Docker.Network.form.index_22")},null,8,["value","placeholder"])])]),_:1},8,["label"]),o(u,{label:r.$t("Docker.Network.form.index_18"),path:"gateway_v6","label-width":"120"},{default:l(()=>[i("div",T,[o(d,{value:t(e).gateway_v6,"onUpdate:value":a[7]||(a[7]=n=>t(e).gateway_v6=n),placeholder:r.$t("Docker.Network.form.index_23")},null,8,["value","placeholder"])])]),_:1},8,["label"])])]),_:1},8,["show"]),o(u,{label:r.$t("Docker.Network.form.index_9"),path:"remark","show-feedback":!1},{default:l(()=>[i("div",W,[o(x,{value:t(e).remark,"onUpdate:value":a[8]||(a[8]=n=>t(e).remark=n),rows:3,placeholder:r.$t("Docker.Network.form.index_9")},null,8,["value","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{se as default};
