]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/forms/form-validators/custom-config-validators.service.ts
Implement auto follow in client
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / custom-config-validators.service.ts
index 882e39453c982afd864f0b5f108f48f32963583f..767e3f026844632ae6a786067a7c79196de6e8ec 100644 (file)
@@ -13,6 +13,7 @@ export class CustomConfigValidatorsService {
   readonly SIGNUP_LIMIT: BuildFormValidator
   readonly ADMIN_EMAIL: BuildFormValidator
   readonly TRANSCODING_THREADS: BuildFormValidator
+  readonly INDEX_URL: BuildFormValidator
 
   constructor (private i18n: I18n) {
     this.INSTANCE_NAME = {
@@ -78,5 +79,13 @@ export class CustomConfigValidatorsService {
         'min': this.i18n('Transcoding threads must be greater or equal to 0.')
       }
     }
+
+    this.INDEX_URL = {
+      VALIDATORS: [ Validators.required, Validators.pattern(/^https:\/\//) ],
+      MESSAGES: {
+        'required': this.i18n('Index URL is required.'),
+        'pattern': this.i18n('Index URL should be a URL')
+      }
+    }
   }
 }