aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/config/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-26 14:46:54 +0200
committerChocobozzz <me@florianbigard.com>2018-09-26 14:50:39 +0200
commit3827c3b3488845f4235714e92eea439423df2909 (patch)
tree2254b6ab4745099730c384110665fb11c5e82f52 /client/src/app/+admin/config/shared
parent4a216666e7f353e638c6927a9ff0c8fce4e94014 (diff)
downloadPeerTube-3827c3b3488845f4235714e92eea439423df2909.tar.gz
PeerTube-3827c3b3488845f4235714e92eea439423df2909.tar.zst
PeerTube-3827c3b3488845f4235714e92eea439423df2909.zip
Fix quota translations
Diffstat (limited to 'client/src/app/+admin/config/shared')
-rw-r--r--client/src/app/+admin/config/shared/config.service.ts31
1 files changed, 29 insertions, 2 deletions
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts
index 7c61fe9e7..28a3d67d6 100644
--- a/client/src/app/+admin/config/shared/config.service.ts
+++ b/client/src/app/+admin/config/shared/config.service.ts
@@ -4,15 +4,42 @@ import { Injectable } from '@angular/core'
4import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' 4import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model'
5import { environment } from '../../../../environments/environment' 5import { environment } from '../../../../environments/environment'
6import { RestExtractor } from '../../../shared' 6import { RestExtractor } from '../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
7 8
8@Injectable() 9@Injectable()
9export class ConfigService { 10export class ConfigService {
10 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/config' 11 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/config'
11 12
13 videoQuotaOptions: { value: number, label: string }[] = []
14 videoQuotaDailyOptions: { value: number, label: string }[] = []
15
12 constructor ( 16 constructor (
13 private authHttp: HttpClient, 17 private authHttp: HttpClient,
14 private restExtractor: RestExtractor 18 private restExtractor: RestExtractor,
15 ) {} 19 private i18n: I18n
20 ) {
21 this.videoQuotaOptions = [
22 { value: -1, label: this.i18n('Unlimited') },
23 { value: 0, label: '0' },
24 { value: 100 * 1024 * 1024, label: this.i18n('100MB') },
25 { value: 500 * 1024 * 1024, label: this.i18n('500MB') },
26 { value: 1024 * 1024 * 1024, label: this.i18n('1GB') },
27 { value: 5 * 1024 * 1024 * 1024, label: this.i18n('5GB') },
28 { value: 20 * 1024 * 1024 * 1024, label: this.i18n('20GB') },
29 { value: 50 * 1024 * 1024 * 1024, label: this.i18n('50GB') }
30 ]
31
32 this.videoQuotaDailyOptions = [
33 { value: -1, label: this.i18n('Unlimited') },
34 { value: 0, label: '0' },
35 { value: 10 * 1024 * 1024, label: this.i18n('10MB') },
36 { value: 50 * 1024 * 1024, label: this.i18n('50MB') },
37 { value: 100 * 1024 * 1024, label: this.i18n('100MB') },
38 { value: 500 * 1024 * 1024, label: this.i18n('500MB') },
39 { value: 2 * 1024 * 1024 * 1024, label: this.i18n('2GB') },
40 { value: 5 * 1024 * 1024 * 1024, label: this.i18n('5GB') }
41 ]
42 }
16 43
17 getCustomConfig () { 44 getCustomConfig () {
18 return this.authHttp.get<CustomConfig>(ConfigService.BASE_APPLICATION_URL + '/custom') 45 return this.authHttp.get<CustomConfig>(ConfigService.BASE_APPLICATION_URL + '/custom')