mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-16 16:36:17 +00:00
Update WireguardConfiguration.py
This commit is contained in:
@@ -478,7 +478,6 @@ class WireguardConfiguration:
|
|||||||
with self.engine.connect() as conn:
|
with self.engine.connect() as conn:
|
||||||
existingPeers = conn.execute(self.peersTable.select()).mappings().fetchall()
|
existingPeers = conn.execute(self.peersTable.select()).mappings().fetchall()
|
||||||
for i in existingPeers:
|
for i in existingPeers:
|
||||||
print(i)
|
|
||||||
tmpList.append(Peer(i, self))
|
tmpList.append(Peer(i, self))
|
||||||
self.Peers = tmpList
|
self.Peers = tmpList
|
||||||
|
|
||||||
@@ -784,9 +783,7 @@ class WireguardConfiguration:
|
|||||||
)
|
)
|
||||||
).mappings().fetchone()
|
).mappings().fetchone()
|
||||||
if cur_i is not None:
|
if cur_i is not None:
|
||||||
# print(cur_i is None)
|
|
||||||
total_sent = cur_i['total_sent']
|
total_sent = cur_i['total_sent']
|
||||||
# print(cur_i is None)
|
|
||||||
total_receive = cur_i['total_receive']
|
total_receive = cur_i['total_receive']
|
||||||
cur_total_sent = float(data_usage[i][2]) / (1024 ** 3)
|
cur_total_sent = float(data_usage[i][2]) / (1024 ** 3)
|
||||||
cur_total_receive = float(data_usage[i][1]) / (1024 ** 3)
|
cur_total_receive = float(data_usage[i][1]) / (1024 ** 3)
|
||||||
@@ -1227,7 +1224,6 @@ class WireguardConfiguration:
|
|||||||
def __validateOverridePeerSettings(self, key: str, value: str | int) -> tuple[bool, None] | tuple[bool, str]:
|
def __validateOverridePeerSettings(self, key: str, value: str | int) -> tuple[bool, None] | tuple[bool, str]:
|
||||||
status = True
|
status = True
|
||||||
msg = None
|
msg = None
|
||||||
print(value)
|
|
||||||
if key == "DNS" and value:
|
if key == "DNS" and value:
|
||||||
status, msg = ValidateDNSAddress(value)
|
status, msg = ValidateDNSAddress(value)
|
||||||
elif key == "EndpointAllowedIPs" and value:
|
elif key == "EndpointAllowedIPs" and value:
|
||||||
|
|||||||
Reference in New Issue
Block a user