]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/form-validators/custom-config-validators.ts
Refactor actor avatar display
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / form-validators / custom-config-validators.ts
index 41b3cbba9a6e9717c0dfdbb826739b24f19db4ac..ef6e9b456ead9148b70fe08d8a67c1e0249e1a72 100644 (file)
@@ -44,7 +44,7 @@ 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.`
   }
 }
@@ -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: {