X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fforms%2Fform-validators%2Fcustom-config-validators.service.ts;h=767e3f026844632ae6a786067a7c79196de6e8ec;hb=e1b49ee534108ba8ac98dcb209d2efcbf1ecd678;hp=882e39453c982afd864f0b5f108f48f32963583f;hpb=10a105f0c8620b2742eb357b69dd516a9ddf5798;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts b/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts index 882e39453..767e3f026 100644 --- a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts +++ b/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts @@ -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') + } + } } }