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-SC54XQDl.js";import{P as v}from"./app-BGgVpkqZ.js";import{i as w,c as k}from"./app-Ba7ZqSpq.js";import{_ as x}from"./app-DFulsyXy.js";import{_ as g}from"./app-CVQkwzlf.js";import{C as a}from"./app-Ciy_QwIW.js";import{_ as y}from"./app-T1ysvErZ.js";import{_ as V}from"./app-DWUwCFNm.js";import{D as $}from"./app-ZeVDYyDS.js";import"./app-yUrwy8EY.js";import"./app-DnXuoh8P.js";import"./app-DoVkxbmA.js";import"./app-C2mBgI5Z.js";import"./app-CNHjdV6U.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};
