1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./pA-V_f-X.js","./BsIkG1OG.js","./entry.mA54lP9M.css","./B6_wp9pN.js","./VCombobox.oEMh14a_.css","./DcCrEKzr.js"])))=>i.map(i=>d[i]); 2import{b as le,i as ie,S as de,M as b,L as w,b9 as ue,c as ce,P as me,W as fe,N as pe,f as y,g as V,k as d,w as a,V as q,n as g,h as e,t as _,s as G,F,j as N,q as f,r as P,aB as H,l as W,y as J,at as K,p as ve,z as Q,aU as X,aV as Y}from"./BsIkG1OG.js";import{_ as ge}from"./CMFIoU6N.js";import{V as Z}from"./CLEnivgB.js";import"./CM2C2V57.js";import"./DUoHspzQ.js";import"./BkCORoIH.js";(function(){try{var u=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new u.Error().stack;p&&(u._sentryDebugIds=u._sentryDebugIds||{},u._sentryDebugIds[p]="fa317525-efa3-4c08-a3e2-6842719bd1bd",u._sentryDebugIdIdentifier="sentry-dbid-fa317525-efa3-4c08-a3e2-6842719bd1bd")}catch{}})();function ye(){const{$apiFetch:u}=le(),p=ie("showSnackbar"),v=w(!1),{data:c,pending:I,error:T,refresh:h}=de("rdns-list",()=>u("/api/dns/rdns",{method:"GET"})),m=b(()=>c.value?.result==="success"&&c.value?.data?c.value.data:null),k=b(()=>m.value?.records||[]),S=b(()=>m.value?.available_items||[]),j=b(()=>m.value?.ptr_count??0),D=b(()=>m.value?.ptr_limit??-1),B=b(()=>{const o=D.value;return o>0&&j.value>=o}),$=o=>o.allow_rdns&&o.rdns_supported&&o.ptr_limit!==0,L=o=>m.value?.custom_ip_mode?{mode:"free"}:m.value?.subnet_custom_ip_mode?{mode:"subnet",ips:o.ips,pools:o.pools}:{mode:"list",ips:o.ips},C=o=>{const n=o?.data||{},r=n?.error_code||n?.data?.error_code||"unknown",i=o?.data?.statusMessage||o?.statusMessage||n?.message||"Operation failed";switch(r){case"ip_already_taken_other_owner":return{ok:!1,errorCode:r,message:i,field:"form"};case"validation_failed":case"hostname_blocked":return{ok:!1,errorCode:r,message:i,field:"hostname"};case"record_not_found":return p?.("This PTR record no longer exists","warning"),{ok:!1,errorCode:r,message:i,field:"form"};default:return p?.(i,"error"),{ok:!1,errorCode:r,message:i}}};return{context:m,records:k,availableItems:S,ptrCount:j,ptrLimit:D,pending:I,fetchError:T,isSaving:v,atLimit:B,isItemSelectable:$,ipChoicesFor:L,addPtr:async o=>{v.value=!0;try{const n=await u("/api/dns/rdns",{method:"POST",body:o});return n?.result==="success"?(p?.(n.message||"PTR record saved","success"),await h(),{ok:!0}):{ok:!1,errorCode:"unknown",message:"Unexpected response"}}catch(n){return C(n)}finally{v.value=!1}},editPtr:async(o,n)=>{v.value=!0;try{const r=await u(`/api/dns/rdns/${o}`,{method:"PUT",body:n});return r?.result==="success"?(p?.(r.message||"PTR record updated","success"),await h(),{ok:!0}):{ok:!1,errorCode:"unknown",message:"Unexpected response"}}catch(r){const i=C(r);return i.errorCode==="record_not_found"&&await h(),i}finally{v.value=!1}},deletePtr:async o=>{v.value=!0;try{const n=await u(`/api/dns/rdns/${o}`,{method:"DELETE"});return n?.result==="success"?(p?.(n.message||"PTR record removed","success"),await h(),{ok:!0}):{ok:!1,errorCode:"unknown",message:"Unexpected response"}}catch(n){const r=C(n);return r.errorCode==="record_not_found"&&await h(),r}finally{v.value=!1}},refresh:h}}const _e={class:"d-flex align-center ga-3 flex-wrap justify-end"},be={key:0,class:"text-body-2 text-medium-emphasis"},he={class:"text-center py-8"},we={class:"mt-6 d-flex justify-center"},ke={class:"font-weight-medium"},xe={class:"d-flex align-center ga-1 justify-end flex-column flex-md-row"},Re=ue({__name:"RdnsOverview",setup(u){const p=X(()=>Y(()=>import("./pA-V_f-X.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),v=X(()=>Y(()=>import("./DcCrEKzr.js"),__vite__mapDeps([5,1,2]),import.meta.url)),{mobile:c}=ce(),{context:I,records:T,availableItems:h,ptrCount:m,ptrLimit:k,pending:S,fetchError:j,isSaving:D,atLimit:B,addPtr:$,editPtr:L,deletePtr:C}=ye(),U=[{title:"IP Address",key:"ip",sortable:!0,align:"start"},{title:"Hostname",key:"hostname",sortable:!0,align:"start"},{title:"TTL",key:"ttl",sortable:!1,align:"start"},{title:"",key:"actions",sortable:!1,align:"end"}],O=b(()=>T.value.length>0),M=b(()=>!S.value&&T.value.length===0),o=b(()=>{const s=j.value;return s?(s?.data?.error_code??s?.data?.data?.error_code)==="rdns_disabled":!1}),n=w(!1);me(o,async s=>{!s||n.value||(n.value=!0,await fe(),await pe("/dashboard",{replace:!0}))},{immediate:!0});const r=w(!1),i=w(!1),x=w(null),A=w(null),R=w({}),E=w(null),z=()=>{x.value=null,R.value={},E.value=null,r.value=!0},ee=s=>{x.value=s,R.value={},E.value=null,r.value=!0},te=s=>{A.value=s,i.value=!0},se=s=>s.ok?!0:(s.field==="hostname"?R.value={hostname:s.message}:s.field==="ip"?R.value={ip:s.message}:s.field==="form"&&(E.value=s.message),!1),oe=async s=>{R.value={},E.value=null;let t;s.isEdit&&x.value?t=await L(x.value.id,{hostname:s.hostname}):t=await $({type:s.type,relid:s.relid,ip:s.ip,hostname:s.hostname,ttl:s.ttl}),se(t)&&(r.value=!1,x.value=null)},re=async()=>
2{if(!A.value)return;const s=await C(A.value.id);(s.ok||s.errorCode==="record_not_found")&&(i.value=!1,A.value=null)};return(s,t)=>{const ae=ge;return y(),V("div",null,[d(W,null,{default:a(()=>[d(q,{class:"d-flex align-center justify-space-between flex-wrap ga-2"},{default:a(()=>[t[4]||(t[4]=g("h1",{class:"text-h5 font-weight-medium"},"Overview",-1)),g("div",_e,[e(k)>0?(y(),V("span",be,_(e(m))+" / "+_(e(k))+" PTR records ",1)):G("",!0),e(O)?(y(),V(F,{key:1},[e(B)?(y(),N(Z,{key:0,location:"bottom","max-width":"260"},{activator:a(({props:l})=>[d(P,H(l,{"prepend-icon":"$addIcon",color:"primaryButtons",variant:"flat",disabled:""}),{default:a(()=>[...t[2]||(t[2]=[f(" Add PTR Record ",-1)])]),_:1},16)]),default:a(()=>[f(" PTR limit reached ("+_(e(m))+"/"+_(e(k))+") ",1)]),_:1})):(y(),N(P,{key:1,"prepend-icon":"$addIcon",color:"primaryButtons",variant:"flat",onClick:z},{default:a(()=>[...t[3]||(t[3]=[f(" Add PTR Record ",-1)])]),_:1}))],64)):G("",!0)])]),_:1})]),_:1}),d(W,{class:"mt-2"},{default:a(()=>[d(q,{cols:"12"},{default:a(()=>[d(ae,{headers:U,items:e(T),loading:e(S),"show-search":e(O),"search-placeholder":"Search...",hover:"","min-height":"400px","empty-state-icon":"$serverIcon","empty-state-title":"No rDNS Records Found","empty-state-message":"Add your first PTR record to get started"},{"empty-state":a(()=>[g("div",he,[d(ve,{size:"64",color:"grey-lighten-1"},{default:a(()=>[...t[5]||(t[5]=[f(" $serverIcon ",-1)])]),_:1}),e(M)?(y(),V(F,{key:0},[t[8]||(t[8]=g("p",{class:"text-h6 mt-4"},"No rDNS Records Found",-1)),t[9]||(t[9]=g("p",{class:"text-body-2 text-medium-emphasis"}," Add your first PTR record to get started ",-1)),g("div",we,[e(B)?(y(),N(Z,{key:0,location:"bottom","max-width":"260"},{activator:a(({props:l})=>[d(P,H(l,{"prepend-icon":"$addIcon",color:"primaryButtons",variant:"flat",disabled:""}),{default:a(()=>[...t[6]||(t[6]=[f(" Add PTR Record ",-1)])]),_:1},16)]),default:a(()=>[f(" PTR limit reached ("+_(e(m))+"/"+_(e(k))+") ",1)]),_:1})):(y(),N(P,{key:1,"prepend-icon":"$addIcon",color:"primaryButtons",variant:"flat",onClick:z},{default:a(()=>[...t[7]||(t[7]=[f(" Add PTR Record ",-1)])]),_:1}))])],64)):(y(),V(F,{key:1},[t[10]||(t[10]=g("p",{class:"text-h6 mt-4"},"No matching records",-1)),t[11]||(t[11]=g("p",{class:"text-body-2 text-medium-emphasis"}," Try adjusting your search. ",-1))],64))])]),"item.ip":a(({item:l})=>[g("span",ke,_(l.ip),1)]),"item.hostname":a(({item:l})=>[f(_(l.hostname),1)]),"item.ttl":a(({item:l})=>[f(_(l.ttl??"â"),1)]),"item.actions":a(({item:l})=>[g("div",xe,[d(P,{variant:e(c)?"flat":"plain",color:e(c)?"primaryButtons":"blackAccent",class:K([{"text-decoration-underline text-subtitle-2 font-weight-medium opacity-100":!e(c)},"justify-center justify-lg-end mb-2 mb-md-0"]),block:e(c),onClick:J(ne=>ee(l),["stop"])},{default:a(()=>[...t[12]||(t[12]=[f(" Edit ",-1)])]),_:1},8,["variant","color","class","block","onClick"]),d(P,{variant:e(c)?"outlined":"plain",color:"error",class:K([{"text-decoration-underline text-subtitle-2 font-weight-medium opacity-100":!e(c)},"justify-center justify-lg-end mb-2 mb-md-0"]),block:e(c),onClick:J(ne=>te(l),["stop"])},{default:a(()=>[...t[13]||(t[13]=[f(" Delete ",-1)])]),_:1},8,["variant","class","block","onClick"])])]),_:1},8,["items","loading","show-search"])]),_:1})]),_:1}),d(e(p),{modelValue:e(r),"onUpdate:modelValue":t[0]||(t[0]=l=>Q(r)?r.value=l:null),"available-items":e(h),"custom-ip-mode":e(I)?.custom_ip_mode??!1,"subnet-custom-ip-mode":e(I)?.subnet_custom_ip_mode??!1,"editing-record":e(x),loading:e(D),"field-errors":e(R),"server-error":e(E),onSubmit:oe},null,8,["modelValue","available-items","custom-ip-mode","subnet-custom-ip-mode","editing-record","loading","field-errors","server-error"]),d(e(v),{modelValue:e(i),"onUpdate:modelValue":t[1]||(t[1]=l=>Q(i)?i.value=l:null),record:e(A),loading:e(D),onConfirm:re},null,8,["modelValue","record","loading"])])}}}),Ve=Object.assign(Re,{__name:"RdnsSectionsRdnsOverview"});export{Ve 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.