diff options
Diffstat (limited to 'client/src/app/+admin/config/shared/config.service.ts')
-rw-r--r-- | client/src/app/+admin/config/shared/config.service.ts | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts index 5f98aa545..d29b752f7 100644 --- a/client/src/app/+admin/config/shared/config.service.ts +++ b/client/src/app/+admin/config/shared/config.service.ts | |||
@@ -3,43 +3,46 @@ import { HttpClient } from '@angular/common/http' | |||
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { RestExtractor } from '@app/core' | 4 | import { RestExtractor } from '@app/core' |
5 | import { CustomConfig } from '@shared/models' | 5 | import { CustomConfig } from '@shared/models' |
6 | import { SelectOptionsItem } from '../../../../types/select-options-item.model' | ||
6 | import { environment } from '../../../../environments/environment' | 7 | import { environment } from '../../../../environments/environment' |
7 | 8 | ||
8 | @Injectable() | 9 | @Injectable() |
9 | export class ConfigService { | 10 | export 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 | ||
12 | videoQuotaOptions: { value: number, label: string, disabled?: boolean }[] = [] | 13 | videoQuotaOptions: SelectOptionsItem[] = [] |
13 | videoQuotaDailyOptions: { value: number, label: string, disabled?: boolean }[] = [] | 14 | videoQuotaDailyOptions: SelectOptionsItem[] = [] |
14 | 15 | ||
15 | constructor ( | 16 | constructor ( |
16 | private authHttp: HttpClient, | 17 | private authHttp: HttpClient, |
17 | private restExtractor: RestExtractor | 18 | private restExtractor: RestExtractor |
18 | ) { | 19 | ) { |
19 | this.videoQuotaOptions = [ | 20 | this.videoQuotaOptions = [ |
20 | { value: undefined, label: 'Default quota', disabled: true }, | 21 | { id: -1, label: $localize`Unlimited` }, |
21 | { value: -1, label: $localize`Unlimited` }, | 22 | { id: 0, label: $localize`None - no upload possible` }, |
22 | { value: undefined, label: '─────', disabled: true }, | 23 | { id: 100 * 1024 * 1024, label: $localize`100MB` }, |
23 | { value: 0, label: $localize`None - no upload possible` }, | 24 | { id: 500 * 1024 * 1024, label: $localize`500MB` }, |
24 | { value: 100 * 1024 * 1024, label: $localize`100MB` }, | 25 | { id: 1024 * 1024 * 1024, label: $localize`1GB` }, |
25 | { value: 500 * 1024 * 1024, label: $localize`500MB` }, | 26 | { id: 5 * 1024 * 1024 * 1024, label: $localize`5GB` }, |
26 | { value: 1024 * 1024 * 1024, label: $localize`1GB` }, | 27 | { id: 20 * 1024 * 1024 * 1024, label: $localize`20GB` }, |
27 | { value: 5 * 1024 * 1024 * 1024, label: $localize`5GB` }, | 28 | { id: 50 * 1024 * 1024 * 1024, label: $localize`50GB` }, |
28 | { value: 20 * 1024 * 1024 * 1024, label: $localize`20GB` }, | 29 | { id: 100 * 1024 * 1024 * 1024, label: $localize`100GB` }, |
29 | { value: 50 * 1024 * 1024 * 1024, label: $localize`50GB` } | 30 | { id: 200 * 1024 * 1024 * 1024, label: $localize`200GB` }, |
31 | { id: 500 * 1024 * 1024 * 1024, label: $localize`500GB` } | ||
30 | ] | 32 | ] |
31 | 33 | ||
32 | this.videoQuotaDailyOptions = [ | 34 | this.videoQuotaDailyOptions = [ |
33 | { value: undefined, label: 'Default daily upload limit', disabled: true }, | 35 | { id: -1, label: $localize`Unlimited` }, |
34 | { value: -1, label: $localize`Unlimited` }, | 36 | { id: 0, label: $localize`None - no upload possible` }, |
35 | { value: undefined, label: '─────', disabled: true }, | 37 | { id: 10 * 1024 * 1024, label: $localize`10MB` }, |
36 | { value: 0, label: $localize`None - no upload possible` }, | 38 | { id: 50 * 1024 * 1024, label: $localize`50MB` }, |
37 | { value: 10 * 1024 * 1024, label: $localize`10MB` }, | 39 | { id: 100 * 1024 * 1024, label: $localize`100MB` }, |
38 | { value: 50 * 1024 * 1024, label: $localize`50MB` }, | 40 | { id: 500 * 1024 * 1024, label: $localize`500MB` }, |
39 | { value: 100 * 1024 * 1024, label: $localize`100MB` }, | 41 | { id: 2 * 1024 * 1024 * 1024, label: $localize`2GB` }, |
40 | { value: 500 * 1024 * 1024, label: $localize`500MB` }, | 42 | { id: 5 * 1024 * 1024 * 1024, label: $localize`5GB` }, |
41 | { value: 2 * 1024 * 1024 * 1024, label: $localize`2GB` }, | 43 | { id: 10 * 1024 * 1024 * 1024, label: $localize`10GB` }, |
42 | { value: 5 * 1024 * 1024 * 1024, label: $localize`5GB` } | 44 | { id: 20 * 1024 * 1024 * 1024, label: $localize`20GB` }, |
45 | { id: 50 * 1024 * 1024 * 1024, label: $localize`50GB` } | ||
43 | ] | 46 | ] |
44 | } | 47 | } |
45 | 48 | ||