diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-28 01:17:48 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-28 01:17:59 +0200 |
commit | 287124d110391959462b60b45ebbfe90db3a1e40 (patch) | |
tree | 74adaa215dacbdae25a0e1bb9ba898d515250198 /client/src | |
parent | 0242861ece7495c8e726871f9a5f4a3683712bb0 (diff) | |
download | PeerTube-287124d110391959462b60b45ebbfe90db3a1e40.tar.gz PeerTube-287124d110391959462b60b45ebbfe90db3a1e40.tar.zst PeerTube-287124d110391959462b60b45ebbfe90db3a1e40.zip |
fix quota representation in profile settings
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-settings.component.html | 4 | ||||
-rw-r--r-- | client/src/app/+my-account/my-account-settings/my-account-settings.component.ts | 5 |
2 files changed, 5 insertions, 4 deletions
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 2826d8d83..26096da02 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 | |||
@@ -10,14 +10,14 @@ | |||
10 | <div class="user-quota mb-3"> | 10 | <div class="user-quota mb-3"> |
11 | <div> | 11 | <div> |
12 | <div class="progress" i18n-title title="Total video quota"> | 12 | <div class="progress" i18n-title title="Total video quota"> |
13 | <div class="progress-bar" role="progressbar" [style]="{ width: userVideoQuotaPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="userVideoQuota">{{ userVideoQuotaUsed | bytes: 0 }}</div> | 13 | <div class="progress-bar" role="progressbar" [style]="{ width: userVideoQuotaPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.videoQuota">{{ userVideoQuotaUsed | bytes: 0 }}</div> |
14 | <span class="ml-auto mr-2">{{ userVideoQuota }}</span> | 14 | <span class="ml-auto mr-2">{{ userVideoQuota }}</span> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | <div *ngIf="hasDailyQuota()" class="mt-3"> | 18 | <div *ngIf="hasDailyQuota()" class="mt-3"> |
19 | <div class="progress" i18n-title title="Daily video quota"> | 19 | <div class="progress" i18n-title title="Daily video quota"> |
20 | <div class="progress-bar secondary" role="progressbar" [style]="{ width: userVideoQuotaDailyPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="userVideoQuotaDaily">{{ userVideoQuotaUsedDaily | bytes: 0 }}</div> | 20 | <div class="progress-bar secondary" role="progressbar" [style]="{ width: userVideoQuotaDailyPercentage + '%' }" [attr.aria-valuenow]="userVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.videoQuotaDaily">{{ userVideoQuotaUsedDaily | bytes: 0 }}</div> |
21 | <span class="ml-auto mr-2">{{ userVideoQuotaDaily }}</span> | 21 | <span class="ml-auto mr-2">{{ userVideoQuotaDaily }}</span> |
22 | </div> | 22 | </div> |
23 | </div> | 23 | </div> |
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 4800be24b..a9a150e21 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 | |||
@@ -41,14 +41,12 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { | |||
41 | () => { | 41 | () => { |
42 | if (this.user.videoQuota !== -1) { | 42 | if (this.user.videoQuota !== -1) { |
43 | this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() | 43 | this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() |
44 | this.userVideoQuotaPercentage = this.user.videoQuota * 100 / this.userVideoQuotaUsed | ||
45 | } else { | 44 | } else { |
46 | this.userVideoQuota = this.i18n('Unlimited') | 45 | this.userVideoQuota = this.i18n('Unlimited') |
47 | } | 46 | } |
48 | 47 | ||
49 | if (this.user.videoQuotaDaily !== -1) { | 48 | if (this.user.videoQuotaDaily !== -1) { |
50 | this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() | 49 | this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString() |
51 | this.userVideoQuotaDailyPercentage = this.user.videoQuotaDaily * 100 / this.userVideoQuotaUsedDaily | ||
52 | } else { | 50 | } else { |
53 | this.userVideoQuotaDaily = this.i18n('Unlimited') | 51 | this.userVideoQuotaDaily = this.i18n('Unlimited') |
54 | } | 52 | } |
@@ -58,7 +56,10 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked { | |||
58 | this.userService.getMyVideoQuotaUsed() | 56 | this.userService.getMyVideoQuotaUsed() |
59 | .subscribe(data => { | 57 | .subscribe(data => { |
60 | this.userVideoQuotaUsed = data.videoQuotaUsed | 58 | this.userVideoQuotaUsed = data.videoQuotaUsed |
59 | this.userVideoQuotaPercentage = this.userVideoQuotaUsed * 100 / this.user.videoQuota | ||
60 | |||
61 | this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily | 61 | this.userVideoQuotaUsedDaily = data.videoQuotaUsedDaily |
62 | this.userVideoQuotaDailyPercentage = this.userVideoQuotaUsedDaily * 100 / this.user.videoQuotaDaily | ||
62 | }) | 63 | }) |
63 | } | 64 | } |
64 | 65 | ||