From 66fd15160e633d98fd7933ffe4abb6c55fcd1755 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Dec 2019 13:19:55 +0100 Subject: Clearer video quota label in user settings --- .../my-account-settings.component.html | 10 +++++++++- .../my-account-settings.component.scss | 1 + .../my-account-settings.component.ts | 19 ++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html index eb9367d1f..9f187b574 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html @@ -1,7 +1,15 @@
- Video quota: {{ userVideoQuotaUsed | bytes: 0 }} / {{ userVideoQuota }} +
+ Total video quota: + {{ userVideoQuotaUsed | bytes: 0 }} used / {{ userVideoQuota }} +
+ +
+ Daily video quota: + {{ userVideoQuotaUsedDaily | bytes: 0 }} used / {{ userVideoQuotaDaily }} +
Profile
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss b/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss index 16f26dfed..d0395aca9 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.scss @@ -6,6 +6,7 @@ margin-top: 20px; .user-quota-label { + margin-right: 5px; font-weight: $font-semibold; } } diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts index 95fd2a3db..e314cdbea 100644 --- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts +++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts @@ -13,9 +13,13 @@ import { I18n } from '@ngx-translate/i18n-polyfill' }) export class MyAccountSettingsComponent implements OnInit { user: User = null + userVideoQuota = '0' userVideoQuotaUsed = 0 + userVideoQuotaDaily = '0' + userVideoQuotaUsedDaily = 0 + constructor ( private userService: UserService, private authService: AuthService, @@ -37,11 +41,20 @@ export class MyAccountSettingsComponent implements OnInit { } else { this.userVideoQuota = this.i18n('Unlimited') } + + if (this.user.videoQuotaDaily !== -1) { + this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() + } else { + this.userVideoQuotaDaily = this.i18n('Unlimited') + } } ) this.userService.getMyVideoQuotaUsed() - .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed) + .subscribe(data => { + this.userVideoQuotaUsed = data.videoQuotaUsed + this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily + }) } onAvatarChange (formData: FormData) { @@ -56,4 +69,8 @@ export class MyAccountSettingsComponent implements OnInit { err => this.notifier.error(err.message) ) } + + hasDailyQuota () { + return this.user.videoQuotaDaily !== -1 + } } -- cgit v1.2.3