diff options
Diffstat (limited to 'client/src/app/account/account-settings')
-rw-r--r-- | client/src/app/account/account-settings/account-settings.component.html | 2 | ||||
-rw-r--r-- | client/src/app/account/account-settings/account-settings.component.ts | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/account/account-settings/account-settings.component.html b/client/src/app/account/account-settings/account-settings.component.html index 2f41b5ecf..7ae27dc75 100644 --- a/client/src/app/account/account-settings/account-settings.component.html +++ b/client/src/app/account/account-settings/account-settings.component.html | |||
@@ -14,7 +14,7 @@ | |||
14 | <div class="file-max-size">(extensions: {{ avatarExtensions }}, max size: {{ maxAvatarSize | bytes }})</div> | 14 | <div class="file-max-size">(extensions: {{ avatarExtensions }}, max size: {{ maxAvatarSize | bytes }})</div> |
15 | 15 | ||
16 | <div class="user-quota"> | 16 | <div class="user-quota"> |
17 | <span class="user-quota-label">Video quota:</span> {{ userVideoQuotaUsed | bytes: 0 }} / {{ user.videoQuota | bytes: 0 }} | 17 | <span class="user-quota-label">Video quota:</span> {{ userVideoQuotaUsed | bytes: 0 }} / {{ userVideoQuota }} |
18 | </div> | 18 | </div> |
19 | 19 | ||
20 | <div class="account-title">Account settings</div> | 20 | <div class="account-title">Account settings</div> |
diff --git a/client/src/app/account/account-settings/account-settings.component.ts b/client/src/app/account/account-settings/account-settings.component.ts index a375072a0..524607817 100644 --- a/client/src/app/account/account-settings/account-settings.component.ts +++ b/client/src/app/account/account-settings/account-settings.component.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import { Component, OnInit, ViewChild } from '@angular/core' | 1 | import { Component, OnInit, ViewChild } from '@angular/core' |
2 | import { NotificationsService } from 'angular2-notifications' | 2 | import { NotificationsService } from 'angular2-notifications' |
3 | import { BytesPipe } from 'ngx-pipes' | ||
3 | import { AuthService } from '../../core' | 4 | import { AuthService } from '../../core' |
4 | import { ServerService } from '../../core/server' | 5 | import { ServerService } from '../../core/server' |
5 | import { User } from '../../shared' | 6 | import { User } from '../../shared' |
@@ -14,6 +15,7 @@ export class AccountSettingsComponent implements OnInit { | |||
14 | @ViewChild('avatarfileInput') avatarfileInput | 15 | @ViewChild('avatarfileInput') avatarfileInput |
15 | 16 | ||
16 | user: User = null | 17 | user: User = null |
18 | userVideoQuota = '0' | ||
17 | userVideoQuotaUsed = 0 | 19 | userVideoQuotaUsed = 0 |
18 | 20 | ||
19 | constructor ( | 21 | constructor ( |
@@ -26,6 +28,16 @@ export class AccountSettingsComponent implements OnInit { | |||
26 | ngOnInit () { | 28 | ngOnInit () { |
27 | this.user = this.authService.getUser() | 29 | this.user = this.authService.getUser() |
28 | 30 | ||
31 | this.authService.userInformationLoaded.subscribe( | ||
32 | () => { | ||
33 | if (this.user.videoQuota !== -1) { | ||
34 | this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString() | ||
35 | } else { | ||
36 | this.userVideoQuota = 'Unlimited' | ||
37 | } | ||
38 | } | ||
39 | ) | ||
40 | |||
29 | this.userService.getMyVideoQuotaUsed() | 41 | this.userService.getMyVideoQuotaUsed() |
30 | .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed) | 42 | .subscribe(data => this.userVideoQuotaUsed = data.videoQuotaUsed) |
31 | } | 43 | } |