import{r as _,o as n,c as N,w as o,u as l,g as m,h as u,b as t,a as r,f as e,i as h}from"./app-DnroACXc.js";import{P as v}from"./app-CyTk3GnO.js";import{i as w,c as k}from"./app-DckefXYL.js";import{_ as x}from"./app-MnSDCF4P.js";import{_ as g}from"./app-DPkDcD7h.js";import{C as a}from"./app-Do8DhyKT.js";import{_ as y}from"./app-DFWP-E91.js";import{_ as V}from"./app-COct4tsy.js";import{D as $}from"./app-Cx7ENVlu.js";import"./app-CUqfl6on.js";import"./app-CF0qXH5Q.js";import"./app-B8VsrFxM.js";import"./app-B09rlSqG.js";import"./app-LqsmzyUT.js";function S(){w(this),this.success=this.$NotifyPopup,this.isUpdating=!1,this.mode="single",this.serverName={name:"",subNames:[]},this.multipleServerNames="",window.parent.UPDATING_SERVER_NAME!=null&&(this.isUpdating=!0,this.serverName=window.parent.UPDATING_SERVER_NAME,this.serverName.subNames!=null&&this.serverName.subNames.length>0&&(this.mode="multiple",this.multipleServerNames=this.serverName.subNames.join(`
`))),this.switchMode=function(p){this.mode=p,this.$delay(function(){p=="single"?this.$refs.serverName.focus():this.$refs.serverNames.focus()})}}const b={key:0},C={key:1},U=["value"],E={key:0},M=r("td",{class:"title"},"单个域名 *",-1),P={class:"comment"},R=r("strong",null,"不要",-1),A={key:1},B=r("td",{class:"title"},"多个域名 *",-1),D={class:"comment"},T=r("strong",null,"不要",-1),Z={__name:"addServerNamePopup",setup(p){const c=_(),f=_(),s=k(new S,{refs:{serverName:c,serverNames:f}});return(G,i)=>(n(),N(v,null,{default:o(()=>[l(s).isUpdating?u("",!0):(n(),m("header",b,"添加域名绑定")),l(s).isUpdating?(n(),m("header",C,"修改域名绑定")):u("",!0),t(x,{action:"$",onSuccess:l(s).success},{default:o(()=>[r("input",{type:"hidden",name:"mode",value:l(s).mode},null,8,U),t($,null,{default:o(()=>[r("tbody",null,[l(s).mode=="single"?(n(),m("tr",E,[M,r("td",null,[t(g,{name:"serverName",ref_key:"serverName",ref:c,autofocus:"",maxlength:"100",modelValue:l(s).serverName.name,"onUpdate:modelValue":i[0]||(i[0]=d=>l(s).serverName.name=d),class:"w-full"},null,8,["modelValue"]),r("p",P,[e("请输入单个域名，比如 "),t(a,null,{default:o(()=>[e("example.com")]),_:1}),e(" 、 "),t(a,null,{default:o(()=>[e("www.example.com")]),_:1}),e(" ，"),R,e("包含 "),t(a,null,{default:o(()=>[e("http://")]),_:1}),e(" 或 "),t(a,null,{default:o(()=>[e("https://")]),_:1}),e(" 或端口号；也可以使用泛域名，比如 "),t(a,null,{default:o(()=>[e("*.example.com")]),_:1}),e(" 。 ")])])])):u("",!0),l(s).mode=="multiple"?(n(),m("tr",A,[B,r("td",null,[t(y,{name:"serverNames",ref_key:"serverNames",ref:f,modelValue:l(s).multipleServerNames,"onUpdate:modelValue":i[1]||(i[1]=d=>l(s).multipleServerNames=d),class:"w-full",rows:"5"},null,8,["modelValue"]),r("p",D,[e("每行一个域名，比如 "),t(a,null,{default:o(()=>[e("example.com")]),_:1}),e(" 、 "),t(a,null,{default:o(()=>[e("www.example.com")]),_:1}),e(" ，"),T,e("包含 "),t(a,null,{default:o(()=>[e("http://")]),_:1}),e(" 或 "),t(a,null,{default:o(()=>[e("https://")]),_:1}),e(" 或端口号；也可以使用泛域名，比如 "),t(a,null,{default:o(()=>[e("*.example.com")]),_:1}),e(" 。 ")])])])):u("",!0)])]),_:1}),t(V),e("   "),l(s).mode=="single"?(n(),m("a",{key:0,href:"",class:"link",onClick:i[2]||(i[2]=h(d=>l(s).switchMode("multiple"),["prevent"]))},"批量添加")):u("",!0),l(s).mode=="multiple"?(n(),m("a",{key:1,href:"",onClick:i[3]||(i[3]=h(d=>l(s).switchMode("single"),["prevent"])),class:"link"},"单个添加")):u("",!0)]),_:1},8,["onSuccess"])]),_:1}))}};export{Z as default};
