diff --git a/src/dashboard.py b/src/dashboard.py
index a164742c..f3626210 100644
--- a/src/dashboard.py
+++ b/src/dashboard.py
@@ -222,14 +222,7 @@ def auth_req():
if request.method.lower() == 'options':
return ResponseObject(True)
- DashboardConfig.APIAccessed = False
- # if "api" in request.path:
- # if str(request.method) == "GET":
- # DashboardLogger.log(str(request.url), str(request.remote_addr), Message=str(request.args))
- # elif str(request.method) == "POST":
- # DashboardLogger.log(str(request.url), str(request.remote_addr), Message=f"Request Args: {str(request.args)} Body:{str(request.get_json())}")
-
-
+ DashboardConfig.APIAccessed = False
authenticationRequired = DashboardConfig.GetConfig("Server", "auth_req")[1]
d = request.headers
if authenticationRequired:
@@ -1090,12 +1083,10 @@ def API_GetPeerTraffics():
interval = request.args.get('interval', 30)
startDate = request.args.get('startDate', None)
endDate = request.args.get('endDate', None)
-
if type(interval) is str:
if not interval.isdigit():
return ResponseObject(False, "Interval must be integers in minutes")
interval = int(interval)
-
if startDate is None:
endDate = None
else:
diff --git a/src/modules/WireguardConfiguration.py b/src/modules/WireguardConfiguration.py
index 8eb07003..f0b034b8 100644
--- a/src/modules/WireguardConfiguration.py
+++ b/src/modules/WireguardConfiguration.py
@@ -1195,7 +1195,7 @@ class WireguardConfiguration:
except Exception as e:
return False
- def updateConfigurationInfo(self, key: str, value: str | dict[str, str] | dict[str, dict]) -> tuple[bool, Any, str] | tuple[
+ def updateConfigurationInfo(self, key: str, value: str | dict[str, str] | dict[str, dict] | bool) -> tuple[bool, Any, str] | tuple[
bool, str, None] | tuple[bool, None, None]:
if key == "Description":
self.configurationInfo.Description = value
@@ -1214,9 +1214,12 @@ class WireguardConfiguration:
for name, data in value.items():
peerGroups[name] = PeerGroupsClass(**data)
self.configurationInfo.PeerGroups = peerGroups
+ elif key == "PeerTrafficTracking":
+ self.configurationInfo.PeerTrafficTracking = value
+ elif key == "PeerHistoricalTrafficTracking":
+ self.configurationInfo.PeerHistoricalEndpointTracking = value
else:
return False, "Key does not exist", None
-
self.storeConfigurationInfo()
return True, None, None
diff --git a/src/modules/WireguardConfigurationInfo.py b/src/modules/WireguardConfigurationInfo.py
index 03d05ca2..54efac39 100644
--- a/src/modules/WireguardConfigurationInfo.py
+++ b/src/modules/WireguardConfigurationInfo.py
@@ -18,4 +18,6 @@ class PeerGroupsClass(BaseModel):
class WireguardConfigurationInfo(BaseModel):
Description: str = ''
OverridePeerSettings: OverridePeerSettingsClass = OverridePeerSettingsClass(**{})
- PeerGroups: dict[str, PeerGroupsClass] = {}
\ No newline at end of file
+ PeerGroups: dict[str, PeerGroupsClass] = {}
+ PeerTrafficTracking: bool = True
+ PeerHistoricalEndpointTracking: bool = True
\ No newline at end of file
diff --git a/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTracking.vue b/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTracking.vue
new file mode 100644
index 00000000..f79cdd81
--- /dev/null
+++ b/src/static/app/src/components/settingsComponent/dashboardWireguardConfigurationTracking.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
\ No newline at end of file