From a76138ff56ad3ad2df926f59578a06b22fb1f93c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Aug 2018 17:56:51 +0200 Subject: Add quota used in users list --- client/src/app/+admin/users/shared/user.service.ts | 9 ++++++--- client/src/app/+admin/users/user-list/user-list.component.html | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'client/src/app/+admin') diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index ad7fb1eee..a0e2f666d 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts @@ -4,9 +4,9 @@ import { Injectable } from '@angular/core' import { BytesPipe } from 'ngx-pipes' import { SortMeta } from 'primeng/components/common/sortmeta' import { Observable } from 'rxjs' -import { ResultList, UserCreate, UserUpdate } from '../../../../../../shared' +import { ResultList, UserCreate, UserUpdate, User } from '../../../../../../shared' import { environment } from '../../../../environments/environment' -import { RestExtractor, RestPagination, RestService, User } from '../../../shared' +import { RestExtractor, RestPagination, RestService } from '../../../shared' import { I18n } from '@ngx-translate/i18n-polyfill' @Injectable() @@ -79,8 +79,11 @@ export class UserService { videoQuota = this.bytesPipe.transform(user.videoQuota, 0) } + const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0) + return Object.assign(user, { - videoQuota + videoQuota, + videoQuotaUsed }) } } diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/users/user-list/user-list.component.html index a92fe95ef..bb1b26442 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.html +++ b/client/src/app/+admin/users/user-list/user-list.component.html @@ -36,7 +36,7 @@ (banned) {{ user.email }} - {{ user.videoQuota }} + {{ user.videoQuotaUsed }} / {{ user.videoQuota }} {{ user.roleLabel }} {{ user.createdAt }} -- cgit v1.2.3