PageSourceSearch

https://panel.whogohost.com/_nuxt/Bpd4tgAz.js

js whogohost.com collected 2026-10-03 22:46:00 UTC 5,717 bytes, 1 lines download raw bytes

1import{_ as W}from"./gCsm2vqS.js";import{_ as X}from"./47d3lf7s.js";import{_ as Y}from"./CKmCWprd.js";import{b9 as Z,b as ee,i as ae,C as V,o as se,e as te,f,g as N,k as s,w as r,V as w,m as re,h as t,v as ne,A as le,x as oe,z as ue,l as $,F as me,D as ie,n as i,B as de,q as y,t as ce,am as fe,j as C,Q as k,s as q,r as ve,ab as pe,M as l,L as g,ah as ye}from"./BsIkG1OG.js";import{u as _e}from"./ClKB9VTC.js";import{V as be,a as L}from"./B3yhQatY.js";(function(){try{var u=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},_=new u.Error().stack;_&&(u._sentryDebugIds=u._sentryDebugIds||{},u._sentryDebugIds[_]="d5ff7302-a1f4-4cf4-9ed7-4b2fe4af5008",u._sentryDebugIdIdentifier="sentry-dbid-d5ff7302-a1f4-4cf4-9ed7-4b2fe4af5008")}catch{}})();const ge={class:"mt-n4"},De={key:0,class:"mt-n8 mb-4"},he=Z({__name:"DomainNameserversSection",props:{domain:{type:Object,required:!0}},emits:["updated"],setup(u,{emit:_}){const d=u,A=_,{$apiFetch:M}=ee(),x=ae("showSnackbar"),D=l(()=>(d.domain?.default_nameservers||[]).filter(e=>e&&e.trim()!=="")),b=l(()=>(d.domain?.domain_nameservers||[]).filter(e=>e&&e.trim()!=="")),S=l(()=>[...D.value||[],"","","","",""].slice(0,5)),c=g(["","","","",""]),n=ye({useDefault:!0}),R=g(),h=g(!1),v=g(!1),O=l(()=>n.useDefault?S.value:c.value),p=l(()=>c.value.map(a=>a.trim()).filter(Boolean)),I=l(()=>p.value.every(V.isHostnameOrIp)),F=l(()=>new Set(p.value.map(e=>e.toLowerCase())).size===p.value.length),U=l(()=>p.value.length>=2),B=l(()=>v.value?!1:n.useDefault?!0:U.value&&I.value&&F.value),j=V.uniqueIn(()=>c.value,"Duplicate nameserver"),E=(a,e)=>{n.useDefault||(c.value[a]=e)},P=l(()=>{const a=b.value.map(m=>m.toLowerCase()),e=D.value.map(m=>m.toLowerCase());return a.length===0?!0:e.length<2?!1:e.filter(m=>a.includes(m)).length>=2}),{statusLabel:H,statusColor:z}=_e(b,D),G=async()=>{if(!(!B.value||!d.domain?.id)){v.value=!0;try{const a=n.useDefault?S.value.filter(Boolean):p.value,e=await M(`/api/domains/${d.domain.id}/update-nameservers`,{method:"POST",body:{ns1:a[0]||"",ns2:a[1]||"",ns3:a[2]||void 0,ns4:a[3]||void 0,ns5:a[4]||void 0}});if(e.result==="success")x?.("Nameservers updated successfully","success"),n.useDefault?n.useDefault=!0:(n.useDefault=!1,c.value=[...a,"","","","",""].slice(0,5)),A("updated",{domain_nameservers:a});else throw new Error(e.message||"Failed to update nameservers")}catch(a){console.error("Failed to update nameservers:",a),x?.(a?.data?.statusMessage||a?.message||"Failed to update nameservers","error")}finally{v.value=!1}}};return se(()=>{n.useDefault=P.value;const e=[...b.value||[],"","","","",""].slice(0,5);c.value=e,te({title:`Nameserver Management - ${d.domain?.domain||""}`})}),(a,e)=>{const T=W,m=X,Q=Y,J=pe;return f(),N("div",null,[s(T,{title:"Nameservers Management",subtitle:"Change the nameservers for your domain","show-divider":!1}),s($,null,{default:r(()=>[s(w,{cols:"12",class:"mt-6"},{default:r(()=>[s(re,{class:"mb-6"},{default:r(()=>[s(m,{"status-label":t(H),"status-color":t(z),nameservers:t(b)},null,8,["status-label","status-color","nameservers"])]),_:1}),s(ne,{class:"mb-6"},{default:r(()=>[s(le,null,{default:r(()=>[s(be,{modelValue:t(n).useDefault,"onUpdate:modelValue":e[0]||(e[0]=o=>t(n).useDefault=o),class:"mb-4"},{default:r(()=>[s(L,{value:!0,label:"Use default nameservers"}),s(L,{value:!1,label:"Use custom nameservers"})]),_:1},8,["modelValue"]),s(oe,{ref_key:"nsForm",ref:R,modelValue:t(h),"onUpdate:modelValue":e[1]||(e[1]=o=>ue(h)?h.value=o:null)},{default:r(()=>[s($,{class:"mb-2"},{default:r(()=>[(f(),N(me,null,ie(5,o=>s(w,{cols:"12",sm:"6",lg:"4",key:o},{default:r(()=>[i("div",ge,[s(de,null,{default:r(()=>[y("Nameserver "+ce(o),1)]),_:2},1024),s(fe,{readonly:t(n).useDefault,disabled:t(v)||t(n).useDefault,"model-value":t(O)[o-1],"onUpdate:modelValue":K=>E(o-1,K),rules:[t(V).nameserverRules,t(j)],variant:"outlined",density:"comfortable",placeholder:"ns"+o+".example.com","hide-details":!1},null,8,["readonly","disabled","model-value","onUpdate:modelValue","rules","placeholder"])])]),_:2},1024)),64))]),_:1}),t(n).useDefault?q("",!0):(f(),N("div",De,[s(Q,{permissions:"managedomains"},{default:r(()=>[t(U)?t(I)?t(F)?q("",!0):(f(),C(k,{key:2,type:"error",variant:"plain",density:"compact",class:"mt-4 opacity-100 pa-0",icon:"$warningIcon"},{default:r(()=>[...e[4]||(e[4]=[y(" Nameservers must be unique. ",-1)])]),_:1})):(f(),C(k,{key:1,type:"error",variant:"plain",density:"compact",class:"mt-4 opacity-100 pa-0",icon:"$warningIcon"},{default:r(()=>[...e[3]||(e[3]=[y(" One or more nameservers are invalid. Use a hostname (e.g. ns1.example.com) or IPv4 address. ",-1)])]),_:1}
1)):(f(),C(k,{key:0,type:"error",variant:"plain",density:"compact",class:"mt-4 opacity-100 pa-0",icon:"$warningIcon"},{default:r(()=>[...e[2]||(e[2]=[y(" At least 2 nameservers are required. ",-1)])]),_:1}))]),_:1})])),s(ve,{color:"primaryButtons",height:"40",class:"px-4 mt-6",loading:t(v),disabled:!t(B),onClick:G},{default:r(()=>[...e[5]||(e[5]=[y(" Change Nameservers ",-1)])]),_:1},8,["loading","disabled"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),s(w,{cols:"12"},{default:r(()=>[s(J,{text:""},{default:r(()=>[...e[6]||(e[6]=[i("div",{class:"text-body-2"},[i("p",{class:"mb-1 font-weight-medium"},"Tips:"),i("ul",{class:"text-medium-emphasis pl-4 mb-0"},[i("li",null,"Use at least 2 nameservers for redundancy."),i("li",null,"Nameserver changes may take time to propagate globally."),i("li",null,"After changing nameservers, you may need to wait up to 24 hours for the changes to take effect. And reflect correctly in our system.")])],-1)])]),_:1})]),_:1})]),_:1})])}}}),Se=Object.assign(he,{__name:"DomainNameserversSection"});export{Se as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.