mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-04-20 11:46:18 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user