import{P as _}from"./app-YXi6Hc2l.js";import{i as f,c as h}from"./app-BT68AfZ-.js";import{_ as P}from"./app-DokSVapq.js";import{_ as x,a as y}from"./app-BHFzVhjx.js";import{_ as g}from"./app-DuUYZNNT.js";import{_ as D}from"./app-CKSEN_Rg.js";import{D as w}from"./app-DNL2FXPk.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-DA7OTM4Q.js";import"./app-BlCBGn5D.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-Dxa5h-uG.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-DSiZNBrr.js";import"./app-BotiHebp.js";import"./app-Zes_jb7S.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};
