import{i as N,c as U}from"./app-Ba7ZqSpq.js";import{_ as A}from"./app-DhIf-bPn.js";import{_ as D}from"./app-DWUwCFNm.js";import{_ as k}from"./app-DFulsyXy.js";import{W as b}from"./app-B9xxzP2y.js";import{r as p,J as g,o as r,g as c,a as e,u as n,b as s,w as i,d as C,bb as S,f as _,t as w,e as I,c as $,h as O,F as T}from"./app-SC54XQDl.js";import{_ as V}from"./app-CVQkwzlf.js";import{T as v,a as x}from"./app-nyOoGAKT.js";import{_ as B}from"./app-FlPLZh9D.js";import{D as R}from"./app-ZeVDYyDS.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-BjSCO7rC.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-CNHjdV6U.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app-PPG0ZS4d.js";import"./app--Lj8zATS.js";import"./app-Ch8j4za4.js";import"./app-C2mBgI5Z.js";import"./app-DnXuoh8P.js";import"./app-DZaelcLs.js";function J(){N(this),this.success=this.$NotifyReloadSuccess("保存成功")}const F=["value"],G=e("td",{class:"title"},"启用健康检查",-1),H=e("p",{class:"comment"},"选中后，表示启用当前域名下A/AAAA记录的健康检查；启用此设置后，你仍需设置单个A/AAAA记录的健康检查。",-1),W=e("td",null,"默认检测端口",-1),E=e("p",{class:"comment"},"通过尝试连接A/AAAA记录中的IP加此端口来确定当前记录是否健康。",-1),M=e("td",null,"默认超时时间",-1),P=e("span",null,"秒",-1),j=e("td",null,"默认连续上线次数",-1),q=e("span",null,"次",-1),z={class:"comment"},K={key:0},L={key:1},Q=e("td",null,"默认连续下线次数",-1),X=e("span",null,"次",-1),Y={class:"comment"},Z={key:0},tt={key:1},et={__name:"NSRecordsHealthCheckConfigBox",props:["modelValue"],setup(y){const u=y,{config:o,portString:d,timeoutSecondsString:m,countUpString:f,countDownString:h}=function(){let l=u.modelValue;return l==null&&(l={isOn:!1,port:80,timeoutSeconds:5,countUp:1,countDown:3}),{config:p(l),portString:p(l.port.toString()),timeoutSecondsString:p(l.timeoutSeconds.toString()),countUpString:p(l.countUp.toString()),countDownString:p(l.countDown.toString())}}();return g(d,function(l){let t=parseInt(l.toString());isNaN(t)||t>65535||t<1?o.value.port=80:o.value.port=t}),g(m,function(l){let t=parseInt(l.toString());isNaN(t)||t>1e3||t<1?o.value.timeoutSeconds=5:o.value.timeoutSeconds=t}),g(f,function(l){let t=parseInt(l.toString());isNaN(t)||t>1e3||t<1?o.value.countUp=1:o.value.countUp=t}),g(h,function(l){let t=parseInt(l.toString());isNaN(t)||t>1e3||t<1?o.value.countDown=3:o.value.countDown=t}),(l,t)=>(r(),c("div",null,[e("input",{type:"hidden",name:"recordsHealthCheckJSON",value:JSON.stringify(n(o))},null,8,F),s(R,null,{default:i(()=>[e("tbody",null,[e("tr",null,[G,e("td",null,[s(B,{modelValue:n(o).isOn,"onUpdate:modelValue":t[0]||(t[0]=a=>n(o).isOn=a)},null,8,["modelValue"]),H])])]),C(e("tbody",null,[e("tr",null,[W,e("td",null,[s(V,{type:"text",modelValue:n(d),"onUpdate:modelValue":t[1]||(t[1]=a=>S(d)?d.value=a:null),maxlength:"5",style:{width:"5em"}},null,8,["modelValue"]),E])]),e("tr",null,[M,e("td",null,[s(v,null,{default:i(()=>[s(V,{type:"text",style:{width:"4em"},modelValue:n(m),"onUpdate:modelValue":t[2]||(t[2]=a=>S(m)?m.value=a:null),maxlength:"3"},null,8,["modelValue"]),s(x,null,{default:i(()=>[P]),_:1})]),_:1})])]),e("tr",null,[j,e("td",null,[s(v,null,{default:i(()=>[s(V,{type:"text",style:{width:"4em"},modelValue:n(f),"onUpdate:modelValue":t[3]||(t[3]=a=>S(f)?f.value=a:null),maxlength:"3"},null,8,["modelValue"]),s(x,null,{default:i(()=>[q]),_:1})]),_:1}),e("p",z,[_("连续检测"),n(o).countUp>0?(r(),c("span",K,w(n(o).countUp),1)):(r(),c("span",L,"N")),_("次成功后，认为当前记录是在线的。 ")])])]),e("tr",null,[Q,e("td",null,[s(v,null,{default:i(()=>[s(V,{type:"text",style:{width:"4em"},modelValue:n(h),"onUpdate:modelValue":t[4]||(t[4]=a=>S(h)?h.value=a:null),maxlength:"3"},null,8,["modelValue"]),s(x,null,{default:i(()=>[X]),_:1})]),_:1}),e("p",Y,[_("连续检测"),n(o).countDown>0?(r(),c("span",Z,w(n(o).countDown),1)):(r(),c("span",tt,"N")),_("次失败后，认为当前记录是离线的。 ")])])])],512),[[I,n(o).isOn]])]),_:1})]))}},nt=["value"],bt={__name:"healthCheck",setup(y){const u=U(new J);return(o,d)=>(r(),c(T,null,[s(A,{ctx:n(u),activeTab:"healthCheck"},null,8,["ctx"]),n(u).canUpdate?O("",!0):(r(),$(b,{key:0,"disable-spacing":""},{default:i(()=>[_("当前用户没有权限修改健康检查设置，请检查用户所属套餐。")]),_:1})),s(k,{action:"$",onSuccess:n(u).success},{default:i(()=>[e("input",{type:"hidden",name:"domainId",value:n(u).domainId},null,8,nt),s(et,{modelValue:n(u).config,"onUpdate:modelValue":d[0]||(d[0]=m=>n(u).config=m)},null,8,["modelValue"]),s(D,{disabled:!n(u).canUpdate,class:"mt-4"},null,8,["disabled"])]),_:1},8,["onSuccess"])],64))}};export{bt as default};
