diff options
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 30 |
1 files changed, 29 insertions, 1 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 de800c87e..745238647 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 | |||
@@ -36,6 +36,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
36 | resolutions: { id: string, label: string, description?: string }[] = [] | 36 | resolutions: { id: string, label: string, description?: string }[] = [] |
37 | liveResolutions: { id: string, label: string, description?: string }[] = [] | 37 | liveResolutions: { id: string, label: string, description?: string }[] = [] |
38 | transcodingThreadOptions: { label: string, value: number }[] = [] | 38 | transcodingThreadOptions: { label: string, value: number }[] = [] |
39 | liveMaxDurationOptions: { label: string, value: number }[] = [] | ||
39 | 40 | ||
40 | languageItems: SelectOptionsItem[] = [] | 41 | languageItems: SelectOptionsItem[] = [] |
41 | categoryItems: SelectOptionsItem[] = [] | 42 | categoryItems: SelectOptionsItem[] = [] |
@@ -92,6 +93,14 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
92 | { value: 4, label: '4' }, | 93 | { value: 4, label: '4' }, |
93 | { value: 8, label: '8' } | 94 | { value: 8, label: '8' } |
94 | ] | 95 | ] |
96 | |||
97 | this.liveMaxDurationOptions = [ | ||
98 | { value: 0, label: $localize`No limit` }, | ||
99 | { value: 1000 * 3600, label: $localize`1 hour` }, | ||
100 | { value: 1000 * 3600 * 3, label: $localize`3 hours` }, | ||
101 | { value: 1000 * 3600 * 5, label: $localize`5 hours` }, | ||
102 | { value: 1000 * 3600 * 10, label: $localize`10 hours` } | ||
103 | ] | ||
95 | } | 104 | } |
96 | 105 | ||
97 | get videoQuotaOptions () { | 106 | get videoQuotaOptions () { |
@@ -114,7 +123,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
114 | ngOnInit () { | 123 | ngOnInit () { |
115 | this.serverConfig = this.serverService.getTmpConfig() | 124 | this.serverConfig = this.serverService.getTmpConfig() |
116 | this.serverService.getConfig() | 125 | this.serverService.getConfig() |
117 | .subscribe(config => this.serverConfig = config) | 126 | .subscribe(config => { |
127 | this.serverConfig = config | ||
128 | }) | ||
118 | 129 | ||
119 | const formGroupData: { [key in keyof CustomConfig ]: any } = { | 130 | const formGroupData: { [key in keyof CustomConfig ]: any } = { |
120 | instance: { | 131 | instance: { |
@@ -204,6 +215,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
204 | live: { | 215 | live: { |
205 | enabled: null, | 216 | enabled: null, |
206 | 217 | ||
218 | maxDuration: null, | ||
219 | allowReplay: null, | ||
220 | |||
207 | transcoding: { | 221 | transcoding: { |
208 | enabled: null, | 222 | enabled: null, |
209 | threads: TRANSCODING_THREADS_VALIDATOR, | 223 | threads: TRANSCODING_THREADS_VALIDATOR, |
@@ -341,6 +355,20 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
341 | } | 355 | } |
342 | } | 356 | } |
343 | 357 | ||
358 | hasConsistentOptions () { | ||
359 | if (this.hasLiveAllowReplayConsistentOptions()) return true | ||
360 | |||
361 | return false | ||
362 | } | ||
363 | |||
364 | hasLiveAllowReplayConsistentOptions () { | ||
365 | if (this.isTranscodingEnabled() === false && this.isLiveEnabled() && this.form.value['live']['allowReplay'] === true) { | ||
366 | return false | ||
367 | } | ||
368 | |||
369 | return true | ||
370 | } | ||
371 | |||
344 | private updateForm () { | 372 | private updateForm () { |
345 | this.form.patchValue(this.customConfig) | 373 | this.form.patchValue(this.customConfig) |
346 | } | 374 | } |