X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fconfig%2Fedit-custom-config%2Fedit-custom-config.component.ts;h=de1cf46b141114aac523cb1b3805b87119a80685;hb=a056ca4813c82f490dcd31ac97a64d6bf76d3dcc;hp=de800c87ef06aa6ef00be6be5103a339c157dd92;hpb=c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e;p=github%2FChocobozzz%2FPeerTube.git 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..de1cf46b1 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 resolutions: { id: string, label: string, description?: string }[] = [] liveResolutions: { id: string, label: string, description?: string }[] = [] transcodingThreadOptions: { label: string, value: number }[] = [] + liveMaxDurationOptions: { label: string, value: number }[] = [] languageItems: SelectOptionsItem[] = [] categoryItems: SelectOptionsItem[] = [] @@ -92,6 +93,14 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A { value: 4, label: '4' }, { value: 8, label: '8' } ] + + this.liveMaxDurationOptions = [ + { value: 0, label: $localize`No limit` }, + { value: 1000 * 3600, label: $localize`1 hour` }, + { value: 1000 * 3600 * 3, label: $localize`3 hours` }, + { value: 1000 * 3600 * 5, label: $localize`5 hours` }, + { value: 1000 * 3600 * 10, label: $localize`10 hours` } + ] } get videoQuotaOptions () { @@ -114,7 +123,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A ngOnInit () { this.serverConfig = this.serverService.getTmpConfig() this.serverService.getConfig() - .subscribe(config => this.serverConfig = config) + .subscribe(config => { + this.serverConfig = config + }) const formGroupData: { [key in keyof CustomConfig ]: any } = { instance: { @@ -204,6 +215,11 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A live: { enabled: null, + maxDuration: null, + maxInstanceLives: null, + maxUserLives: null, + allowReplay: null, + transcoding: { enabled: null, threads: TRANSCODING_THREADS_VALIDATOR, @@ -341,6 +357,20 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A } } + hasConsistentOptions () { + if (this.hasLiveAllowReplayConsistentOptions()) return true + + return false + } + + hasLiveAllowReplayConsistentOptions () { + if (this.isTranscodingEnabled() === false && this.isLiveEnabled() && this.form.value['live']['allowReplay'] === true) { + return false + } + + return true + } + private updateForm () { this.form.patchValue(this.customConfig) }