mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 00:06:18 +00:00
Still need to work on validation
This commit is contained in:
@@ -170,7 +170,7 @@ class DashboardConfig:
|
||||
|
||||
self.DashboardAPIKeys = self.__getAPIKeys()
|
||||
|
||||
def __configValidation(self, section : str, key: str, value: Any) -> [bool, str]:
|
||||
def __configValidation(self, section : str, key: str, value: Any) -> tuple[bool, str]:
|
||||
if (type(value) is str and len(value) == 0
|
||||
and section not in ['Email', 'WireGuardConfiguration'] and
|
||||
(section == 'Peer' and key == 'peer_global_dns')):
|
||||
|
@@ -1109,6 +1109,13 @@ class WireguardConfiguration:
|
||||
def updateConfigurationInfo(self, key: str, value) -> tuple[bool, str] | tuple[bool, None]:
|
||||
if key == "Description":
|
||||
self.configurationInfo.Description = value
|
||||
elif key == "OverridePeerSettings":
|
||||
for key in value.keys():
|
||||
if key == "DNS" and value.get("DNS"):
|
||||
pass
|
||||
|
||||
self.configurationInfo.OverridePeerSettings = (
|
||||
self.configurationInfo.OverridePeerSettings.model_validate(value))
|
||||
else:
|
||||
return False, "Key does not exist"
|
||||
|
||||
|
Reference in New Issue
Block a user