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-BYcXwl4U.js";import{i as v,c as b}from"./app-a6cKceqE.js";import{_ as x}from"./app-CFMgPhMX.js";import{_ as C}from"./app-CQ-vNlMj.js";import{_ as g}from"./app-Ufpj4Ll4.js";import{_ as k,a as V}from"./app-DxbU-QrX.js";import{_ as u}from"./app-DwtlHtUX.js";import{_ as D}from"./app-DT2Zk-qe.js";import{_ as d}from"./app-DKwGUiXR.js";import{_ as U}from"./app-CignoBaV.js";import{_ as $}from"./app-RmBLXaHQ.js";import{D as L}from"./app-7GBSHA5C.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DPDEogA0.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.js";import"./app-ysQ8KbGS.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-BDgR0DSb.js";import"./app-BHl80pFw.js";import"./app-CrjU8lgK.js";import"./app-kBNY2ZLt.js";import"./app-D2Wz0BUQ.js";import"./app-D3zbrzdO.js";import"./app-0YmIdYYs.js";import"./app-Wy4FFEmL.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};
