diff options
author | Chocobozzz <me@florianbigard.com> | 2021-02-10 09:05:29 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-02-10 11:36:40 +0100 |
commit | 21e493d4d8acb7a650eff3a30cd7e086b3cb8a28 (patch) | |
tree | f3a451d6a59925907c62b0c36db99745a43b67db /client/src/app/+admin/users/user-edit/user-edit.ts | |
parent | ead64cdf8d917fa0d6a20271e42378f38e5f2407 (diff) | |
download | PeerTube-21e493d4d8acb7a650eff3a30cd7e086b3cb8a28.tar.gz PeerTube-21e493d4d8acb7a650eff3a30cd7e086b3cb8a28.tar.zst PeerTube-21e493d4d8acb7a650eff3a30cd7e086b3cb8a28.zip |
Add ability to set a custom quota
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-edit.ts')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-edit.ts | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts index faa2f5ad8..2fc3c5d3b 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts | |||
@@ -4,12 +4,13 @@ import { AuthService, ScreenService, ServerService, User } from '@app/core' | |||
4 | import { FormReactive } from '@app/shared/shared-forms' | 4 | import { FormReactive } from '@app/shared/shared-forms' |
5 | import { USER_ROLE_LABELS } from '@shared/core-utils/users' | 5 | import { USER_ROLE_LABELS } from '@shared/core-utils/users' |
6 | import { ServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' | 6 | import { ServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@shared/models' |
7 | import { SelectOptionsItem } from '../../../../types/select-options-item.model' | ||
7 | 8 | ||
8 | @Directive() | 9 | @Directive() |
9 | // tslint:disable-next-line: directive-class-suffix | 10 | // tslint:disable-next-line: directive-class-suffix |
10 | export abstract class UserEdit extends FormReactive implements OnInit { | 11 | export abstract class UserEdit extends FormReactive implements OnInit { |
11 | videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] | 12 | videoQuotaOptions: SelectOptionsItem[] = [] |
12 | videoQuotaDailyOptions: { value: string, label: string, disabled?: boolean }[] = [] | 13 | videoQuotaDailyOptions: SelectOptionsItem[] = [] |
13 | username: string | 14 | username: string |
14 | user: User | 15 | user: User |
15 | 16 | ||
@@ -97,19 +98,7 @@ export abstract class UserEdit extends FormReactive implements OnInit { | |||
97 | } | 98 | } |
98 | 99 | ||
99 | protected buildQuotaOptions () { | 100 | protected buildQuotaOptions () { |
100 | // These are used by a HTML select, so convert key into strings | 101 | this.videoQuotaOptions = this.configService.videoQuotaOptions |
101 | this.videoQuotaOptions = this.configService | 102 | this.videoQuotaDailyOptions = this.configService.videoQuotaDailyOptions |
102 | .videoQuotaOptions.map(q => ({ | ||
103 | value: q.value?.toString(), | ||
104 | label: q.label, | ||
105 | disabled: q.disabled | ||
106 | })) | ||
107 | |||
108 | this.videoQuotaDailyOptions = this.configService | ||
109 | .videoQuotaDailyOptions.map(q => ({ | ||
110 | value: q.value?.toString(), | ||
111 | label: q.label, | ||
112 | disabled: q.disabled | ||
113 | })) | ||
114 | } | 103 | } |
115 | } | 104 | } |