diff options
author | Felix Ableitner <me@nutomic.com> | 2018-08-28 02:01:35 -0500 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-28 09:01:35 +0200 |
commit | bee0abffff73804d816b90c7fd599e0a51c09d61 (patch) | |
tree | fae6d58637f9c63a3800090277f8e130b43442dd /client/src/app/+admin/users/user-edit/user-edit.ts | |
parent | c907c2fa3fd7c0a741117a0204d0ebca675124bd (diff) | |
download | PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.gz PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.tar.zst PeerTube-bee0abffff73804d816b90c7fd599e0a51c09d61.zip |
Implement daily upload limit (#956)
* Implement daily upload limit (ref #652)
* remove duplicate code
* review fixes
* fix tests?
* whitespace fixes, finish leftover todo
* fix tests
* added some new tests
* use different config value for tests
* remove todo
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 | 17 |
1 files changed, 7 insertions, 10 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 ea8c733c3..4e7ca8a1b 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts | |||
@@ -1,18 +1,15 @@ | |||
1 | import { ServerService } from '../../../core' | 1 | import { ServerService } from '../../../core' |
2 | import { FormReactive } from '../../../shared' | 2 | import { FormReactive } from '../../../shared' |
3 | import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared' | 3 | import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared' |
4 | import { EditCustomConfigComponent } from '../../../+admin/config/edit-custom-config/' | ||
4 | 5 | ||
5 | export abstract class UserEdit extends FormReactive { | 6 | export abstract class UserEdit extends FormReactive { |
6 | videoQuotaOptions = [ | 7 | |
7 | { value: -1, label: 'Unlimited' }, | 8 | // These are used by a HTML select, so convert key into strings |
8 | { value: 0, label: '0' }, | 9 | videoQuotaOptions = EditCustomConfigComponent.videoQuotaOptions |
9 | { value: 100 * 1024 * 1024, label: '100MB' }, | 10 | .map(q => ({ value: q.value.toString(), label: q.label })) |
10 | { value: 500 * 1024 * 1024, label: '500MB' }, | 11 | videoQuotaDailyOptions = EditCustomConfigComponent.videoQuotaDailyOptions |
11 | { value: 1024 * 1024 * 1024, label: '1GB' }, | 12 | .map(q => ({ value: q.value.toString(), label: q.label })) |
12 | { value: 5 * 1024 * 1024 * 1024, label: '5GB' }, | ||
13 | { value: 20 * 1024 * 1024 * 1024, label: '20GB' }, | ||
14 | { value: 50 * 1024 * 1024 * 1024, label: '50GB' } | ||
15 | ].map(q => ({ value: q.value.toString(), label: q.label })) // Used by a HTML select, so convert key into strings | ||
16 | 13 | ||
17 | roles = Object.keys(USER_ROLE_LABELS).map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] })) | 14 | roles = Object.keys(USER_ROLE_LABELS).map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] })) |
18 | 15 | ||