]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/form-validators/custom-config-validators.ts
Merge branch 'release/3.2.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / form-validators / custom-config-validators.ts
index 23f2156c2586896465c0106c25942e93c15b31f7..1ed5700ff7fe8a68a555a8051cf7b62d700e25ef 100644 (file)
@@ -44,11 +44,20 @@ export const SIGNUP_LIMIT_VALIDATOR: BuildFormValidator = {
   VALIDATORS: [Validators.required, Validators.min(-1), Validators.pattern('-?[0-9]+')],
   MESSAGES: {
     'required': $localize`Signup limit is required.`,
-    'min': $localize`Signup limit must be greater than 1.`,
+    'min': $localize`Signup limit must be greater than 1. Use -1 to disable it.`,
     'pattern': $localize`Signup limit must be a number.`
   }
 }
 
+export const SIGNUP_MINIMUM_AGE_VALIDATOR: BuildFormValidator = {
+  VALIDATORS: [Validators.required, Validators.min(1), Validators.pattern('[0-9]+')],
+  MESSAGES: {
+    'required': $localize`Signup minimum age is required.`,
+    'min': $localize`Signup minimum age must be greater than 1.`,
+    'pattern': $localize`Signup minimum age must be a number.`
+  }
+}
+
 export const ADMIN_EMAIL_VALIDATOR: BuildFormValidator = {
   VALIDATORS: [Validators.required, Validators.email],
   MESSAGES: {
@@ -65,6 +74,30 @@ 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: {