mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 08:16:17 +00:00
Update
This commit is contained in:
@@ -13,6 +13,11 @@ def ConnectionString(database) -> str or None:
|
||||
cn = f'mysql+mysqldb://{parser.get("Database", "username")}:{parser.get("Database", "password")}@{parser.get("Database", "host")}/{database}'
|
||||
else:
|
||||
cn = f'sqlite:///{os.path.join(sqlitePath, f"{database}.db")}'
|
||||
if not database_exists(cn):
|
||||
create_database(cn)
|
||||
try:
|
||||
if not database_exists(cn):
|
||||
create_database(cn)
|
||||
except Exception as e:
|
||||
print("[WGDashboard] Database error: " + str(e))
|
||||
exit(1)
|
||||
|
||||
return cn
|
@@ -85,6 +85,7 @@ class DashboardClientsPeerAssignment:
|
||||
self.wireguardConfigurations[a['ConfigurationName']].Peers)
|
||||
for p in peer:
|
||||
peers.append({
|
||||
'protocol': self.wireguardConfigurations[a['ConfigurationName']].Protocol,
|
||||
'id': p.id,
|
||||
'private_key': p.private_key,
|
||||
'name': p.name,
|
||||
|
Reference in New Issue
Block a user