aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/forms/form-validators/custom-config.ts
blob: 9e3fa98d826f9b678ebb63f5f2350507202a5b3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { Validators } from '@angular/forms'

export const INSTANCE_NAME = {
  VALIDATORS: [ Validators.required ],
  MESSAGES: {
    'required': 'Instance name is required.',
  }
}

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.'
  }
}