feat(openwrt): add WAN diagnostics to get-status and UI
get_wan_status now returns: radio0_disabled, sta_iface (from iw dev), sta_state (operstate), assoc_ssid (actually associated SSID vs configured), and recent wifi_log lines from logread. The WAN panel shows a diagnostic grid when configured but not connected so the user can see exactly what's wrong without digging into server logs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,9 +33,14 @@ interface TollGateStatus {
|
||||
interface WanStatus {
|
||||
configured: boolean
|
||||
ssid: string
|
||||
assoc_ssid: string
|
||||
encryption: string
|
||||
ip: string
|
||||
internet: boolean
|
||||
radio0_disabled: boolean
|
||||
sta_iface: string
|
||||
sta_state: string
|
||||
wifi_log: string
|
||||
}
|
||||
|
||||
interface RouterStatus {
|
||||
@@ -356,7 +361,7 @@ onMounted(() => load())
|
||||
|
||||
<!-- Current status (idle) -->
|
||||
<template v-if="wanStep === 'idle' || wanStep === 'done'">
|
||||
<div v-if="status.wan?.configured" class="flex items-center gap-3">
|
||||
<div v-if="status.wan?.configured" class="flex items-center gap-3 mb-3">
|
||||
<span class="w-2 h-2 rounded-full inline-block flex-shrink-0"
|
||||
:class="status.wan.internet ? 'bg-green-400' : 'bg-yellow-400 animate-pulse'"></span>
|
||||
<div>
|
||||
@@ -366,10 +371,44 @@ onMounted(() => load())
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="text-sm text-white/50">
|
||||
<div v-else class="text-sm text-white/50 mb-3">
|
||||
Not configured — router has no internet access.
|
||||
</div>
|
||||
<p v-if="wanStep === 'done'" class="mt-3 text-xs text-green-400">
|
||||
|
||||
<!-- Diagnostics (shown when not connected) -->
|
||||
<dl v-if="status.wan?.configured && !status.wan.internet"
|
||||
class="grid grid-cols-2 gap-x-4 gap-y-2 text-xs mt-1 mb-3 border-t border-white/10 pt-3">
|
||||
<div>
|
||||
<dt class="text-white/30 mb-0.5">Radio</dt>
|
||||
<dd :class="status.wan.radio0_disabled ? 'text-red-400' : 'text-green-400'">
|
||||
{{ status.wan.radio0_disabled ? 'disabled' : 'enabled' }}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-white/30 mb-0.5">Interface</dt>
|
||||
<dd class="text-white/70 font-mono">
|
||||
{{ status.wan.sta_iface || 'none' }}
|
||||
<span v-if="status.wan.sta_iface" class="ml-1"
|
||||
:class="status.wan.sta_state === 'up' ? 'text-green-400' : 'text-yellow-400'">
|
||||
({{ status.wan.sta_state }})
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-white/30 mb-0.5">Associated to</dt>
|
||||
<dd class="text-white/70">{{ status.wan.assoc_ssid || 'none' }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-white/30 mb-0.5">Configured SSID</dt>
|
||||
<dd class="text-white/70">{{ status.wan.ssid || '—' }}</dd>
|
||||
</div>
|
||||
<div v-if="status.wan.wifi_log" class="col-span-2">
|
||||
<dt class="text-white/30 mb-1">Recent wifi log</dt>
|
||||
<dd class="font-mono text-white/50 text-[10px] leading-relaxed whitespace-pre-wrap break-all bg-black/20 rounded p-2">{{ status.wan.wifi_log }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<p v-if="wanStep === 'done'" class="mt-2 text-xs text-green-400">
|
||||
WAN configured. Router is connecting…
|
||||
</p>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user