PageSourceSearch

https://e0f.cx/assets/SmartDnsPage-7kH1sGSJ.js

js e0f.cx collected 2026-09-24 14:58:31 UTC 8,224 bytes, 1 lines download raw bytes

1import{u as R,a as Y,b1 as Z,r as m,W as f,j as s,t as q,aj as K,b0 as Q,C as $,Y as g,S as p,T as z,G as l,Z as ss,e as W,f as n,_ as y,a6 as v,a7 as es,b2 as c,a5 as O,aX as rs,l as N,ai as ns,aa as G,b3 as a,ak as as,ab as w,ac as X,ag as is,aJ as ts,ad as ls}from"./index-DJgzD7sm.js";import{I as x}from"./IconWorldWww-CMCyO7aI.js";import{I as T}from"./IconDeviceGamepad2-3tm0riT1.js";import{C as S}from"./Code-Bus1hUjD.js";import{I as os}from"./IconTrash-Dw0tXwO_.js";function C({label:e,value:h}){const{t:u}=R();return s.jsxs(l,{justify:"space-between",gap:"xs",wrap:"nowrap",children:[s.jsxs("div",{style:{minWidth:0,flex:1},children:[s.jsx(n,{size:"xs",c:"dimmed",children:e}),s.jsx(S,{style:{display:"block",overflowX:"auto",whiteSpace:"nowrap"},children:h})]}),s.jsx(is,{value:h,children:({copied:o,copy:t})=>s.jsx(ts,{label:u(o?"smartDns.copied":"smartDns.copy"),children:s.jsx(G,{variant:"light",color:o?"green":"gray",onClick:t,children:o?s.jsx(X,{size:16}):s.jsx(ls,{size:16})})})})]})}function js(){const{t:e}=R(),{token:h}=Y(),u=Z(),o=m.useMemo(()=>({Authorization:`Bearer ${h}`}),[h]),[t,L]=m.useState(null),[J,F]=m.useState(!0),[_,k]=m.useState(""),[M,P]=m.useState(!1),b=m.useCallback(async()=>{try{const r=await fetch(`${f}/api/smart-dns/config`,{headers:o});if(!r.ok)throw new Error(`HTTP ${r.status}`);L(await r.json())}catch{L({premium:!1})}finally{F(!1)}},[o]);m.useEffect(()=>{b()},[b]);const A=async r=>{P(!0);try{const i=await fetch(`${f}/api/smart-dns/ips`,{method:"POST",headers:{...o,"Content-Type":"application/json"},body:JSON.stringify({label:r?.trim()||void 0})});if(!i.ok){const D=await i.json().catch(()=>({}));throw new Error(D?.message||`HTTP ${i.status}`)}k(""),w.show({color:"green",title:e("smartDns.addedTitle"),message:e("smartDns.addedMsg"),icon:s.jsx(X,{size:16})}),await b()}catch(i){w.show({color:"red",title:e("smartDns.errorTitle"),message:i?.message||String(i)})}finally{P(!1)}},U=async r=>{try{const i=await fetch(`${f}/api/smart-dns/ips/${r}`,{method:"DELETE",headers:o});if(!i.ok)throw new Error(`HTTP ${i.status}`);w.show({color:"green",title:e("smartDns.removedTitle"),message:e("smartDns.removedMsg")}),await b()}catch(i){w.show({color:"red",title:e("smartDns.errorTitle"),message:i?.message||String(i)})}};if(J)return s.jsx(q,{h:400,children:s.jsx(K,{size:"lg"})});if(t?.hidden)return s.jsx(Q,{to:"/",replace:!0});if(!t?.premium)return s.jsx($,{size:"sm",py:60,children:s.jsx(g,{withBorder:!0,padding:"xl",radius:"lg",style:{background:"linear-gradient(135deg, rgba(20, 184, 166, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%)",borderColor:"var(--mantine-color-teal-4)"},children:s.jsxs(p,{align:"center",gap:"lg",children:[s.jsx(z,{size:100,radius:"xl",variant:"gradient",gradient:{from:"teal",to:"blue",deg:135},children:s.jsx(x,{size:50})}),s.jsxs(l,{gap:"xs",children:[s.jsx(ss,{size:24,color:"var(--mantine-color-yellow-5)"}),s.jsx(W,{order:2,ta:"center",children:e("smartDns.premiumTitle")})]}),s.jsx(n,{size:"lg",c:"dimmed",ta:"center",maw:440,children:e("smartDns.premiumDesc")}),s.jsx(y,{size:"md",variant:"gradient",gradient:{from:"teal",to:"blue",deg:135},onClick:()=>u("/buy"),children:e("smartDns.subscribeBtn")})]})})});const H=t.servers||[],d=t.allowedIps||[],B=t.categories||{},I=t.maxIps||10,j=t.currentIp||null,V=!!j&&d.some(r=>r.ip===j),E=d.length>=I;return s.jsx($,{size:"md",py:"lg",children:s.jsxs(p,{gap:"lg",children:[s.jsxs("div",{children:[s.jsxs(l,{gap:"xs",children:[s.jsx(z,{size:"lg",variant:"light",color:"teal",children:s.jsx(x,{size:20})}),s.jsx(W,{order:2,children:e("smartDns.title")})]}),s.jsx(n,{c:"dimmed",size:"sm",mt:4,children:e("smartDns.subtitle")})]}),s.jsx(v,{color:"blue",variant:"light",icon:s.jsx(es,{size:16}),children:e("smartDns.infoAlert")}),j&&!V&&s.jsxs(v,{color:"orange",variant:"light",icon:s.jsx(rs,{size:16}),title:e("smartDns.ipMismatchTitle"),children:[s.jsx(n,{size:"sm",mb:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.ipMismatchDesc",{ip:j}))}}),s.jsx(y,{size:"xs",color:"orange",leftSection:s.jsx(O,{size:14}),loading:M,disabled:E,onClick:()=>A(),children:e("smartDns.ipMismatchAddBtn",{ip:j})}),E&&s.jsx(n,{size:"xs",c:"dimmed",mt:6,children:e("smartDns.ipMismatchAtLimit")})]}),H.length===0?s.jsx(v,{color:"yellow",variant:"light",children:e("smartDns.noServers")}):H.map(r=>
1s.jsxs(g,{withBorder:!0,padding:"lg",radius:"md",children:[s.jsx(l,{justify:"space-between",mb:"sm",children:s.jsxs(l,{gap:"xs",children:[s.jsx(n,{fw:600,children:r.name}),r.region&&s.jsx(N,{variant:"light",size:"sm",children:r.region})]})}),s.jsxs(p,{gap:"sm",children:[s.jsx(C,{label:e("smartDns.fieldPlainDns"),value:r.plainDns}),s.jsx(C,{label:e("smartDns.fieldDot"),value:r.dot}),s.jsx(C,{label:e("smartDns.fieldDoh"),value:r.doh})]})]},r.domain)),s.jsxs(g,{withBorder:!0,padding:"lg",radius:"md",children:[s.jsxs(l,{gap:"xs",mb:"xs",children:[s.jsx(z,{size:"md",variant:"light",color:"grape",children:s.jsx(T,{size:18})}),s.jsx(n,{fw:600,children:e("smartDns.consoleIpTitle")})]}),s.jsx(n,{size:"sm",c:"dimmed",mb:"md",dangerouslySetInnerHTML:{__html:c(e("smartDns.consoleIpDesc"))}}),s.jsxs(l,{gap:"xs",align:"flex-end",mb:"md",wrap:"nowrap",children:[s.jsxs("div",{style:{flex:1},children:[s.jsx(n,{size:"xs",c:"dimmed",children:e("smartDns.currentIpLabel")}),s.jsx(S,{children:t.currentIp||"—"})]}),s.jsx(ns,{label:e("smartDns.labelOptional"),placeholder:e("smartDns.labelPlaceholder"),value:_,onChange:r=>k(r.currentTarget.value),style:{flex:1}}),s.jsx(y,{leftSection:s.jsx(O,{size:16}),loading:M,disabled:!t.currentIp||d.length>=I||d.some(r=>r.ip===t.currentIp),onClick:()=>A(_),children:d.some(r=>r.ip===t.currentIp)?e("smartDns.alreadyAdded"):e("smartDns.addMyIp")})]}),d.length===0?s.jsx(n,{size:"sm",c:"dimmed",children:e("smartDns.noIps")}):s.jsx(p,{gap:"xs",children:d.map(r=>s.jsxs(l,{justify:"space-between",wrap:"nowrap",children:[s.jsxs(l,{gap:"xs",children:[s.jsx(S,{children:r.ip}),r.label&&s.jsx(n,{size:"sm",c:"dimmed",children:r.label})]}),s.jsx(G,{variant:"subtle",color:"red",onClick:()=>U(r.id),children:s.jsx(os,{size:16})})]},r.id))}),s.jsx(n,{size:"xs",c:"dimmed",mt:"sm",children:e("smartDns.ipLimit",{current:d.length,max:I})})]}),Object.keys(B).length>0&&s.jsxs(g,{withBorder:!0,padding:"lg",radius:"md",children:[s.jsx(n,{fw:600,mb:"sm",children:e("smartDns.whatWorks")}),s.jsx(p,{gap:"md",children:Object.entries(B).map(([r,i])=>s.jsxs("div",{children:[s.jsx(n,{size:"sm",fw:500,mb:6,children:e(`smartDns.category.${r}`,{defaultValue:r})}),s.jsx(l,{gap:6,children:[...new Set(i)].map(D=>s.jsx(N,{variant:"light",size:"sm",children:D},D))})]},r))})]}),s.jsxs(g,{withBorder:!0,padding:"lg",radius:"md",children:[s.jsx(n,{fw:600,mb:"sm",children:e("smartDns.instructionsTitle")}),s.jsxs(a,{variant:"separated",children:[s.jsxs(a.Item,{value:"xbox",children:[s.jsx(a.Control,{icon:s.jsx(T,{size:18}),children:e("smartDns.xboxTab")}),s.jsx(a.Panel,{children:s.jsx(n,{size:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.instrXbox"))}})})]}),s.jsxs(a.Item,{value:"ps",children:[s.jsx(a.Control,{icon:s.jsx(T,{size:18}),children:e("smartDns.psTab")}),s.jsx(a.Panel,{children:s.jsx(n,{size:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.instrPs"))}})})]}),s.jsxs(a.Item,{value:"windows",children:[s.jsx(a.Control,{icon:s.jsx(x,{size:18}),children:e("smartDns.windowsTab")}),s.jsx(a.Panel,{children:s.jsx(n,{size:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.instrWindows"))}})})]}),s.jsxs(a.Item,{value:"android",children:[s.jsx(a.Control,{icon:s.jsx(x,{size:18}),children:e("smartDns.androidTab")}),s.jsx(a.Panel,{children:s.jsx(n,{size:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.instrAndroid"))}})})]}),s.jsxs(a.Item,{value:"ios",children:[s.jsx(a.Control,{icon:s.jsx(x,{size:18}),children:e("smartDns.iosTab")}),s.jsx(a.Panel,{children:s.jsx(n,{size:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.instrIos"))}})})]}),s.jsxs(a.Item,{value:"router",children:[s.jsx(a.Control,{icon:s.jsx(x,{size:18}),children:e("smartDns.routerTab")}),s.jsx(a.Panel,{children:s.jsx(n,{size:"sm",dangerouslySetInnerHTML:{__html:c(e("smartDns.instrRouter"))}})})]})]})]}),s.jsx(as,{}),s.jsx(n,{size:"xs",c:"dimmed",ta:"center",children:e("smartDns.footer")})]})})}export{js as SmartDnsPage};

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.