diff --git a/src/dashboard.py b/src/dashboard.py index 0391be4..240d14d 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -164,7 +164,7 @@ class PeerJobs: except Exception as e: return False, str(e) - def updateJobConfigurationName(self, ConfigurationName: str, NewConfigurationName: str) -> tuple[bool, str]: + def updateJobConfigurationName(self, ConfigurationName: str, NewConfigurationName: str) -> tuple[bool, str] | tuple[bool, None]: try: with self.jobdb: jobdbCursor = self.jobdb.cursor() @@ -173,6 +173,7 @@ class PeerJobs: ''', (NewConfigurationName, ConfigurationName, )) self.jobdb.commit() self.__getJobs() + return True, None except Exception as e: return False, str(e) diff --git a/src/modules/SystemStatus.py b/src/modules/SystemStatus.py index 553e95d..59983e4 100644 --- a/src/modules/SystemStatus.py +++ b/src/modules/SystemStatus.py @@ -101,15 +101,16 @@ class NetworkInterfaces: self.getData() return self.interfaces +class Process: + def __init__(self, name, command, pid, percent): + self.name = name + self.command = command + self.pid = pid + self.percent = percent + def toJson(self): + return self.__dict__ + class Processes: - class Process: - def __init__(self, name, command, pid, percent): - self.name = name - self.command = command - self.pid = pid - self.percent = percent - def toJson(self): - return self.__dict__ def __init__(self): self.CPU_Top_10_Processes: list[Processes.Process] = [] self.Memory_Top_10_Processes: list[Processes.Process] = []