import{P as _}from"./app-Doj30F-n.js";import{i as f,c as h}from"./app-a6cKceqE.js";import{_ as P}from"./app-CQ-vNlMj.js";import{_ as x,a as y}from"./app-DxbU-QrX.js";import{_ as g}from"./app-Ufpj4Ll4.js";import{_ as D}from"./app-CignoBaV.js";import{D as w}from"./app-7GBSHA5C.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-BYcXwl4U.js";import"./app-Ceh-tphd.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-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-CrjU8lgK.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};
