import{P as _}from"./app-BGgVpkqZ.js";import{i as f,c as h}from"./app-Ba7ZqSpq.js";import{_ as P}from"./app-DFulsyXy.js";import{_ as x,a as y}from"./app-PrSv7rSt.js";import{_ as g}from"./app-CVQkwzlf.js";import{_ as D}from"./app-DWUwCFNm.js";import{D as w}from"./app-ZeVDYyDS.js";import{o as a,c as p,w as r,u as e,g as l,h as d,b as i,a as o,D as v,f as c,t as m,F as N}from"./app-SC54XQDl.js";import"./app-yUrwy8EY.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-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-CNHjdV6U.js";function T(){if(f(this),this.success=this.$NotifyPopup,this.isUpdating=!1,this.address="",this.protocol=this.protocols[0].code,window.parent.UPDATING_ADDR!=null){this.isUpdating=!0;let s=window.parent.UPDATING_ADDR;this.protocol=s.protocol,s.host.length==0?this.address=s.portRange:this.address=s.host.quoteIP()+":"+s.portRange}}const U={key:0},V={key:1},$=["value"],k=["value"],C=o("td",null,"网络协议",-1),R=o("td",{class:"title"},"端口 *",-1),A={class:"comment"},B={key:0},Z={__name:"addPortPopup",setup(s){const t=h(new T);return(S,u)=>(a(),p(_,null,{default:r(()=>[e(t).isUpdating?d("",!0):(a(),l("header",U,"添加端口绑定")),e(t).isUpdating?(a(),l("header",V,"修改端口绑定")):d("",!0),i(P,{action:"$",onSuccess:e(t).success},{default:r(()=>[o("input",{type:"hidden",name:"minPort",value:e(t).minPort},null,8,$),o("input",{type:"hidden",name:"maxPort",value:e(t).maxPort},null,8,k),i(w,null,{default:r(()=>[o("tbody",null,[o("tr",null,[C,o("td",null,[i(x,{name:"protocol"},{default:r(()=>[(a(!0),l(N,null,v(e(t).protocols,n=>(a(),p(y,{value:n.code},{default:r(()=>[c(m(n.name),1)]),_:2},1032,["value"]))),256))]),_:1})])]),o("tr",null,[R,o("td",null,[i(g,{name:"address",autofocus:"",modelValue:e(t).address,"onUpdate:modelValue":u[0]||(u[0]=n=>e(t).address=n),maxlength:"5",style:{width:"5.2em"}},null,8,["modelValue"]),o("p",A,[c("需要在"+m(e(t).minPort)+"-"+m(e(t).maxPort)+"之间。",1),e(t).serverType=="tcpProxy"?(a(),l("span",B,"TCP和TLS端口之间不能重复。")):d("",!0)])])])])]),_:1}),i(D)]),_:1},8,["onSuccess"])]),_:1}))}};export{Z as default};
