aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-17 10:32:03 +0100
committerChocobozzz <me@florianbigard.com>2018-01-17 10:41:27 +0100
commitfd206f0b2d7e5c8e00e2817266d90ec54f79e1da (patch)
tree86b096cf2abd7eb49b892de1c9be855f45a41a9c /client/src/app/shared
parent9581cabc596acb18c0ad86bcf3a07c2b45e8e47e (diff)
downloadPeerTube-fd206f0b2d7e5c8e00e2817266d90ec54f79e1da.tar.gz
PeerTube-fd206f0b2d7e5c8e00e2817266d90ec54f79e1da.tar.zst
PeerTube-fd206f0b2d7e5c8e00e2817266d90ec54f79e1da.zip
Add ability to update some configuration keys
Diffstat (limited to 'client/src/app/shared')
-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}