diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 51 |
1 files changed, 20 insertions, 31 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 9b3bd86f1..4983b0425 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -14,37 +14,10 @@ import { BuildFormDefaultValues, FormValidatorService } from '@app/shared/forms/ | |||
14 | styleUrls: [ './edit-custom-config.component.scss' ] | 14 | styleUrls: [ './edit-custom-config.component.scss' ] |
15 | }) | 15 | }) |
16 | export class EditCustomConfigComponent extends FormReactive implements OnInit { | 16 | export class EditCustomConfigComponent extends FormReactive implements OnInit { |
17 | static videoQuotaOptions = [ | ||
18 | { value: -1, label: 'Unlimited' }, | ||
19 | { value: 0, label: '0' }, | ||
20 | { value: 100 * 1024 * 1024, label: '100MB' }, | ||
21 | { value: 500 * 1024 * 1024, label: '500MB' }, | ||
22 | { value: 1024 * 1024 * 1024, label: '1GB' }, | ||
23 | { value: 5 * 1024 * 1024 * 1024, label: '5GB' }, | ||
24 | { value: 20 * 1024 * 1024 * 1024, label: '20GB' }, | ||
25 | { value: 50 * 1024 * 1024 * 1024, label: '50GB' } | ||
26 | ] | ||
27 | static videoQuotaDailyOptions = [ | ||
28 | { value: -1, label: 'Unlimited' }, | ||
29 | { value: 0, label: '0' }, | ||
30 | { value: 10 * 1024 * 1024, label: '10MB' }, | ||
31 | { value: 50 * 1024 * 1024, label: '50MB' }, | ||
32 | { value: 100 * 1024 * 1024, label: '100MB' }, | ||
33 | { value: 500 * 1024 * 1024, label: '500MB' }, | ||
34 | { value: 2 * 1024 * 1024 * 1024, label: '2GB' }, | ||
35 | { value: 5 * 1024 * 1024 * 1024, label: '5GB' } | ||
36 | ] | ||
37 | |||
38 | customConfig: CustomConfig | 17 | customConfig: CustomConfig |
39 | resolutions = [ '240p', '360p', '480p', '720p', '1080p' ] | ||
40 | 18 | ||
41 | transcodingThreadOptions = [ | 19 | resolutions: string[] = [] |
42 | { value: 0, label: 'Auto (via ffmpeg)' }, | 20 | transcodingThreadOptions: { label: string, value: number }[] = [] |
43 | { value: 1, label: '1' }, | ||
44 | { value: 2, label: '2' }, | ||
45 | { value: 4, label: '4' }, | ||
46 | { value: 8, label: '8' } | ||
47 | ] | ||
48 | 21 | ||
49 | private oldCustomJavascript: string | 22 | private oldCustomJavascript: string |
50 | private oldCustomCSS: string | 23 | private oldCustomCSS: string |
@@ -60,14 +33,30 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
60 | private i18n: I18n | 33 | private i18n: I18n |
61 | ) { | 34 | ) { |
62 | super() | 35 | super() |
36 | |||
37 | this.resolutions = [ | ||
38 | this.i18n('240p'), | ||
39 | this.i18n('360p'), | ||
40 | this.i18n('480p'), | ||
41 | this.i18n('720p'), | ||
42 | this.i18n('1080p') | ||
43 | ] | ||
44 | |||
45 | this.transcodingThreadOptions = [ | ||
46 | { value: 0, label: this.i18n('Auto (via ffmpeg)') }, | ||
47 | { value: 1, label: '1' }, | ||
48 | { value: 2, label: '2' }, | ||
49 | { value: 4, label: '4' }, | ||
50 | { value: 8, label: '8' } | ||
51 | ] | ||
63 | } | 52 | } |
64 | 53 | ||
65 | get videoQuotaOptions () { | 54 | get videoQuotaOptions () { |
66 | return EditCustomConfigComponent.videoQuotaOptions | 55 | return this.configService.videoQuotaOptions |
67 | } | 56 | } |
68 | 57 | ||
69 | get videoQuotaDailyOptions () { | 58 | get videoQuotaDailyOptions () { |
70 | return EditCustomConfigComponent.videoQuotaDailyOptions | 59 | return this.configService.videoQuotaDailyOptions |
71 | } | 60 | } |
72 | 61 | ||
73 | getResolutionKey (resolution: string) { | 62 | getResolutionKey (resolution: string) { |