This commit is contained in:
Donald Zou
2025-06-06 15:49:55 +08:00
parent 67a455c403
commit 69ec55b638
12 changed files with 196 additions and 35 deletions

View File

@@ -59,7 +59,14 @@ class DashboardClients:
).where(
self.dashboardClientsTable.c.DeletedDate is None)
).mappings().fetchall()
def GetClientProfile(self, ClientID):
with self.engine.connect() as conn:
return dict(conn.execute(
self.dashboardClientsInfoTable.select().where(
self.dashboardClientsInfoTable.c.ClientID == ClientID
)
).mappings().fetchone())
def SignIn(self, Email, Password) -> tuple[bool, str]:
if not all([Email, Password]):

View File

@@ -74,10 +74,8 @@ class DashboardClientsPeerAssignment:
def GetAssignedPeers(self, ClientID):
peers = []
assigned = list(
filter(lambda e:
e['ClientID'] == ClientID, self.assignments)
)
assigned = filter(lambda e:
e['ClientID'] == ClientID, self.assignments)
for a in assigned:
peer = filter(lambda e : e.id == a['PeerID'],
@@ -97,6 +95,4 @@ class DashboardClientsPeerAssignment:
'configuration_name': a['ConfigurationName'],
'peer_configuration_data': p.downloadPeer()
})
print(peers)
return peers