mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-16 08:26:17 +00:00
Update
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -18,4 +18,6 @@ class PeerGroupsClass(BaseModel):
|
||||
class WireguardConfigurationInfo(BaseModel):
|
||||
Description: str = ''
|
||||
OverridePeerSettings: OverridePeerSettingsClass = OverridePeerSettingsClass(**{})
|
||||
PeerGroups: dict[str, PeerGroupsClass] = {}
|
||||
PeerGroups: dict[str, PeerGroupsClass] = {}
|
||||
PeerTrafficTracking: bool = True
|
||||
PeerHistoricalEndpointTracking: bool = True
|
||||
Reference in New Issue
Block a user