]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
Add notification on auto follow index
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-custom-config.component.ts
index d8eb55da7f613d5f5b53046481460e7e6c48ce38..8bd7f7cf6e3ad12254c7af568067d97f24a71bd9 100644 (file)
@@ -5,7 +5,7 @@ import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } fr
 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'
+import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
 
 @Component({
   selector: 'my-edit-custom-config',
@@ -15,7 +15,7 @@ import { BuildFormDefaultValues, FormValidatorService } from '@app/shared/forms/
 export class EditCustomConfigComponent extends FormReactive implements OnInit {
   customConfig: CustomConfig
 
-  resolutions: string[] = []
+  resolutions: { id: string, label: string }[] = []
   transcodingThreadOptions: { label: string, value: number }[] = []
 
   constructor (
@@ -30,11 +30,30 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
     super()
 
     this.resolutions = [
-      this.i18n('240p'),
-      this.i18n('360p'),
-      this.i18n('480p'),
-      this.i18n('720p'),
-      this.i18n('1080p')
+      {
+        id: '240p',
+        label: this.i18n('240p')
+      },
+      {
+        id: '360p',
+        label: this.i18n('360p')
+      },
+      {
+        id: '480p',
+        label: this.i18n('480p')
+      },
+      {
+        id: '720p',
+        label: this.i18n('720p')
+      },
+      {
+        id: '1080p',
+        label: this.i18n('1080p')
+      },
+      {
+        id: '2160p',
+        label: this.i18n('2160p')
+      }
     ]
 
     this.transcodingThreadOptions = [
@@ -54,6 +73,11 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
     return this.configService.videoQuotaDailyOptions
   }
 
+  get availableThemes () {
+    return this.serverService.getConfig().theme.registered
+      .map(t => t.name)
+  }
+
   getResolutionKey (resolution: string) {
     return 'transcoding.resolutions.' + resolution
   }
@@ -73,6 +97,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
           css: null
         }
       },
+      theme: {
+        default: null
+      },
       services: {
         twitter: {
           username: this.customConfigValidatorsService.SERVICES_TWITTER_USERNAME,
@@ -116,6 +143,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
         enabled: null,
         threads: this.customConfigValidatorsService.TRANSCODING_THREADS,
         allowAdditionalExtensions: null,
+        allowAudioFiles: null,
         resolutions: {}
       },
       autoBlacklist: {
@@ -124,6 +152,12 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
             enabled: null
           }
         }
+      },
+      followers: {
+        instance: {
+          enabled: null,
+          manualApproval: null
+        }
       }
     }
 
@@ -133,8 +167,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
       }
     }
     for (const resolution of this.resolutions) {
-      defaultValues.transcoding.resolutions[resolution] = 'false'
-      formGroupData.transcoding.resolutions[resolution] = null
+      defaultValues.transcoding.resolutions[resolution.id] = 'false'
+      formGroupData.transcoding.resolutions[resolution.id] = null
     }
 
     this.buildForm(formGroupData)