From fd206f0b2d7e5c8e00e2817266d90ec54f79e1da Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 17 Jan 2018 10:32:03 +0100 Subject: Add ability to update some configuration keys --- .../shared/forms/form-validators/custom-config.ts | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 client/src/app/shared/forms/form-validators/custom-config.ts (limited to 'client/src/app/shared/forms') diff --git a/client/src/app/shared/forms/form-validators/custom-config.ts b/client/src/app/shared/forms/form-validators/custom-config.ts new file mode 100644 index 000000000..17ae0e75c --- /dev/null +++ b/client/src/app/shared/forms/form-validators/custom-config.ts @@ -0,0 +1,35 @@ +import { Validators } from '@angular/forms' + +export const CACHE_PREVIEWS_SIZE = { + VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], + MESSAGES: { + 'required': 'Preview cache size is required.', + 'min': 'Preview cache size must be greater than 1.', + 'pattern': 'Preview cache size must be a number.' + } +} + +export const SIGNUP_LIMIT = { + VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ], + MESSAGES: { + 'required': 'Signup limit is required.', + 'min': 'Signup limit must be greater than 1.', + 'pattern': 'Preview cache size must be a number.' + } +} + +export const ADMIN_EMAIL = { + VALIDATORS: [ Validators.required, Validators.email ], + MESSAGES: { + 'required': 'Admin email is required.', + 'email': 'Admin email must be valid.' + } +} + +export const TRANSCODING_THREADS = { + VALIDATORS: [ Validators.required, Validators.min(1) ], + MESSAGES: { + 'required': 'Transcoding threads is required.', + 'min': 'Transcoding threads must be greater than 1.' + } +} -- cgit v1.2.3