]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/form-validators/custom-config-validators.ts
Add missing live config validators
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / form-validators / custom-config-validators.ts
index 41b3cbba9a6e9717c0dfdbb826739b24f19db4ac..d6ce6db22dc63496580fd8728c6fba8454e2682a 100644 (file)
@@ -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: {