- {alertData.invert ? (
+ {alertKey === "NetworkMonitorCert" ? (
+
+ Expires within{" "}
+
+
+
+
+ ) : alertData.invert ? (
Average drops below{" "}
@@ -386,6 +393,8 @@ export function AlertContent({
if (!Number.isNaN(val)) {
// keep values on the step grid so the unit can be inferred on reload
if (unit) val = roundToStep(val, inputStep)
+ // certificate thresholds are whole days
+ else if (alertKey === "NetworkMonitorCert") val = Math.round(val)
if (valueMax != null) val = Math.min(val, valueMax)
if (inputMin != null) val = Math.max(val, inputMin)
setValue(val)
diff --git a/internal/site/src/lib/alerts.ts b/internal/site/src/lib/alerts.ts
index 39c6a0f32..f19c0e830 100644
--- a/internal/site/src/lib/alerts.ts
+++ b/internal/site/src/lib/alerts.ts
@@ -1,5 +1,5 @@
import { t } from "@lingui/core/macro"
-import { ContainerIcon, CpuIcon, HardDriveIcon, MemoryStickIcon, NetworkIcon, ServerCrashIcon, ServerIcon } from "lucide-react"
+import { ContainerIcon, CpuIcon, HardDriveIcon, MemoryStickIcon, NetworkIcon, ServerCrashIcon, ServerIcon, ShieldCheckIcon } from "lucide-react"
import type { RecordSubscription } from "pocketbase"
import { EthernetIcon, GpuIcon } from "@/components/ui/icons"
import { $alerts } from "@/lib/stores"
@@ -71,6 +71,16 @@ export const alertInfo: Record = {
step: 0.1,
start: 5,
},
+ NetworkMonitorCert: {
+ name: () => t`Certificate Expiration`,
+ unit: " days",
+ icon: ShieldCheckIcon,
+ desc: () => t`Triggers when an HTTPS certificate nears expiration`,
+ noDuration: true,
+ min: 1,
+ max: 365,
+ start: 14,
+ },
GPU: {
name: () => t`GPU Usage`,
unit: "%",