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-DnroACXc.js";import{i as v,c as b}from"./app-DckefXYL.js";import{_ as x}from"./app-B1mU36-i.js";import{_ as C}from"./app-MnSDCF4P.js";import{_ as g}from"./app-DPkDcD7h.js";import{_ as k,a as V}from"./app-DntYVxd7.js";import{_ as u}from"./app-BbRQPmFH.js";import{_ as D}from"./app-C2ReBHRb.js";import{_ as d}from"./app-BZyjLC2w.js";import{_ as U}from"./app-COct4tsy.js";import{_ as $}from"./app-Fjja6LBT.js";import{D as L}from"./app-Cx7ENVlu.js";import"./app-C9iVkiu5.js";import"./app-DrIi-dNq.js";import"./app-zueB50zj.js";import"./app-B0NrURRk.js";import"./app-Co2SIBzr.js";import"./app-CUPmXIij.js";import"./app-Cu6FD8m8.js";import"./app-CF0qXH5Q.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-xECxwo4T.js";import"./app-B4bUdtyo.js";import"./app-LqsmzyUT.js";import"./app-kBNY2ZLt.js";import"./app-B8VsrFxM.js";import"./app-B09rlSqG.js";import"./app-z7Z_Uo-k.js";import"./app-35Uyu21k.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};
