aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/custom-config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/forms/form-validators/custom-config.ts')
-rw-r--r--client/src/app/shared/forms/form-validators/custom-config.ts35
1 files changed, 35 insertions, 0 deletions
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 @@
1import { Validators } from '@angular/forms'
2
3export const CACHE_PREVIEWS_SIZE = {
4 VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
5 MESSAGES: {
6 'required': 'Preview cache size is required.',
7 'min': 'Preview cache size must be greater than 1.',
8 'pattern': 'Preview cache size must be a number.'
9 }
10}
11
12export const SIGNUP_LIMIT = {
13 VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
14 MESSAGES: {
15 'required': 'Signup limit is required.',
16 'min': 'Signup limit must be greater than 1.',
17 'pattern': 'Preview cache size must be a number.'
18 }
19}
20
21export const ADMIN_EMAIL = {
22 VALIDATORS: [ Validators.required, Validators.email ],
23 MESSAGES: {
24 'required': 'Admin email is required.',
25 'email': 'Admin email must be valid.'
26 }
27}
28
29export const TRANSCODING_THREADS = {
30 VALIDATORS: [ Validators.required, Validators.min(1) ],
31 MESSAGES: {
32 'required': 'Transcoding threads is required.',
33 'min': 'Transcoding threads must be greater than 1.'
34 }
35}