add threshold counters

This commit is contained in:
Alex Holliday committed 2026-02-14 21:49:32 +00:00
1 parent 97ace1e058
commit 9c467c763d
4 files changed
+32

No files matched your search

+4
View File
@@ -47,9 +47,13 @@ export interface Monitor {
notifications: string[];
secret?: string;
cpuAlertThreshold: number;
cpuAlertCounter: number;
memoryAlertThreshold: number;
memoryAlertCounter: number;
diskAlertThreshold: number;
diskAlertCounter: number;
tempAlertThreshold: number;
tempAlertCounter: number;
selectedDisks: string[];
gameId?: string;
group: string | null;
+16
View File
@@ -125,18 +125,34 @@ const MonitorSchema = new Schema<MonitorDocument>(
type: Number,
default: 100,
},
cpuAlertCounter: {
type: Number,
default: 5,
},
memoryAlertThreshold: {
type: Number,
default: 100,
},
memoryAlertCounter: {
type: Number,
default: 5,
},
diskAlertThreshold: {
type: Number,
default: 100,
},
diskAlertCounter: {
type: Number,
default: 5,
},
tempAlertThreshold: {
type: Number,
default: 100,
},
tempAlertCounter: {
type: Number,
default: 5,
},
selectedDisks: {
type: [String],
default: [],
@@ -318,9 +318,13 @@ class MongoMonitorsRepository implements IMonitorsRepository {
notifications: notificationIds,
secret: doc.secret ?? undefined,
cpuAlertThreshold: doc.cpuAlertThreshold,
cpuAlertCounter: doc.cpuAlertCounter,
memoryAlertThreshold: doc.memoryAlertThreshold,
memoryAlertCounter: doc.memoryAlertCounter,
diskAlertThreshold: doc.diskAlertThreshold,
diskAlertCounter: doc.diskAlertCounter,
tempAlertThreshold: doc.tempAlertThreshold,
tempAlertCounter: doc.tempAlertCounter,
selectedDisks: doc.selectedDisks ?? [],
gameId: doc.gameId ?? undefined,
group: doc.group ?? null,
@@ -369,9 +373,13 @@ class MongoMonitorsRepository implements IMonitorsRepository {
notifications: notificationIds,
secret: doc.secret ?? undefined,
cpuAlertThreshold: doc.cpuAlertThreshold,
cpuAlertCounter: doc.cpuAlertCounter,
memoryAlertThreshold: doc.memoryAlertThreshold,
memoryAlertCounter: doc.memoryAlertCounter,
diskAlertThreshold: doc.diskAlertThreshold,
diskAlertCounter: doc.diskAlertCounter,
tempAlertThreshold: doc.tempAlertThreshold,
tempAlertCounter: doc.tempAlertCounter,
selectedDisks: doc.selectedDisks ?? [],
gameId: doc.gameId ?? undefined,
group: doc.group ?? null,
+4
View File
@@ -33,9 +33,13 @@ export interface Monitor {
notifications: string[];
secret?: string;
cpuAlertThreshold: number;
cpuAlertCounter: number;
memoryAlertThreshold: number;
memoryAlertCounter: number;
diskAlertThreshold: number;
diskAlertCounter: number;
tempAlertThreshold: number;
tempAlertCounter: number;
selectedDisks: string[];
gameId?: string;
group: string | null;