import { ConfigService } from '@app/+admin/config/shared/config.service'
import { ServerService } from '@app/core/server/server.service'
import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { BuildFormDefaultValues, FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
protected formValidatorService: FormValidatorService,
private customConfigValidatorsService: CustomConfigValidatorsService,
private userValidatorsService: UserValidatorsService,
- private notificationsService: NotificationsService,
+ private notifier: Notifier,
private configService: ConfigService,
private serverService: ServerService,
private i18n: I18n
}
ngOnInit () {
- const formGroupData = {
+ const formGroupData: { [key: string]: any } = {
instanceName: this.customConfigValidatorsService.INSTANCE_NAME,
instanceShortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION,
instanceDescription: null,
userVideoQuota: this.userValidatorsService.USER_VIDEO_QUOTA,
userVideoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY,
transcodingThreads: this.customConfigValidatorsService.TRANSCODING_THREADS,
+ transcodingAllowAdditionalExtensions: null,
transcodingEnabled: null,
customizationJavascript: null,
customizationCSS: null
this.forceCheck()
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
},
transcoding: {
enabled: this.form.value['transcodingEnabled'],
+ allowAdditionalExtensions: this.form.value['transcodingAllowAdditionalExtensions'],
threads: this.form.value['transcodingThreads'],
resolutions: {
'240p': this.form.value[this.getResolutionKey('240p')],
this.updateForm()
- this.notificationsService.success(this.i18n('Success'), this.i18n('Configuration updated.'))
+ this.notifier.success(this.i18n('Configuration updated.'))
},
- err => this.notificationsService.error(this.i18n('Error'), err.message)
+ err => this.notifier.error(err.message)
)
}
private updateForm () {
- const data = {
+ const data: { [key: string]: any } = {
instanceName: this.customConfig.instance.name,
instanceShortDescription: this.customConfig.instance.shortDescription,
instanceDescription: this.customConfig.instance.description,
userVideoQuotaDaily: this.customConfig.user.videoQuotaDaily,
transcodingThreads: this.customConfig.transcoding.threads,
transcodingEnabled: this.customConfig.transcoding.enabled,
+ transcodingAllowAdditionalExtensions: this.customConfig.transcoding.allowAdditionalExtensions,
customizationJavascript: this.customConfig.instance.customizations.javascript,
customizationCSS: this.customConfig.instance.customizations.css,
importVideosHttpEnabled: this.customConfig.import.videos.http.enabled,