mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-07-03 11:47:00 +00:00
Update dashboard.py
This commit is contained in:
parent
812060240f
commit
ccfc1ad166
@ -414,7 +414,7 @@ class PeerShareLinks:
|
|||||||
self.Links.append(PeerShareLink(*link))
|
self.Links.append(PeerShareLink(*link))
|
||||||
|
|
||||||
def getLink(self, Configuration: str, Peer: str) -> list[PeerShareLink]:
|
def getLink(self, Configuration: str, Peer: str) -> list[PeerShareLink]:
|
||||||
self.__getSharedLinks()
|
# self.__getSharedLinks()
|
||||||
return list(filter(lambda x : x.Configuration == Configuration and x.Peer == Peer, self.Links))
|
return list(filter(lambda x : x.Configuration == Configuration and x.Peer == Peer, self.Links))
|
||||||
|
|
||||||
def getLinkByID(self, ShareID: str) -> list[PeerShareLink]:
|
def getLinkByID(self, ShareID: str) -> list[PeerShareLink]:
|
||||||
@ -2026,25 +2026,25 @@ class EmailSender:
|
|||||||
Database Connection Functions
|
Database Connection Functions
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'), check_same_thread=False)
|
sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'), check_same_thread=False)
|
||||||
# sqldb.row_factory = sqlite3.Row
|
sqldb.row_factory = sqlite3.Row
|
||||||
# cursor = sqldb.cursor()
|
# cursor = sqldb.cursor()
|
||||||
|
|
||||||
def sqlSelect(statement: str, paramters: tuple = ()) -> sqlite3.Cursor:
|
def sqlSelect(statement: str, paramters: tuple = ()) -> sqlite3.Cursor:
|
||||||
sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'))
|
|
||||||
sqldb.row_factory = sqlite3.Row
|
|
||||||
cursor = sqldb.cursor()
|
|
||||||
|
|
||||||
|
|
||||||
|
# sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'))
|
||||||
|
# sqldb.row_factory = sqlite3.Row
|
||||||
|
# cursor = sqldb.cursor()
|
||||||
|
result = []
|
||||||
with sqldb:
|
with sqldb:
|
||||||
try:
|
try:
|
||||||
|
print("[WGDashboard] SQLite Select" + " | Statement: " + statement)
|
||||||
cursor = sqldb.cursor()
|
cursor = sqldb.cursor()
|
||||||
sqldb.close()
|
result = cursor.execute(statement, paramters)
|
||||||
return cursor.execute(statement, paramters)
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print("[WGDashboard] SQLite Error:" + str(error) + " | Statement: " + statement)
|
print("[WGDashboard] SQLite Error:" + str(error) + " | Statement: " + statement)
|
||||||
sqldb.close()
|
return result
|
||||||
return []
|
|
||||||
|
|
||||||
|
|
||||||
def sqlUpdate(statement: str, paramters: tuple = ()) -> sqlite3.Cursor:
|
def sqlUpdate(statement: str, paramters: tuple = ()) -> sqlite3.Cursor:
|
||||||
sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'))
|
sqldb = sqlite3.connect(os.path.join(CONFIGURATION_PATH, 'db', 'wgdashboard.db'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user