Fix updating transcoding profiles
This commit is contained in:
parent
4c7449d2ad
commit
b06f1ead3b
|
@ -153,7 +153,7 @@
|
||||||
<my-select-options
|
<my-select-options
|
||||||
id="liveTranscodingProfile"
|
id="liveTranscodingProfile"
|
||||||
formControlName="profile"
|
formControlName="profile"
|
||||||
[items]="getAvailableTranscodingProfile()"
|
[items]="transcodingProfiles"
|
||||||
[clearable]="false"
|
[clearable]="false"
|
||||||
>
|
>
|
||||||
</my-select-options>
|
</my-select-options>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
|
||||||
import { FormGroup } from '@angular/forms'
|
import { FormGroup } from '@angular/forms'
|
||||||
import { ServerConfig } from '@shared/models'
|
import { ServerConfig } from '@shared/models'
|
||||||
import { ConfigService } from '../shared/config.service'
|
import { ConfigService } from '../shared/config.service'
|
||||||
|
@ -11,12 +11,14 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
|
||||||
templateUrl: './edit-live-configuration.component.html',
|
templateUrl: './edit-live-configuration.component.html',
|
||||||
styleUrls: [ './edit-custom-config.component.scss' ]
|
styleUrls: [ './edit-custom-config.component.scss' ]
|
||||||
})
|
})
|
||||||
export class EditLiveConfigurationComponent implements OnInit {
|
export class EditLiveConfigurationComponent implements OnInit, OnChanges {
|
||||||
@Input() form: FormGroup
|
@Input() form: FormGroup
|
||||||
@Input() formErrors: any
|
@Input() formErrors: any
|
||||||
@Input() serverConfig: ServerConfig
|
@Input() serverConfig: ServerConfig
|
||||||
|
|
||||||
transcodingThreadOptions: SelectOptionsItem[] = []
|
transcodingThreadOptions: SelectOptionsItem[] = []
|
||||||
|
transcodingProfiles: SelectOptionsItem[] = []
|
||||||
|
|
||||||
liveMaxDurationOptions: SelectOptionsItem[] = []
|
liveMaxDurationOptions: SelectOptionsItem[] = []
|
||||||
liveResolutions: ResolutionOption[] = []
|
liveResolutions: ResolutionOption[] = []
|
||||||
|
|
||||||
|
@ -39,7 +41,13 @@ export class EditLiveConfigurationComponent implements OnInit {
|
||||||
this.liveResolutions = this.editConfigurationService.getLiveResolutions()
|
this.liveResolutions = this.editConfigurationService.getLiveResolutions()
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableTranscodingProfile () {
|
ngOnChanges (changes: SimpleChanges) {
|
||||||
|
if (changes['serverConfig']) {
|
||||||
|
this.transcodingProfiles = this.buildAvailableTranscodingProfile()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAvailableTranscodingProfile () {
|
||||||
const profiles = this.serverConfig.live.transcoding.availableProfiles
|
const profiles = this.serverConfig.live.transcoding.availableProfiles
|
||||||
|
|
||||||
return profiles.map(p => {
|
return profiles.map(p => {
|
||||||
|
|
|
@ -181,7 +181,7 @@
|
||||||
<my-select-options
|
<my-select-options
|
||||||
id="transcodingProfile"
|
id="transcodingProfile"
|
||||||
formControlName="profile"
|
formControlName="profile"
|
||||||
[items]="getAvailableTranscodingProfile()"
|
[items]="transcodingProfiles"
|
||||||
[clearable]="false"
|
[clearable]="false"
|
||||||
></my-select-options>
|
></my-select-options>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
import { SelectOptionsItem } from 'src/types/select-options-item.model'
|
||||||
import { Component, Input, OnInit } from '@angular/core'
|
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
|
||||||
import { FormGroup } from '@angular/forms'
|
import { FormGroup } from '@angular/forms'
|
||||||
import { ServerConfig } from '@shared/models'
|
import { ServerConfig } from '@shared/models'
|
||||||
import { ConfigService } from '../shared/config.service'
|
import { ConfigService } from '../shared/config.service'
|
||||||
|
@ -11,12 +11,13 @@ import { EditConfigurationService, ResolutionOption } from './edit-configuration
|
||||||
templateUrl: './edit-vod-transcoding.component.html',
|
templateUrl: './edit-vod-transcoding.component.html',
|
||||||
styleUrls: [ './edit-custom-config.component.scss' ]
|
styleUrls: [ './edit-custom-config.component.scss' ]
|
||||||
})
|
})
|
||||||
export class EditVODTranscodingComponent implements OnInit {
|
export class EditVODTranscodingComponent implements OnInit, OnChanges {
|
||||||
@Input() form: FormGroup
|
@Input() form: FormGroup
|
||||||
@Input() formErrors: any
|
@Input() formErrors: any
|
||||||
@Input() serverConfig: ServerConfig
|
@Input() serverConfig: ServerConfig
|
||||||
|
|
||||||
transcodingThreadOptions: SelectOptionsItem[] = []
|
transcodingThreadOptions: SelectOptionsItem[] = []
|
||||||
|
transcodingProfiles: SelectOptionsItem[] = []
|
||||||
resolutions: ResolutionOption[] = []
|
resolutions: ResolutionOption[] = []
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
@ -31,7 +32,13 @@ export class EditVODTranscodingComponent implements OnInit {
|
||||||
this.checkTranscodingFields()
|
this.checkTranscodingFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
getAvailableTranscodingProfile () {
|
ngOnChanges (changes: SimpleChanges) {
|
||||||
|
if (changes['serverConfig']) {
|
||||||
|
this.transcodingProfiles = this.buildAvailableTranscodingProfile()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAvailableTranscodingProfile () {
|
||||||
const profiles = this.serverConfig.transcoding.availableProfiles
|
const profiles = this.serverConfig.transcoding.availableProfiles
|
||||||
|
|
||||||
return profiles.map(p => {
|
return profiles.map(p => {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { DatePipe } from '@angular/common'
|
import { Component, Input, OnChanges } from '@angular/core'
|
||||||
import { Component, Input, OnChanges, OnInit } from '@angular/core'
|
|
||||||
import { FromNowPipe } from '../angular/from-now.pipe'
|
import { FromNowPipe } from '../angular/from-now.pipe'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -14,10 +13,7 @@ export class DateToggleComponent implements OnChanges {
|
||||||
dateRelative: string
|
dateRelative: string
|
||||||
dateAbsolute: string
|
dateAbsolute: string
|
||||||
|
|
||||||
constructor (
|
constructor (private fromNowPipe: FromNowPipe) { }
|
||||||
private datePipe: DatePipe,
|
|
||||||
private fromNowPipe: FromNowPipe
|
|
||||||
) { }
|
|
||||||
|
|
||||||
ngOnChanges () {
|
ngOnChanges () {
|
||||||
this.updateDates()
|
this.updateDates()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user