import{r as h,o,g as n,b as l,w as i,u as s,F as f,a as e,D as y,c as p,f as c,t as T,h as m,d as P,e as S}from"./app-SC54XQDl.js";import{i as v,c as b}from"./app-Ba7ZqSpq.js";import{_ as x}from"./app-C3PbGMub.js";import{_ as C}from"./app-DFulsyXy.js";import{_ as g}from"./app-CVQkwzlf.js";import{_ as k,a as V}from"./app-PrSv7rSt.js";import{_ as u}from"./app-FlPLZh9D.js";import{_ as D}from"./app-CowiPMSa.js";import{_ as d}from"./app-BzdF9mA3.js";import{_ as U}from"./app-DWUwCFNm.js";import{_ as $}from"./app-D7BHSP3_.js";import{D as L}from"./app-ZeVDYyDS.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-BjSCO7rC.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-DnXuoh8P.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-CCkWSX4Q.js";import"./app-DZaelcLs.js";import"./app-CNHjdV6U.js";import"./app-kBNY2ZLt.js";import"./app-DoVkxbmA.js";import"./app-C2mBgI5Z.js";import"./app-BxWqoSpr.js";import"./app-COkia88n.js";function w(){v(this),this.serverType=this.serverTypes[0].code,this.enableTCP=!1,this.enableTLS=!1,this.enableUDP=!1,this.family="",this.changeServerType=function(){switch(this.serverType){case"tcpProxy":this.family="tcp",this.enableUDP=!1;break;case"udpProxy":this.family="udp",this.enableTCP=!1,this.enableTLS=!1;break}this.$refs!=null&&this.$refs.originInputBox.changeFamily(this.family)},this.changeServerType(),this.success=this.$NotifySuccess("保存成功","/lb")}const B=e("td",{class:"title"},"网站名称 *",-1),N=e("p",{class:"comment"},"请设置一个容易识别的网站名称。",-1),z=e("td",null,"网站类型 *",-1),F=e("td",null,"监听协议 *",-1),I={key:0,class:"flex items-center"},E={key:1},H=e("td",null,"HTTPS证书 *",-1),R={key:0},j=e("td",null,"TCP监听端口 *",-1),q=e("p",{class:"comment"},"添加服务器监听用户网络连接的端口，需要在1024-65534之间。TCP和TLS端口之间不能重复。",-1),A={key:1},G=e("td",null,"TLS监听端口 *",-1),J=e("p",{class:"comment"},"添加服务器监听用户网络连接的端口，需要在1024-65534之间。TCP和TLS端口之间不能重复。",-1),K={key:2},M=e("td",null,"TCP/TLS监听端口",-1),O=e("td",null,"保存后自动生成",-1),Q=[M,O],W={key:3},X=e("td",null,"UDP监听端口 *",-1),Y=e("p",{class:"comment"},"添加服务器监听用户网络连接的端口，需要在1024-65534之间。",-1),Z={key:4},ee=e("td",null,"UDP监听端口",-1),te=e("td",null,"保存后自动生成",-1),se=[ee,te],oe=e("td",null,"源站信息 *",-1),Re={__name:"create",setup(le){const _=h(),t=b(new w,{refs:{originInputBox:_}});return(ae,r)=>(o(),n(f,null,[l(x,{"active-tab":"create"}),l(C,{onSuccess:s(t).success,action:"$"},{default:i(()=>[l(L,null,{default:i(()=>[e("tbody",null,[e("tr",null,[B,e("td",null,[l(g,{name:"name",maxlength:"50",autofocus:"",class:"w-full"}),N])]),e("tr",null,[z,e("td",null,[l(k,{name:"serverType",modelValue:s(t).serverType,"onUpdate:modelValue":r[0]||(r[0]=a=>s(t).serverType=a),onChange:s(t).changeServerType},{default:i(()=>[(o(!0),n(f,null,y(s(t).serverTypes,a=>(o(),p(V,{value:a.code},{default:i(()=>[c(T(a.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue","onChange"])])]),e("tr",null,[F,e("td",null,[e("div",null,[s(t).serverType=="tcpProxy"?(o(),n("span",I,[(o(),p(u,{name:"protocols",key:"tcp",value:"tcp",modelValue:s(t).enableTCP,"onUpdate:modelValue":r[1]||(r[1]=a=>s(t).enableTCP=a)},{default:i(()=>[c("TCP")]),_:1},8,["modelValue"])),c("       "),(o(),p(u,{name:"protocols",key:"tls",value:"tls",modelValue:s(t).enableTLS,"onUpdate:modelValue":r[2]||(r[2]=a=>s(t).enableTLS=a)},{default:i(()=>[c("TLS")]),_:1},8,["modelValue"]))])):m("",!0),s(t).serverType=="udpProxy"?(o(),n("span",E,[(o(),p(u,{name:"protocols",key:"udp",value:"udp",modelValue:s(t).enableUDP,"onUpdate:modelValue":r[3]||(r[3]=a=>s(t).enableUDP=a)},{default:i(()=>[c("UDP")]),_:1},8,["modelValue"]))])):m("",!0)])])]),P(e("tr",null,[H,e("td",null,[l(D)])],512),[[S,s(t).enableTLS]]),s(t).canSpecifyTCPPort&&s(t).enableTCP?(o(),n("tr",R,[j,e("td",null,[l(d,{size:"5",maxlength:"5",placeholder:"端口",name:"tcpPorts"}),q])])):m("",!0),s(t).canSpecifyTCPPort&&s(t).enableTLS?(o(),n("tr",A,[G,e("td",null,[l(d,{size:"5",maxlength:"5",placeholder:"端口",name:"tlsPorts"}),J])])):m("",!0),!s(t).canSpecifyTCPPort&&s(t).serverType=="tcpProxy"?(o(),n("tr",K,Q)):m("",!0),s(t).canSpecifyUDPPort&&s(t).enableUDP?(o(),n("tr",W,[X,e("td",null,[l(d,{size:"5",maxlength:"5",placeholder:"端口",name:"udpPorts"}),Y])])):m("",!0),!s(t).canSpecifyUDPPort&&s(t).serverType=="udpProxy"?(o(),n("tr",Z,se)):m("",!0),e("tr",null,[oe,e("td",null,[l($,{"v-family":s(t).family,ref_key:"originInputBox",ref:_},null,8,["v-family"])])])])]),_:1}),l(U)]),_:1},8,["onSuccess"])],64))}};export{Re as default};
