From 9ca3ae0caa2f67fde2231976ce3283a1336d29c1 Mon Sep 17 00:00:00 2001 From: Joshua Date: Tue, 19 Jul 2022 19:11:42 +1000 Subject: [PATCH] remove cycle from table --- back/pialert.py | 9 +++++++-- front/deviceDetails.php | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index d7a329d9..8d69f575 100644 --- a/back/pialert.py +++ b/back/pialert.py @@ -711,15 +711,20 @@ def print_scan_stats (): sql.execute("SELECT * FROM Devices") History_All = sql.fetchall() History_All_Devices = len(History_All) + sql.execute("SELECT * FROM Devices WHERE dev_Archived = 1") History_Archived = sql.fetchall() History_Archived_Devices = len(History_Archived) + sql.execute("""SELECT * FROM CurrentScan WHERE cur_ScanCycle = ? """, (cycle,)) History_Online = sql.fetchall() History_Online_Devices = len(History_Online) History_Offline_Devices = History_All_Devices - History_Archived_Devices - History_Online_Devices - sql.execute ("INSERT INTO Online_History (Scan_Date, Online_Devices, Down_Devices, All_Devices, Archived_Devices, ScanCycle) "+ - "VALUES ( ?, ?, ?, ?, ?, ?)", (startTime, History_Online_Devices, History_Offline_Devices, History_All_Devices, History_Archived_Devices, cycle ) ) + + + + sql.execute ("INSERT INTO Online_History (Scan_Date, Online_Devices, Down_Devices, All_Devices, Archived_Devices) "+ + "VALUES ( ?, ?, ?, ?, ?)", (startTime, History_Online_Devices, History_Offline_Devices, History_All_Devices, History_Archived_Devices ) ) #------------------------------------------------------------------------------- def create_new_devices (): diff --git a/front/deviceDetails.php b/front/deviceDetails.php index 0be317bf..3efff81d 100644 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -314,9 +314,9 @@