]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/forms/form-validators/custom-config.ts
Add video channel management
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / forms / form-validators / custom-config.ts
CommitLineData
fd206f0b
C
1import { Validators } from '@angular/forms'
2
66b16caf
C
3export const INSTANCE_NAME = {
4 VALIDATORS: [ Validators.required ],
5 MESSAGES: {
36f9424f 6 'required': 'Instance name is required.'
2e3a0215
C
7 }
8}
9
10export const INSTANCE_SHORT_DESCRIPTION = {
11 VALIDATORS: [ Validators.max(250) ],
12 MESSAGES: {
13 'max': 'Short description should not be longer than 250 characters.'
66b16caf
C
14 }
15}
16
fd206f0b
C
17export const CACHE_PREVIEWS_SIZE = {
18 VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
19 MESSAGES: {
20 'required': 'Preview cache size is required.',
21 'min': 'Preview cache size must be greater than 1.',
22 'pattern': 'Preview cache size must be a number.'
23 }
24}
25
26export const SIGNUP_LIMIT = {
27 VALIDATORS: [ Validators.required, Validators.min(1), Validators.pattern('[0-9]+') ],
28 MESSAGES: {
29 'required': 'Signup limit is required.',
30 'min': 'Signup limit must be greater than 1.',
31 'pattern': 'Preview cache size must be a number.'
32 }
33}
34
35export const ADMIN_EMAIL = {
36 VALIDATORS: [ Validators.required, Validators.email ],
37 MESSAGES: {
38 'required': 'Admin email is required.',
39 'email': 'Admin email must be valid.'
40 }
41}
42
43export const TRANSCODING_THREADS = {
44 VALIDATORS: [ Validators.required, Validators.min(1) ],
45 MESSAGES: {
46 'required': 'Transcoding threads is required.',
47 'min': 'Transcoding threads must be greater than 1.'
48 }
49}