aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/account/account-settings
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/account/account-settings')
-rw-r--r--client/src/app/account/account-settings/account-settings.component.html2
-rw-r--r--client/src/app/account/account-settings/account-settings.component.ts12
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 @@
1import { Component, OnInit, ViewChild } from '@angular/core' 1import { Component, OnInit, ViewChild } from '@angular/core'
2import { NotificationsService } from 'angular2-notifications' 2import { NotificationsService } from 'angular2-notifications'
3import { BytesPipe } from 'ngx-pipes'
3import { AuthService } from '../../core' 4import { AuthService } from '../../core'
4import { ServerService } from '../../core/server' 5import { ServerService } from '../../core/server'
5import { User } from '../../shared' 6import { 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 }