From 754b6f5f41bdc40aaaeefdb3c351666c305abe20 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Tue, 26 Oct 2021 16:42:10 +0200 Subject: Made the video channels limit (per user) server-wide configurable (#4491) * Made the video channels limit (per user) server-wide configurable Implements https://github.com/Chocobozzz/PeerTube/issues/3092 Also added a "quota bar" in the account's settings page * Fixed lint errors * Another pass at fixing lint errors * Applied code suggestions * Removed 'video channels quota' --- .../src/app/shared/form-validators/custom-config-validators.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'client/src/app/shared/form-validators/custom-config-validators.ts') 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 fbf423d08..ba8512e95 100644 --- a/client/src/app/shared/form-validators/custom-config-validators.ts +++ b/client/src/app/shared/form-validators/custom-config-validators.ts @@ -98,6 +98,15 @@ export const MAX_USER_LIVES_VALIDATOR: BuildFormValidator = { } } +export const MAX_VIDEO_CHANNELS_PER_USER_VALIDATOR: BuildFormValidator = { + VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], + MESSAGES: { + required: $localize`Max video channels per user is required.`, + min: $localize`Max video channels per user must be greater or equal to 1.`, + pattern: $localize`Max video channels per user must be a number.` + } +} + export const CONCURRENCY_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.required, Validators.min(1) ], MESSAGES: { -- cgit v1.2.3