diff --git a/frontend-modern/src/components/Alerts/ResourceTable.tsx b/frontend-modern/src/components/Alerts/ResourceTable.tsx index 60b44503b..e0265ebac 100644 --- a/frontend-modern/src/components/Alerts/ResourceTable.tsx +++ b/frontend-modern/src/components/Alerts/ResourceTable.tsx @@ -204,7 +204,7 @@ export function ResourceTable(props: ResourceTableProps) { }> { @@ -436,7 +436,7 @@ export function ResourceTable(props: ResourceTableProps) { }> props.setEditingThresholds({ diff --git a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx index 7bce117f4..29af2e70a 100644 --- a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx +++ b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx @@ -109,14 +109,17 @@ export function ThresholdsTable(props: ThresholdsTableProps) { const formatMetricValue = (metric: string, value: number | undefined): string => { if (value === undefined || value === null) return '0'; + // Show "Off" for disabled thresholds (0 or negative values) + if (value <= 0) return 'Off'; + // Percentage-based metrics if (metric === 'cpu' || metric === 'memory' || metric === 'disk' || metric === 'usage') { return `${value}%`; } - // MB/s metrics - show "Off" for 0 values + // MB/s metrics if (metric === 'diskRead' || metric === 'diskWrite' || metric === 'networkIn' || metric === 'networkOut') { - return value === 0 ? 'Off' : `${value} MB/s`; + return `${value} MB/s`; } return String(value); @@ -617,6 +620,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) {
Default thresholds for all resources. Individual resources can override these values below. + Enter 0 or -1 to disable specific alerts.
| { props.setGuestDefaults((prev) => ({...prev, cpu: parseInt(e.currentTarget.value) || 0})); props.setHasUnsavedChanges(true); @@ -653,7 +658,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -667,7 +672,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -682,7 +687,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -696,7 +701,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -710,7 +715,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -724,7 +729,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -741,7 +746,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -755,7 +760,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -769,7 +774,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { @@ -794,7 +799,7 @@ export function ThresholdsTable(props: ThresholdsTableProps) { | { |