X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fform-validators%2Fcustom-config-validators.ts;h=d6ce6db22dc63496580fd8728c6fba8454e2682a;hb=4e55c132a007aa5466e1ac95a998df3ca88f3fb7;hp=41b3cbba9a6e9717c0dfdbb826739b24f19db4ac;hpb=7ed1edbbe4ffbef28093e4f5630751cb652814e4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/form-validators/custom-config-validators.ts b/client/src/app/shared/form-validators/custom-config-validators.ts index 41b3cbba9..d6ce6db22 100644 --- a/client/src/app/shared/form-validators/custom-config-validators.ts +++ b/client/src/app/shared/form-validators/custom-config-validators.ts @@ -65,6 +65,38 @@ export const TRANSCODING_THREADS_VALIDATOR: BuildFormValidator = { } } +export const MAX_LIVE_DURATION_VALIDATOR: BuildFormValidator = { + VALIDATORS: [Validators.required, Validators.min(-1)], + MESSAGES: { + 'required': $localize`Max live duration is required.`, + 'min': $localize`Max live duration should be greater or equal to -1.` + } +} + +export const MAX_INSTANCE_LIVES_VALIDATOR: BuildFormValidator = { + VALIDATORS: [Validators.required, Validators.min(-1)], + MESSAGES: { + 'required': $localize`Max instance lives is required.`, + 'min': $localize`Max instance lives should be greater or equal to -1.` + } +} + +export const MAX_USER_LIVES_VALIDATOR: BuildFormValidator = { + VALIDATORS: [Validators.required, Validators.min(-1)], + MESSAGES: { + 'required': $localize`Max user lives is required.`, + 'min': $localize`Max user lives should be greater or equal to -1.` + } +} + +export const CONCURRENCY_VALIDATOR: BuildFormValidator = { + VALIDATORS: [Validators.required, Validators.min(1)], + MESSAGES: { + 'required': $localize`Concurrency is required.`, + 'min': $localize`Concurrency should be greater or equal to 1.` + } +} + export const INDEX_URL_VALIDATOR: BuildFormValidator = { VALIDATORS: [Validators.pattern(/^https:\/\//)], MESSAGES: {