import{_ as e}from"./wsl.js?v=20260328163632";import{l as a,t as l,x as s}from"./utils-lib.js?v=20260328163632";import{g as r}from"./index194.js?v=20260328163632";import{u as t}from"./index50.js?v=20260328163632";import{k as i,r as n,c as o,o as p,V as u,_ as c,Y as d}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./index92.js?v=20260328163632";import"./index97.js?v=20260328163632";const m=i({__name:"index",setup(i,{expose:m}){const{sid:v}=t(),b={labelStyle:"min-width: 100px"},y=n({formAttrs:{labelWidth:"auto"},formItems:[]}),h=n({label:a("网络名称"),attrs:b,ruleKey:"network_name",rules:[{required:!0,message:a("请输入网络名称"),trigger:["blur","change"]}],children:[{key:"network_name",type:"input",attrs:{class:"!w-[320px]",placeholder:a("请输入网络名称")}}]}),g=o((()=>({label:a("驱动名"),attrs:b,ruleKey:"driver",rules:[{required:!0,message:a("请选择驱动名"),trigger:["blur","change"]}],children:[{key:"driver",type:"select",attrs:{placeholder:a("请选择驱动名"),class:"!w-[320px]",options:[{label:"bridge",value:"bridge"},{label:"host",value:"host"},{label:"overlay",value:"overlay"},{label:"macvlan",value:"macvlan"}]}}]}))),x=n({label:a("启用IPv6"),attrs:b,children:[{key:"enable_ipv6",type:"switch"}]}),w=n({label:a("内部网络"),attrs:b,children:[{key:"internal",type:"switch"}]}),j=n({label:"IPV4"+a("子网"),attrs:b,children:[{key:"subnet",type:"input",attrs:{class:"!w-[320px]",placeholder:a("请输入IPV4子网，如：192.168.0.0/16")}}]}),_=n({label:"IPV4"+a("网关"),attrs:b,children:[{key:"gateway",type:"input",attrs:{class:"!w-[320px]",placeholder:a("请输入IPV4网关，如：192.168.0.1")}}]}),f=n({label:a("IP范围"),attrs:b,children:[{key:"ip_range",type:"input",attrs:{class:"!w-[320px]",placeholder:a("请输入IP范围，如：192.168.0.0/24")}}]}),k=o((()=>(y.value.formItems=[h.value,g.value,x.value,w.value,j.value,_.value,f.value],y.value))),[I,P,V]=l(k);return p((()=>{P.value.driver="bridge"})),m({onConfirm:async()=>{var l;try{await(null==(l=V.value)?void 0:l.validate());return(await s({loading:a("正在创建网络，请稍后..."),request:e({...P.value,sid:v.value}),message:!0,success:e=>{r()}})).status}catch(t){}}}),(e,a)=>(u(),c(d(I),{class:"p-20px"}))}});export{m as default};
