aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts45
1 files changed, 25 insertions, 20 deletions
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 3a60b144f..78e9dd5e5 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
@@ -5,12 +5,19 @@ import { ConfigService } from '@app/+admin/config/shared/config.service'
5import { Notifier } from '@app/core' 5import { Notifier } from '@app/core'
6import { ServerService } from '@app/core/server/server.service' 6import { ServerService } from '@app/core/server/server.service'
7import { 7import {
8 CustomConfigValidatorsService, 8 ADMIN_EMAIL_VALIDATOR,
9 FormReactive, 9 CACHE_CAPTIONS_SIZE_VALIDATOR,
10 FormValidatorService, 10 CACHE_PREVIEWS_SIZE_VALIDATOR,
11 SelectOptionsItem, 11 INDEX_URL_VALIDATOR,
12 UserValidatorsService 12 INSTANCE_NAME_VALIDATOR,
13} from '@app/shared/shared-forms' 13 INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
14 SEARCH_INDEX_URL_VALIDATOR,
15 SERVICES_TWITTER_USERNAME_VALIDATOR,
16 SIGNUP_LIMIT_VALIDATOR,
17 TRANSCODING_THREADS_VALIDATOR
18} from '@app/shared/form-validators/custom-config-validators'
19import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@app/shared/form-validators/user-validators'
20import { FormReactive, FormValidatorService, SelectOptionsItem } from '@app/shared/shared-forms'
14import { NgbNav } from '@ng-bootstrap/ng-bootstrap' 21import { NgbNav } from '@ng-bootstrap/ng-bootstrap'
15import { CustomConfig, ServerConfig } from '@shared/models' 22import { CustomConfig, ServerConfig } from '@shared/models'
16 23
@@ -37,8 +44,6 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
37 constructor ( 44 constructor (
38 private viewportScroller: ViewportScroller, 45 private viewportScroller: ViewportScroller,
39 protected formValidatorService: FormValidatorService, 46 protected formValidatorService: FormValidatorService,
40 private customConfigValidatorsService: CustomConfigValidatorsService,
41 private userValidatorsService: UserValidatorsService,
42 private notifier: Notifier, 47 private notifier: Notifier,
43 private configService: ConfigService, 48 private configService: ConfigService,
44 private serverService: ServerService 49 private serverService: ServerService
@@ -110,8 +115,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
110 115
111 const formGroupData: { [key in keyof CustomConfig ]: any } = { 116 const formGroupData: { [key in keyof CustomConfig ]: any } = {
112 instance: { 117 instance: {
113 name: this.customConfigValidatorsService.INSTANCE_NAME, 118 name: INSTANCE_NAME_VALIDATOR,
114 shortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION, 119 shortDescription: INSTANCE_SHORT_DESCRIPTION_VALIDATOR,
115 description: null, 120 description: null,
116 121
117 isNSFW: false, 122 isNSFW: false,
@@ -143,21 +148,21 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
143 }, 148 },
144 services: { 149 services: {
145 twitter: { 150 twitter: {
146 username: this.customConfigValidatorsService.SERVICES_TWITTER_USERNAME, 151 username: SERVICES_TWITTER_USERNAME_VALIDATOR,
147 whitelisted: null 152 whitelisted: null
148 } 153 }
149 }, 154 },
150 cache: { 155 cache: {
151 previews: { 156 previews: {
152 size: this.customConfigValidatorsService.CACHE_PREVIEWS_SIZE 157 size: CACHE_PREVIEWS_SIZE_VALIDATOR
153 }, 158 },
154 captions: { 159 captions: {
155 size: this.customConfigValidatorsService.CACHE_CAPTIONS_SIZE 160 size: CACHE_CAPTIONS_SIZE_VALIDATOR
156 } 161 }
157 }, 162 },
158 signup: { 163 signup: {
159 enabled: null, 164 enabled: null,
160 limit: this.customConfigValidatorsService.SIGNUP_LIMIT, 165 limit: SIGNUP_LIMIT_VALIDATOR,
161 requiresEmailVerification: null 166 requiresEmailVerification: null
162 }, 167 },
163 import: { 168 import: {
@@ -171,18 +176,18 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
171 } 176 }
172 }, 177 },
173 admin: { 178 admin: {
174 email: this.customConfigValidatorsService.ADMIN_EMAIL 179 email: ADMIN_EMAIL_VALIDATOR
175 }, 180 },
176 contactForm: { 181 contactForm: {
177 enabled: null 182 enabled: null
178 }, 183 },
179 user: { 184 user: {
180 videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA, 185 videoQuota: USER_VIDEO_QUOTA_VALIDATOR,
181 videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY 186 videoQuotaDaily: USER_VIDEO_QUOTA_DAILY_VALIDATOR
182 }, 187 },
183 transcoding: { 188 transcoding: {
184 enabled: null, 189 enabled: null,
185 threads: this.customConfigValidatorsService.TRANSCODING_THREADS, 190 threads: TRANSCODING_THREADS_VALIDATOR,
186 allowAdditionalExtensions: null, 191 allowAdditionalExtensions: null,
187 allowAudioFiles: null, 192 allowAudioFiles: null,
188 resolutions: {}, 193 resolutions: {},
@@ -213,7 +218,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
213 }, 218 },
214 autoFollowIndex: { 219 autoFollowIndex: {
215 enabled: null, 220 enabled: null,
216 indexUrl: this.customConfigValidatorsService.INDEX_URL 221 indexUrl: INDEX_URL_VALIDATOR
217 } 222 }
218 } 223 }
219 }, 224 },
@@ -230,7 +235,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
230 }, 235 },
231 searchIndex: { 236 searchIndex: {
232 enabled: null, 237 enabled: null,
233 url: this.customConfigValidatorsService.SEARCH_INDEX_URL, 238 url: SEARCH_INDEX_URL_VALIDATOR,
234 disableLocalSearch: null, 239 disableLocalSearch: null,
235 isDefaultSearch: null 240 isDefaultSearch: null
236 } 241 }