2 lines
29 KiB
JavaScript
2 lines
29 KiB
JavaScript
import{d as be,o as ke,w as ee,B as c,c as n,f as h,a as e,D as o,G as v,N as U,F as p,P as f,J as te,b as se,g as le,H as ne,I as ye,h as _e,i as Ce,T as Se,r,j as O,n as je,q as i}from"./index-DnbYEqLr.js";const De={class:"pb-6"},Ne={class:"flex items-center gap-3"},Me={class:"text-xs text-white/60"},Pe=["disabled"],$e={class:"glass-card p-6 mb-6"},Be={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},He={"data-controller-container":"",tabindex:"0",class:"flex flex-col gap-3 p-4 bg-white/5 rounded-lg min-w-0"},Te={class:"flex items-center gap-3 min-w-0"},Ae={class:"relative shrink-0"},Le={key:0,class:"absolute inset-0 w-3 h-3 rounded-full bg-green-400 animate-ping opacity-75"},ze={class:"min-w-0"},Ve={class:"text-xs text-white/60"},We=["disabled"],Fe={"data-controller-container":"",tabindex:"0",class:"flex flex-col gap-3 p-4 bg-white/5 rounded-lg min-w-0"},Re={class:"flex items-center gap-3 min-w-0"},Ee={class:"relative shrink-0"},Ie={key:0,class:"absolute inset-0 w-3 h-3 rounded-full bg-green-400 animate-ping opacity-75"},Ue={class:"min-w-0"},Oe={class:"text-xs text-white/60 capitalize"},qe=["disabled"],Ge={"data-controller-container":"",tabindex:"0",class:"flex flex-col gap-3 p-4 bg-white/5 rounded-lg min-w-0"},Ke={class:"flex items-center justify-between min-w-0"},Je={class:"flex items-center gap-3 min-w-0"},Qe={class:"min-w-0"},Xe={class:"text-xs text-white/60"},Ye={"data-controller-container":"",tabindex:"0",class:"flex flex-col gap-3 p-4 bg-white/5 rounded-lg min-w-0"},Ze={class:"flex items-center gap-3 min-w-0"},et={class:"min-w-0"},tt={class:"text-xs text-white/60"},st={class:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8"},lt={"data-controller-container":"",tabindex:"0",class:"glass-card p-6 flex flex-col"},nt={class:"space-y-3 flex-1 min-h-0"},it={class:"flex items-center justify-between p-3 bg-white/5 rounded-lg"},ot={class:"text-white/60 text-sm"},at={class:"flex items-center justify-between p-3 bg-white/5 rounded-lg"},rt={class:"flex items-center justify-between p-3 bg-white/5 rounded-lg"},dt={class:"text-white/60 text-sm"},ut={class:"flex items-center justify-between p-3 bg-white/5 rounded-lg"},ct={class:"glass-card p-6 mb-6"},vt={class:"flex items-center justify-between mb-4"},ht={key:0,class:"space-y-3"},mt={key:1,class:"space-y-3"},pt={class:"flex items-center gap-3"},xt={class:"text-sm font-medium text-white"},wt={class:"text-xs text-white/50"},ft={class:"text-right"},gt={key:0,class:"text-sm text-white/80"},bt={key:1,class:"text-sm text-white/40"},kt={key:0,class:"text-sm text-white/50 text-center py-4"},yt={class:"glass-card px-6 py-6 mb-6"},_t={key:0,class:"text-sm text-white/40 py-4 text-center"},Ct={key:1,class:"text-sm text-white/40 py-4 text-center"},St={key:2,class:"space-y-2"},jt={class:"flex-1 min-w-0"},Dt={class:"text-white text-sm font-medium"},Nt=["title","onClick"],Mt={key:1,class:"text-white/30 text-xs"},Pt={class:"flex items-center gap-2 shrink-0"},$t=["onClick","disabled"],Bt={class:"tor-toggle-label"},Ht=["checked","onChange"],Tt={class:"glass-card p-6 w-full max-w-md"},At={class:"flex items-center justify-between mb-4"},Lt={key:0,class:"space-y-3"},zt={key:1,class:"space-y-2 max-h-72 overflow-y-auto"},Vt=["onClick"],Wt={class:"text-sm font-medium text-white"},Ft={class:"text-xs text-white/50"},Rt={class:"flex items-center gap-2"},Et={class:"flex gap-0.5"},It={class:"text-xs text-white/50"},Ut={key:2,class:"text-sm text-white/50 text-center py-8"},Ot={key:3,class:"mt-4 pt-4 border-t border-white/10"},qt={class:"text-sm text-white/80 mb-2"},Gt={class:"font-medium text-white"},Kt={key:0,class:"text-sm text-red-400 mb-3"},Jt={class:"flex gap-2"},Qt=["disabled"],Xt=["disabled"],Yt={class:"glass-card p-6 w-full max-w-md"},Zt={class:"flex items-center justify-between mb-4"},es={class:"space-y-2 mb-4"},ts=["onClick"],ss={class:"text-sm font-medium text-white"},ls={class:"text-xs text-white/50"},ns={key:0,class:"text-xs px-2 py-0.5 rounded-full bg-green-400/20 text-green-400"},is={key:0,class:"mb-4"},os={key:1,class:"mb-4 p-3 bg-white/5 rounded-lg"},as={class:"text-sm text-white/80"},rs={key:2,class:"text-sm text-red-400 mb-3"},ds={class:"flex gap-2"},us=["disabled"],cs={key:0,class:"fixed bottom-20 left-1/2 -translate-x-1/2 z-50 max-w-md w-full px-4"},vs={class:"bg-white/10 border border-white/20 backdrop-blur-sm rounded-lg px-4 py-3 text-white/80 text-sm flex items-center justify-between gap-3"},ps=be({__name:"Server",setup(hs){const q=r(0),b=r(!0),S=r(!1),x=r("connected"),$=r(!1),j=r(!0),W=r(0),F=r(!0),a=r({wifiCount:"N/A",torConnected:!1,forwardCount:"N/A",vpnConnected:!1,vpnProvider:"",vpnIp:"",vpnHostname:"",vpnPeers:0,dnsProvider:"system",dnsServers:[],dnsDoH:!1});async function ie(){F.value=!0;try{const[l,t,s,d]=await Promise.allSettled([c.call({method:"network.diagnostics"}),c.call({method:"router.list-forwards"}),c.vpnStatus(),c.dnsStatus()]);if(l.status==="fulfilled"&&(a.value.torConnected=l.value.tor_connected,a.value.wifiCount=l.value.wifi_count!==void 0?`${l.value.wifi_count} configured`:"N/A"),t.status==="fulfilled"){const Z=t.value.forwards?.length??0;a.value.forwardCount=`${Z} rule${Z!==1?"s":""}`}s.status==="fulfilled"&&(a.value.vpnConnected=s.value.connected,a.value.vpnProvider=s.value.provider??"",a.value.vpnIp=s.value.ip_address??"",a.value.vpnHostname=s.value.hostname??"",a.value.vpnPeers=s.value.peers_connected),d.status==="fulfilled"&&(a.value.dnsProvider=d.value.provider,a.value.dnsServers=d.value.resolv_conf_servers??[],a.value.dnsDoH=d.value.doh_enabled)}catch{}finally{F.value=!1}}async function oe(){try{const l=await c.listPeers();q.value=l.peers?.length??0}catch{q.value=0}}const R=r(!0),B=r([]),G=O(()=>B.value.filter(l=>l.type==="ethernet"||l.type==="wifi")),ae=O(()=>B.value.some(l=>l.type==="wifi")),k=r(!1),E=r(!1),D=r([]),H=r(!1),N=r(!1),T=r(""),w=r(""),M=r(""),g=r(!1),y=r("system"),_=r(""),A=r(!1),C=r(""),K=[{value:"system",label:"System Default",description:"DHCP-assigned DNS servers",doh:!1},{value:"cloudflare",label:"Cloudflare",description:"1.1.1.1 / 1.0.0.1",doh:!0},{value:"google",label:"Google",description:"8.8.8.8 / 8.8.4.4",doh:!0},{value:"quad9",label:"Quad9",description:"9.9.9.9 / 149.112.112.112",doh:!0},{value:"mullvad",label:"Mullvad",description:"194.242.2.2 (no logging)",doh:!0},{value:"custom",label:"Custom",description:"Enter your own DNS servers",doh:!1}],re=O(()=>{const l=a.value.dnsProvider,t=K.find(s=>s.value===l);return t&&l!=="system"?`${t.label}${a.value.dnsDoH?" (DoH)":""}`:a.value.dnsServers.length>0?a.value.dnsServers.slice(0,2).join(", "):"System Default"});async function de(){A.value=!0,C.value="";try{const l=y.value,t={provider:l};l==="custom"&&(t.servers=_.value.split(",").map(d=>d.trim()).filter(d=>d.length>0));const s=await c.configureDns(t);a.value.dnsProvider=s.provider,a.value.dnsServers=s.servers,a.value.dnsDoH=s.doh_enabled,g.value=!1}catch(l){C.value=l instanceof Error?l.message:"DNS configuration failed. Please try again."}finally{A.value=!1}}async function J(){R.value=!0;try{const l=await c.call({method:"network.list-interfaces"});B.value=l.interfaces}catch{B.value=[]}finally{R.value=!1}}async function ue(){E.value=!0,D.value=[];try{const l=await c.call({method:"network.scan-wifi"});D.value=l.networks}catch{D.value=[]}finally{E.value=!1}}function ce(l){T.value=l,w.value="",H.value=!0}async function Q(){if(!(!w.value||!T.value)){M.value="",N.value=!0;try{await c.call({method:"network.configure-wifi",params:{ssid:T.value,password:w.value}}),k.value=!1,H.value=!1,w.value="",u.value="WiFi connected successfully",setTimeout(()=>{u.value=""},4e3),J()}catch(l){M.value=l instanceof Error?l.message:"WiFi connection failed. Check password and try again."}finally{N.value=!1}}}const m=r(null),L=r(!1);async function X(){try{const l=await c.diskStatus();l.level==="warning"||l.level==="critical"?m.value={level:l.level,used_percent:l.used_percent,free_bytes:l.free_bytes}:m.value=null}catch{}}async function ve(){L.value=!0;try{await c.diskCleanup(),await X(),u.value="Disk cleanup completed",setTimeout(()=>{u.value=""},4e3)}catch(l){u.value=`Disk cleanup failed: ${l instanceof Error?l.message:"Unknown error"}`,setTimeout(()=>{u.value=""},6e3)}finally{L.value=!1}}function he(l){return l>=1073741824?`${(l/1073741824).toFixed(1)} GB`:l>=1048576?`${(l/1048576).toFixed(0)} MB`:`${(l/1024).toFixed(0)} KB`}const P=r([]),I=r(!1);async function z(){I.value=!0;try{const l=await c.call({method:"tor.list-services"});P.value=l.services||[]}catch{P.value=[]}finally{I.value=!1}}const V=r(!1);function me(l){navigator.clipboard.writeText(l),u.value="Onion address copied to clipboard",setTimeout(()=>{u.value=""},3e3)}async function pe(l,t){try{await c.call({method:"tor.toggle-app",params:{app_id:l,enabled:t}}),await z()}catch{}}async function xe(l){V.value=l;try{await c.call({method:"tor.rotate-service",params:{name:l}}),await z()}catch{}finally{V.value=!1}}ke(()=>{Y(),ie(),oe(),J(),X(),z()}),ee(k,l=>{l&&ue()}),ee(g,l=>{l&&(y.value=a.value.dnsProvider||"system",_.value="",C.value="")});async function we(){S.value=!0,b.value=!1;try{await c.restartServer(),u.value="Services restarting...",setTimeout(()=>{u.value=""},4e3)}catch(t){u.value=`Restart failed: ${t instanceof Error?t.message:"Unknown error"}`,setTimeout(()=>{u.value=""},6e3)}(async t=>{for(let s=0;s<t;s++){await new Promise(d=>setTimeout(d,2e3));try{await c.call({method:"server.health",params:{}}),b.value=!0,S.value=!1;return}catch{}}S.value=!1,b.value=!1,x.value="disconnected"})(15)}async function Y(){$.value=!0,x.value="checking";try{await c.call({method:"server.health",params:{}}),x.value="connected"}catch{x.value="disconnected"}finally{$.value=!1}}function fe(){j.value=!j.value}const u=r("");function ge(){W.value=0,u.value="Server logs are available via SSH: journalctl -u archipelago -f",setTimeout(()=>{u.value=""},6e3)}return(l,t)=>(i(),n("div",De,[m.value?(i(),n("div",{key:0,class:h(["mb-6 p-4 rounded-xl border flex items-center justify-between",m.value.level==="critical"?"bg-red-500/10 border-red-500/30":"bg-yellow-500/10 border-yellow-500/30"])},[e("div",Ne,[(i(),n("svg",{xmlns:"http://www.w3.org/2000/svg",class:h(["h-5 w-5 shrink-0",m.value.level==="critical"?"text-red-400":"text-yellow-400"]),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[...t[11]||(t[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"},null,-1)])],2)),e("div",null,[e("p",{class:h(["text-sm font-medium",m.value.level==="critical"?"text-red-300":"text-yellow-300"])},o(m.value.level==="critical"?"Disk Space Critical":"Disk Space Warning"),3),e("p",Me,o(m.value.used_percent.toFixed(1))+"% used — "+o(he(m.value.free_bytes))+" remaining ",1)])]),e("button",{class:"glass-button glass-button-sm px-3 py-1.5 text-xs font-medium rounded",disabled:L.value,onClick:ve},o(L.value?"Cleaning...":"Clean Up"),9,Pe)],2)):v("",!0),e("div",$e,[e("div",Be,[e("div",He,[e("div",Te,[e("div",Ae,[e("div",{class:h(["w-3 h-3 rounded-full",b.value?"bg-green-400":"bg-red-400"])},null,2),b.value?(i(),n("div",Le)):v("",!0)]),e("div",ze,[t[12]||(t[12]=e("p",{class:"text-sm font-medium text-white"},"Services",-1)),e("p",Ve,o(b.value?"All Running":"Some Stopped"),1)])]),e("button",{onClick:we,class:"w-full min-h-[44px] glass-button rounded-lg text-sm font-medium text-white/90 hover:text-white transition-colors disabled:opacity-50 flex items-center justify-center",disabled:S.value},o(S.value?"Restarting...":"Restart"),9,We)]),e("div",Fe,[e("div",Re,[e("div",Ee,[e("div",{class:h(["w-3 h-3 rounded-full",x.value==="connected"?"bg-green-400":x.value==="checking"?"bg-yellow-400":"bg-red-400"])},null,2),x.value==="connected"?(i(),n("div",Ie)):v("",!0)]),e("div",Ue,[t[13]||(t[13]=e("p",{class:"text-sm font-medium text-white"},"Connectivity",-1)),e("p",Oe,o(x.value),1)])]),e("button",{onClick:Y,class:"w-full min-h-[44px] glass-button rounded-lg text-sm font-medium text-white/90 hover:text-white transition-colors disabled:opacity-50 flex items-center justify-center",disabled:$.value},o($.value?"Checking...":"Check"),9,qe)]),e("div",Ge,[e("div",Ke,[e("div",Je,[t[15]||(t[15]=e("svg",{class:"w-5 h-5 text-white/60 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})],-1)),e("div",Qe,[t[14]||(t[14]=e("p",{class:"text-sm font-medium text-white"},"Auto-Sync",-1)),e("p",Xe,o(j.value?"Enabled":"Disabled"),1)])]),e("button",{onClick:fe,class:h(["relative inline-flex h-8 w-14 items-center rounded-full transition-colors shrink-0",j.value?"bg-green-500":"bg-white/20"])},[e("span",{class:h(["inline-block h-6 w-6 transform rounded-full bg-white transition-transform shadow",j.value?"translate-x-7":"translate-x-1"])},null,2)],2)])]),e("div",Ye,[e("div",Ze,[t[17]||(t[17]=e("svg",{class:"w-5 h-5 text-white/60 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),e("div",et,[t[16]||(t[16]=e("p",{class:"text-sm font-medium text-white"},"Logs",-1)),e("p",tt,o(W.value>0?`${W.value} new`:"No new logs"),1)])]),e("button",{onClick:ge,class:"w-full min-h-[44px] glass-button rounded-lg text-sm font-medium text-white/90 hover:text-white transition-colors flex items-center justify-center"}," View ")])])]),e("div",st,[e("div",lt,[t[25]||(t[25]=U('<div class="flex items-start gap-4 mb-4 shrink-0"><div class="flex-shrink-0 w-12 h-12 rounded-lg bg-white/10 flex items-center justify-center"><svg class="w-6 h-6 text-white/80" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"></path></svg></div><div class="flex-1"><h2 class="text-xl font-semibold text-white mb-2">Local Network</h2><p class="text-white/70 text-sm mb-4">OpenWRT-integrated router and network management</p></div></div>',1)),e("div",nt,[F.value?(i(),n(p,{key:0},f(4,s=>e("div",{key:s,class:"flex items-center justify-between p-3 bg-white/5 rounded-lg animate-pulse"},[...t[18]||(t[18]=[e("div",{class:"flex items-center gap-3"},[e("div",{class:"w-5 h-5 bg-white/10 rounded"}),e("div",{class:"w-24 h-4 bg-white/10 rounded"})],-1),e("div",{class:"w-16 h-4 bg-white/10 rounded"},null,-1)])])),64)):(i(),n(p,{key:1},[t[24]||(t[24]=U('<div class="flex items-center justify-between p-3 bg-white/5 rounded-lg"><div class="flex items-center gap-3"><svg class="w-5 h-5 text-white/60" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path></svg><span class="text-white/80 text-sm">Firewall Active</span></div><span class="text-green-400 text-sm font-medium">Protected</span></div>',1)),e("div",it,[t[19]||(t[19]=e("div",{class:"flex items-center gap-3"},[e("svg",{class:"w-5 h-5 text-white/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})]),e("span",{class:"text-white/80 text-sm"},"WiFi Networks")],-1)),e("span",ot,o(a.value.wifiCount),1)]),e("div",at,[t[20]||(t[20]=e("div",{class:"flex items-center gap-3"},[e("svg",{class:"w-5 h-5 text-white/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})]),e("span",{class:"text-white/80 text-sm"},"Connectivity")],-1)),e("span",{class:h(["text-sm",a.value.torConnected?"text-green-400":"text-white/60"])},o(a.value.torConnected?"Tor Connected":"N/A"),3)]),e("div",rt,[t[21]||(t[21]=e("div",{class:"flex items-center gap-3"},[e("svg",{class:"w-5 h-5 text-white/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})]),e("span",{class:"text-white/80 text-sm"},"Port Forwarding")],-1)),e("span",dt,o(a.value.forwardCount),1)]),e("div",ut,[t[22]||(t[22]=e("div",{class:"flex items-center gap-3"},[e("svg",{class:"w-5 h-5 text-white/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})]),e("span",{class:"text-white/80 text-sm"},"VPN")],-1)),e("span",{class:h(["text-sm",a.value.vpnConnected?"text-green-400":"text-white/40"])},o(a.value.vpnConnected?`${a.value.vpnProvider} (${a.value.vpnIp})`:"Not Connected"),3)]),e("button",{class:"w-full flex items-center justify-between p-3 bg-white/5 rounded-lg hover:bg-white/10 transition-colors text-left",onClick:t[0]||(t[0]=s=>g.value=!0)},[t[23]||(t[23]=e("div",{class:"flex items-center gap-3"},[e("svg",{class:"w-5 h-5 text-white/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9"})]),e("span",{class:"text-white/80 text-sm"},"DNS")],-1)),e("span",{class:h(["text-sm",a.value.dnsProvider!=="system"?"text-green-400":"text-white/60"])},o(re.value),3)])],64))]),t[26]||(t[26]=e("button",{disabled:"",title:"Coming Soon",class:"mt-4 w-full min-h-[44px] glass-button rounded-lg text-sm font-medium opacity-50 cursor-not-allowed flex items-center justify-center"}," Manage Local Network ",-1))]),t[27]||(t[27]=U('<div data-controller-container tabindex="0" class="glass-card p-6 flex flex-col"><div class="flex items-start gap-4 mb-4 shrink-0"><div class="flex-shrink-0 w-12 h-12 rounded-lg bg-white/10 flex items-center justify-center"><svg class="w-6 h-6 text-white/80" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"></path></svg></div><div class="flex-1"><h2 class="text-xl font-semibold text-white mb-2">Web3</h2><p class="text-white/70 text-sm mb-4">Decentralized web hosting and services</p></div></div><div class="space-y-3 flex-1 min-h-0"><div class="flex items-center justify-between p-3 bg-white/5 rounded-lg"><div class="flex items-center gap-3"><svg class="w-5 h-5 text-white/60" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"></path></svg><span class="text-white/80 text-sm">Hosted Websites</span></div><span class="text-white/40 text-xs px-2 py-0.5 bg-white/5 rounded-full">Coming Soon</span></div><div class="flex items-center justify-between p-3 bg-white/5 rounded-lg"><div class="flex items-center gap-3"><svg class="w-5 h-5 text-white/60" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"></path></svg><span class="text-white/80 text-sm">SSL Certificates</span></div><span class="text-white/40 text-xs px-2 py-0.5 bg-white/5 rounded-full">Coming Soon</span></div><div class="flex items-center justify-between p-3 bg-white/5 rounded-lg"><div class="flex items-center gap-3"><svg class="w-5 h-5 text-white/60" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path></svg><span class="text-white/80 text-sm">IPFS Storage</span></div><span class="text-white/40 text-xs px-2 py-0.5 bg-white/5 rounded-full">Coming Soon</span></div><div class="flex items-center justify-between p-3 bg-white/5 rounded-lg"><div class="flex items-center gap-3"><svg class="w-5 h-5 text-white/60" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"></path></svg><span class="text-white/80 text-sm">ENS Domains</span></div><span class="text-white/40 text-xs px-2 py-0.5 bg-white/5 rounded-full">Coming Soon</span></div></div><button disabled title="Coming Soon" class="mt-4 w-full min-h-[44px] glass-button rounded-lg text-sm font-medium opacity-50 cursor-not-allowed flex items-center justify-center"> Manage Web3 Services </button></div>',1))]),e("div",ct,[e("div",vt,[t[28]||(t[28]=e("div",null,[e("h2",{class:"text-xl font-semibold text-white mb-1"},"Network Interfaces"),e("p",{class:"text-sm text-white/60"},"Detected hardware and virtual interfaces")],-1)),ae.value?(i(),n("button",{key:0,onClick:t[1]||(t[1]=s=>k.value=!0),class:"px-3 py-1.5 glass-button rounded text-xs font-medium text-white/90 hover:text-white transition-colors"}," Scan WiFi ")):v("",!0)]),R.value?(i(),n("div",ht,[(i(),n(p,null,f(3,s=>e("div",{key:s,class:"p-3 bg-white/5 rounded-lg animate-pulse h-14"})),64))])):(i(),n("div",mt,[(i(!0),n(p,null,f(G.value,s=>(i(),n("div",{key:s.name,class:"flex items-center justify-between p-3 bg-white/5 rounded-lg"},[e("div",pt,[e("div",{class:h(["w-2 h-2 rounded-full",s.state==="up"?"bg-green-400":"bg-white/30"])},null,2),e("div",null,[e("p",xt,o(s.name),1),e("p",wt,o(s.type==="wifi"?"WiFi":"Ethernet")+" · "+o(s.mac),1)])]),e("div",ft,[s.ipv4.length>0?(i(),n("p",gt,o(s.ipv4[0]),1)):(i(),n("p",bt,"No IP"))])]))),128)),G.value.length===0?(i(),n("p",kt,"No physical interfaces detected")):v("",!0)]))]),e("div",yt,[e("div",{class:"flex items-center justify-between mb-4"},[t[30]||(t[30]=e("div",null,[e("h2",{class:"text-xl font-semibold text-white/96"},"Tor Services"),e("p",{class:"text-sm text-white/60 mt-1"},"Manage hidden service addresses for your node and apps")],-1)),e("button",{onClick:z,class:"glass-button px-4 py-2 rounded-lg text-sm flex items-center gap-2"},[...t[29]||(t[29]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1),te(" Refresh ",-1)])])]),I.value&&P.value.length===0?(i(),n("div",_t,"Loading Tor services...")):P.value.length===0?(i(),n("div",Ct,"No Tor services configured")):(i(),n("div",St,[(i(!0),n(p,null,f(P.value,s=>(i(),n("div",{key:s.name,class:"bg-black/20 rounded-xl border border-white/10 p-3 flex items-center justify-between gap-3"},[e("div",jt,[e("p",Dt,o(s.name),1),s.onion_address?(i(),n("p",{key:0,class:"text-amber-300/80 text-xs font-mono truncate cursor-pointer",title:s.onion_address,onClick:d=>me(s.onion_address)},o(s.onion_address),9,Nt)):(i(),n("p",Mt,"No .onion address"))]),e("div",Pt,[s.onion_address&&s.enabled?(i(),n("button",{key:0,onClick:d=>xe(s.name),disabled:V.value===s.name,class:"glass-button px-3 py-1.5 rounded-lg text-xs"},o(V.value===s.name?"Rotating...":"Rotate"),9,$t)):v("",!0),e("label",Bt,[e("input",{type:"checkbox",checked:s.enabled,onChange:d=>pe(s.name,!s.enabled),class:"tor-toggle-input"},null,40,Ht),t[31]||(t[31]=e("span",{class:"tor-toggle-slider"},null,-1))])])]))),128))]))]),k.value?(i(),n("div",{key:1,class:"fixed inset-0 bg-black/10 backdrop-blur-md z-50 flex items-center justify-center p-4",onClick:t[5]||(t[5]=se(s=>k.value=!1,["self"]))},[e("div",Tt,[e("div",At,[t[33]||(t[33]=e("h3",{class:"text-lg font-semibold text-white"},"WiFi Networks",-1)),e("button",{onClick:t[2]||(t[2]=s=>k.value=!1),class:"text-white/40 hover:text-white transition-colors"},[...t[32]||(t[32]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),E.value?(i(),n("div",Lt,[(i(),n(p,null,f(4,s=>e("div",{key:s,class:"p-3 bg-white/5 rounded-lg animate-pulse h-12"})),64))])):D.value.length>0?(i(),n("div",zt,[(i(!0),n(p,null,f(D.value,s=>(i(),n("button",{key:s.ssid,class:"w-full flex items-center justify-between p-3 bg-white/5 rounded-lg hover:bg-white/10 transition-colors text-left",onClick:d=>ce(s.ssid)},[e("div",null,[e("p",Wt,o(s.ssid),1),e("p",Ft,o(s.security||"Open"),1)]),e("div",Rt,[e("div",Et,[(i(),n(p,null,f(4,d=>e("div",{key:d,class:h(["w-1 rounded-full",d<=Math.ceil(s.signal/25)?"bg-white/80":"bg-white/20"]),style:je({height:d*3+4+"px"})},null,6)),64))]),e("span",It,o(s.signal)+"%",1)])],8,Vt))),128))])):(i(),n("p",Ut,"No networks found")),H.value?(i(),n("div",Ot,[e("p",qt,[t[34]||(t[34]=te("Connect to ",-1)),e("span",Gt,o(T.value),1)]),le(e("input",{"onUpdate:modelValue":t[3]||(t[3]=s=>w.value=s),type:"password",placeholder:"WiFi password",class:"w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-white text-sm placeholder-white/30 focus:outline-none focus:border-white/30 mb-3",onKeyup:ye(Q,["enter"])},null,544),[[ne,w.value]]),M.value?(i(),n("p",Kt,o(M.value),1)):v("",!0),e("div",Jt,[e("button",{onClick:t[4]||(t[4]=s=>{H.value=!1,w.value="",M.value=""}),disabled:N.value,class:"flex-1 px-3 py-2 glass-button rounded-lg text-sm"},"Cancel",8,Qt),e("button",{onClick:Q,class:"flex-1 px-3 py-2 glass-button rounded-lg text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed",disabled:!w.value||N.value},o(N.value?"Connecting...":"Connect"),9,Xt)])])):v("",!0)])])):v("",!0),g.value?(i(),n("div",{key:2,class:"fixed inset-0 bg-black/10 backdrop-blur-md z-50 flex items-center justify-center p-4",onClick:t[9]||(t[9]=se(s=>g.value=!1,["self"]))},[e("div",Yt,[e("div",Zt,[t[36]||(t[36]=e("h3",{class:"text-lg font-semibold text-white"},"DNS Configuration",-1)),e("button",{onClick:t[6]||(t[6]=s=>g.value=!1),class:"text-white/40 hover:text-white transition-colors"},[...t[35]||(t[35]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),t[39]||(t[39]=e("p",{class:"text-sm text-white/60 mb-4"},"Choose a DNS provider. Providers with DoH encrypt your DNS queries.",-1)),e("div",es,[(i(),n(p,null,f(K,s=>e("button",{key:s.value,class:h(["w-full flex items-center justify-between p-3 rounded-lg transition-colors text-left",y.value===s.value?"bg-white/15 border border-white/20":"bg-white/5 border border-transparent hover:bg-white/10"]),onClick:d=>{y.value=s.value,_.value=""}},[e("div",null,[e("p",ss,o(s.label),1),e("p",ls,o(s.description),1)]),s.doh?(i(),n("span",ns,"DoH")):v("",!0)],10,ts)),64))]),y.value==="custom"?(i(),n("div",is,[t[37]||(t[37]=e("label",{class:"block text-sm text-white/70 mb-1"},"DNS Servers (comma-separated)",-1)),le(e("input",{"onUpdate:modelValue":t[7]||(t[7]=s=>_.value=s),type:"text",placeholder:"1.1.1.1, 8.8.8.8",class:"w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-white text-sm placeholder-white/30 focus:outline-none focus:border-white/30"},null,512),[[ne,_.value]])])):v("",!0),a.value.dnsServers.length>0?(i(),n("div",os,[t[38]||(t[38]=e("p",{class:"text-xs text-white/50 mb-1"},"Current resolv.conf servers",-1)),e("p",as,o(a.value.dnsServers.join(", ")),1)])):v("",!0),C.value?(i(),n("p",rs,o(C.value),1)):v("",!0),e("div",ds,[e("button",{onClick:t[8]||(t[8]=s=>{g.value=!1,C.value=""}),class:"flex-1 px-3 py-2 glass-button rounded-lg text-sm"},"Cancel"),e("button",{onClick:de,class:"flex-1 px-3 py-2 glass-button rounded-lg text-sm font-medium",disabled:A.value||y.value==="custom"&&!_.value.trim()},o(A.value?"Applying...":"Apply"),9,us)])])])):v("",!0),_e(Se,{name:"fade"},{default:Ce(()=>[u.value?(i(),n("div",cs,[e("div",vs,[e("span",null,o(u.value),1),e("button",{onClick:t[10]||(t[10]=s=>u.value=""),class:"text-white/50 hover:text-white shrink-0"},"×")])])):v("",!0)]),_:1})]))}});export{ps as default};
|