Add peer tracking toggle to WireGuard dashboard

Introduces a 'peer_tracking' configuration option for WireGuard in DashboardConfig and updates the dashboard background thread to respect this setting. The Vue component now includes a UI toggle for peer tracking, updates the server configuration via API, and conditionally loads tracking data based on the toggle state.
This commit is contained in:
Donald Zou
2025-12-19 09:22:45 +08:00
parent 9ae5fea7b4
commit 87ff8afefe
3 changed files with 44 additions and 10 deletions

View File

@@ -92,11 +92,13 @@ def peerInformationBackgroundThread():
c.getPeersTransfer()
c.getPeersEndpoint()
c.getPeers()
if delay == 6:
if c.configurationInfo.PeerTrafficTracking:
c.logPeersTraffic()
if c.configurationInfo.PeerHistoricalEndpointTracking:
c.logPeersHistoryEndpoint()
if DashboardConfig.GetConfig('WireGuardConfiguration', 'peer_tracking')[1] is True:
print("[WGDashboard] Tracking Peers")
if delay == 6:
if c.configurationInfo.PeerTrafficTracking:
c.logPeersTraffic()
if c.configurationInfo.PeerHistoricalEndpointTracking:
c.logPeersHistoryEndpoint()
c.getRestrictedPeersList()
except Exception as e:
app.logger.error(f"[WGDashboard] Background Thread #1 Error", e)