aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-08 15:16:01 +0200
committerChocobozzz <me@florianbigard.com>2021-04-08 15:16:01 +0200
commitdc48fdbe68e9dd3a3a6028181e61d8595d98e654 (patch)
treeb641873412bfb4ff2a754a27762cd533c735e7d8 /client/src/app/+admin
parent27ec473f5306621643fcb169be7cfe6b15136265 (diff)
parentb9244002fcc48dda7f3a588980d910a40429238f (diff)
downloadPeerTube-dc48fdbe68e9dd3a3a6028181e61d8595d98e654.tar.gz
PeerTube-dc48fdbe68e9dd3a3a6028181e61d8595d98e654.tar.zst
PeerTube-dc48fdbe68e9dd3a3a6028181e61d8595d98e654.zip
Merge branch 'release/3.1.0' into develop
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts14
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts13
4 files changed, 23 insertions, 8 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
index 5d826fbe9..10d5278c1 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.html
@@ -153,7 +153,7 @@
153 <my-select-options 153 <my-select-options
154 id="liveTranscodingProfile" 154 id="liveTranscodingProfile"
155 formControlName="profile" 155 formControlName="profile"
156 [items]="getAvailableTranscodingProfile()" 156 [items]="transcodingProfiles"
157 [clearable]="false" 157 [clearable]="false"
158 > 158 >
159 </my-select-options> 159 </my-select-options>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts
index 3328d28a9..72372ffac 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-live-configuration.component.ts
@@ -1,6 +1,6 @@
1 1
2import { SelectOptionsItem } from 'src/types/select-options-item.model' 2import { SelectOptionsItem } from 'src/types/select-options-item.model'
3import { Component, Input, OnInit } from '@angular/core' 3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { ServerConfig } from '@shared/models' 5import { ServerConfig } from '@shared/models'
6import { ConfigService } from '../shared/config.service' 6import { ConfigService } from '../shared/config.service'
@@ -11,12 +11,14 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
11 templateUrl: './edit-live-configuration.component.html', 11 templateUrl: './edit-live-configuration.component.html',
12 styleUrls: [ './edit-custom-config.component.scss' ] 12 styleUrls: [ './edit-custom-config.component.scss' ]
13}) 13})
14export class EditLiveConfigurationComponent implements OnInit { 14export class EditLiveConfigurationComponent implements OnInit, OnChanges {
15 @Input() form: FormGroup 15 @Input() form: FormGroup
16 @Input() formErrors: any 16 @Input() formErrors: any
17 @Input() serverConfig: ServerConfig 17 @Input() serverConfig: ServerConfig
18 18
19 transcodingThreadOptions: SelectOptionsItem[] = [] 19 transcodingThreadOptions: SelectOptionsItem[] = []
20 transcodingProfiles: SelectOptionsItem[] = []
21
20 liveMaxDurationOptions: SelectOptionsItem[] = [] 22 liveMaxDurationOptions: SelectOptionsItem[] = []
21 liveResolutions: ResolutionOption[] = [] 23 liveResolutions: ResolutionOption[] = []
22 24
@@ -39,7 +41,13 @@ export class EditLiveConfigurationComponent implements OnInit {
39 this.liveResolutions = this.editConfigurationService.getLiveResolutions() 41 this.liveResolutions = this.editConfigurationService.getLiveResolutions()
40 } 42 }
41 43
42 getAvailableTranscodingProfile () { 44 ngOnChanges (changes: SimpleChanges) {
45 if (changes['serverConfig']) {
46 this.transcodingProfiles = this.buildAvailableTranscodingProfile()
47 }
48 }
49
50 buildAvailableTranscodingProfile () {
43 const profiles = this.serverConfig.live.transcoding.availableProfiles 51 const profiles = this.serverConfig.live.transcoding.availableProfiles
44 52
45 return profiles.map(p => { 53 return profiles.map(p => {
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
index cf13b27bb..1c5d6a9b4 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.html
@@ -181,7 +181,7 @@
181 <my-select-options 181 <my-select-options
182 id="transcodingProfile" 182 id="transcodingProfile"
183 formControlName="profile" 183 formControlName="profile"
184 [items]="getAvailableTranscodingProfile()" 184 [items]="transcodingProfiles"
185 [clearable]="false" 185 [clearable]="false"
186 ></my-select-options> 186 ></my-select-options>
187 187
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts
index b864f1bc4..a2dc3e52a 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-vod-transcoding.component.ts
@@ -1,6 +1,6 @@
1 1
2import { SelectOptionsItem } from 'src/types/select-options-item.model' 2import { SelectOptionsItem } from 'src/types/select-options-item.model'
3import { Component, Input, OnInit } from '@angular/core' 3import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
4import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
5import { ServerConfig } from '@shared/models' 5import { ServerConfig } from '@shared/models'
6import { ConfigService } from '../shared/config.service' 6import { ConfigService } from '../shared/config.service'
@@ -11,12 +11,13 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
11 templateUrl: './edit-vod-transcoding.component.html', 11 templateUrl: './edit-vod-transcoding.component.html',
12 styleUrls: [ './edit-custom-config.component.scss' ] 12 styleUrls: [ './edit-custom-config.component.scss' ]
13}) 13})
14export class EditVODTranscodingComponent implements OnInit { 14export class EditVODTranscodingComponent implements OnInit, OnChanges {
15 @Input() form: FormGroup 15 @Input() form: FormGroup
16 @Input() formErrors: any 16 @Input() formErrors: any
17 @Input() serverConfig: ServerConfig 17 @Input() serverConfig: ServerConfig
18 18
19 transcodingThreadOptions: SelectOptionsItem[] = [] 19 transcodingThreadOptions: SelectOptionsItem[] = []
20 transcodingProfiles: SelectOptionsItem[] = []
20 resolutions: ResolutionOption[] = [] 21 resolutions: ResolutionOption[] = []
21 22
22 constructor ( 23 constructor (
@@ -31,7 +32,13 @@ export class EditVODTranscodingComponent implements OnInit {
31 this.checkTranscodingFields() 32 this.checkTranscodingFields()
32 } 33 }
33 34
34 getAvailableTranscodingProfile () { 35 ngOnChanges (changes: SimpleChanges) {
36 if (changes['serverConfig']) {
37 this.transcodingProfiles = this.buildAvailableTranscodingProfile()
38 }
39 }
40
41 buildAvailableTranscodingProfile () {
35 const profiles = this.serverConfig.transcoding.availableProfiles 42 const profiles = this.serverConfig.transcoding.availableProfiles
36 43
37 return profiles.map(p => { 44 return profiles.map(p => {