diff --git a/src/dashboard.py b/src/dashboard.py index 07b28ea6..f08c3d3f 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -93,8 +93,10 @@ def peerInformationBackgroundThread(): c.getPeersEndpoint() c.getPeers() if delay == 6: - c.logPeersTraffic() - c.logPeersHistoryEndpoint() + 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) diff --git a/src/modules/WireguardConfiguration.py b/src/modules/WireguardConfiguration.py index 7277c8f7..f1fdfe16 100644 --- a/src/modules/WireguardConfiguration.py +++ b/src/modules/WireguardConfiguration.py @@ -1271,6 +1271,10 @@ class WireguardConfiguration: db.execute( self.peersTransferTable.delete() ) + with self.engine.connect() as conn: + if conn.dialect.name == 'sqlite': + print("[WGDashboard] SQLite Vacuuming Database") + conn.execute(sqlalchemy.text('VACUUM;')) except Exception as e: return False return True @@ -1281,6 +1285,10 @@ class WireguardConfiguration: db.execute( self.peersHistoryEndpointTable.delete() ) + with self.engine.connect() as conn: + if conn.dialect.name == 'sqlite': + print("[WGDashboard] SQLite Vacuuming Database") + conn.execute(sqlalchemy.text('VACUUM;')) except Exception as e: return False return True \ No newline at end of file diff --git a/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTrackingComponents/configurationTracking.vue b/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTrackingComponents/configurationTracking.vue index 68681f7a..70b574bd 100644 --- a/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTrackingComponents/configurationTracking.vue +++ b/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTrackingComponents/configurationTracking.vue @@ -88,7 +88,7 @@ const deleteRecord = async (key) => { {{ configuration.Name }}