Alerting: Fix max alerts (#87271)

This commit is contained in:
Gilles De Mey
2024-05-03 13:22:42 +02:00
committed by GitHub
parent 4b496a907d
commit 12fa9e56e6

View File

@@ -322,8 +322,12 @@ export const cloudNotifierTypes: Array<NotifierDTO<CloudNotifierType>> = [
'The maximum number of alerts to include in a single webhook message. Alerts above this threshold are truncated. When leaving this at its default value of 0, all alerts are included.',
{
placeholder: '0',
inputType: 'number',
validationRule: '(^\\d+$|^$)',
setValueAs: (value) => (typeof value === 'string' ? parseInt(value, 10) : 0),
setValueAs: (value) => {
const integer = Number(value);
return Number.isFinite(integer) ? integer : 0;
},
}
),
httpConfigOption,