diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-09 16:30:39 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-09 16:30:39 +0100 |
commit | 234b535dacdeacfacd7ac5601e53b6b7d923ca00 (patch) | |
tree | e065d8f45fd11b23154da25d5390e6c6bd413170 /client/src/app/account | |
parent | d77014491b339b4dcfab95c05507dd5f579a6d7d (diff) | |
download | PeerTube-234b535dacdeacfacd7ac5601e53b6b7d923ca00.tar.gz PeerTube-234b535dacdeacfacd7ac5601e53b6b7d923ca00.tar.zst PeerTube-234b535dacdeacfacd7ac5601e53b6b7d923ca00.zip |
Update dependencies
Diffstat (limited to 'client/src/app/account')
3 files changed, 18 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 | } |
diff --git a/client/src/app/account/account-videos/account-videos.component.ts b/client/src/app/account/account-videos/account-videos.component.ts index d51b70e06..bce135557 100644 --- a/client/src/app/account/account-videos/account-videos.component.ts +++ b/client/src/app/account/account-videos/account-videos.component.ts | |||
@@ -19,6 +19,11 @@ export class AccountVideosComponent extends AbstractVideoList implements OnInit | |||
19 | titlePage = 'My videos' | 19 | titlePage = 'My videos' |
20 | currentRoute = '/account/videos' | 20 | currentRoute = '/account/videos' |
21 | checkedVideos: { [ id: number ]: boolean } = {} | 21 | checkedVideos: { [ id: number ]: boolean } = {} |
22 | pagination = { | ||
23 | currentPage: 1, | ||
24 | itemsPerPage: 10, | ||
25 | totalItems: null | ||
26 | } | ||
22 | 27 | ||
23 | constructor (protected router: Router, | 28 | constructor (protected router: Router, |
24 | protected route: ActivatedRoute, | 29 | protected route: ActivatedRoute, |