diff --git a/web/src/components/DashboardComponent.tsx b/web/src/components/DashboardComponent.tsx index 65984fd..a015816 100644 --- a/web/src/components/DashboardComponent.tsx +++ b/web/src/components/DashboardComponent.tsx @@ -7,20 +7,17 @@ import { Alert, AlertDescription } from './ui/alert'; import { Badge } from './ui/badge'; import { LayoutDashboard, Cloud, CheckCircle, XCircle, AlertCircle, Loader2, - RefreshCw, BookOpen, Globe, Router, Server, RotateCw, Key, + BookOpen, Globe, Router, Server, RotateCw, Key, } from 'lucide-react'; import { useCloudflare } from '../hooks/useCloudflare'; -import { useDdns } from '../hooks/useDdns'; import { useCentralStatus } from '../hooks/useCentralStatus'; import { useVpn } from '../hooks/useVpn'; import { secretsApi, dnsSettingsApi, nftablesConfigApi } from '../services/api'; import { usePageHelp } from '../hooks/usePageHelp'; -import type { DdnsRecordStatus } from '../services/api/networking'; export function DashboardComponent() { const { data: centralStatus, isLoading: statusLoading, restart: restartDaemon, isRestarting } = useCentralStatus(); const { verification, isLoading: cfLoading } = useCloudflare(); - const { status: ddnsStatus, isLoadingStatus: ddnsLoading, trigger: triggerDdns, isTriggering } = useDdns(); const { config: vpnConfig } = useVpn(); const { data: dnsSettings } = useQuery({ queryKey: ['dns', 'settings'], queryFn: () => dnsSettingsApi.get() }); const { data: nftConfig } = useQuery({ queryKey: ['nftables', 'config'], queryFn: () => nftablesConfigApi.get() }); @@ -50,8 +47,7 @@ export function DashboardComponent() { // Warning conditions const cfTokenMissing = !cfLoading && !verification?.tokenConfigured; const cfTokenInvalid = !cfLoading && verification?.tokenConfigured && !verification?.tokenValid; - const ddnsFailed = ddnsStatus?.enabled && ddnsStatus?.lastError; - const hasWarnings = cfTokenMissing || cfTokenInvalid || ddnsFailed; + const hasWarnings = cfTokenMissing || cfTokenInvalid; usePageHelp({ title: 'What is the Dashboard?', @@ -99,12 +95,6 @@ export function DashboardComponent() { Cloudflare API token is invalid. Check your token in Cloudflare settings. )} - {ddnsFailed && ( - - - DDNS sync error: {ddnsStatus.lastError} - - )} )} @@ -222,90 +212,7 @@ export function DashboardComponent() { )} - {/* 2. Dynamic DNS */} - -
-
- -
Dynamic DNS
-
-
- {ddnsLoading ? ( - - ) : ddnsStatus?.enabled ? ( - - - Active - - ) : ( - Disabled - )} -
-
- - {ddnsStatus?.enabled ? ( -
-
-
- Public IP -
{ddnsStatus.currentIP || '--'}
-
-
- Last checked -
- {ddnsStatus.lastChecked ? new Date(ddnsStatus.lastChecked).toLocaleTimeString() : '--'} -
-
-
- - {/* Record list (read-only — derived from public domains) */} - {ddnsStatus.records?.length ? ( -
- {ddnsStatus.records.map((rs: DdnsRecordStatus) => ( -
- {rs.ok ? ( - - ) : ( - - )} - {rs.name} - {rs.ok && rs.ip && ( - {rs.ip} - )} - {!rs.ok && rs.error && ( - {rs.error} - )} -
- ))} -

- Records are derived from public domains. Toggle Public on the Domains page to manage. -

-
- ) : ( -

- No public domains registered. Set a domain to Public on the Domains page to enable DDNS. -

- )} - - -
- ) : ( -

- DDNS is not enabled. Enable it in the global config to keep public domain DNS records in sync with your public IP. -

- )} -
- - {/* 3. Daemon Status */} + {/* 2. Daemon Status */}
@@ -368,7 +275,7 @@ export function DashboardComponent() { )} - {/* 4. Gateway Router */} + {/* 3. Gateway Router */}