dashboard: show LAN status in Local Services panel header
- Add lan_enabled to ServerCtx - Add lan field to /stats API (enabled, peer count) - Dashboard shows "LAN off" (dim) or "LAN on · N peers" (green) - Tooltip shows enable command or mDNS service type Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
src/api.rs
11
src/api.rs
@@ -134,6 +134,13 @@ struct StatsResponse {
|
||||
cache: CacheStats,
|
||||
overrides: OverrideStats,
|
||||
blocking: BlockingStatsResponse,
|
||||
lan: LanStatsResponse,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
struct LanStatsResponse {
|
||||
enabled: bool,
|
||||
peers: usize,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -466,6 +473,10 @@ async fn stats(State(ctx): State<Arc<ServerCtx>>) -> Json<StatsResponse> {
|
||||
domains_loaded: bl_stats.domains_loaded,
|
||||
allowlist_size: bl_stats.allowlist_size,
|
||||
},
|
||||
lan: LanStatsResponse {
|
||||
enabled: ctx.lan_enabled,
|
||||
peers: ctx.lan_peers.lock().unwrap().list().len(),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user