aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-09 16:30:39 +0100
committerChocobozzz <me@florianbigard.com>2018-01-09 16:30:39 +0100
commit234b535dacdeacfacd7ac5601e53b6b7d923ca00 (patch)
treee065d8f45fd11b23154da25d5390e6c6bd413170 /client/src/app/account
parentd77014491b339b4dcfab95c05507dd5f579a6d7d (diff)
downloadPeerTube-234b535dacdeacfacd7ac5601e53b6b7d923ca00.tar.gz
PeerTube-234b535dacdeacfacd7ac5601e53b6b7d923ca00.tar.zst
PeerTube-234b535dacdeacfacd7ac5601e53b6b7d923ca00.zip
Update dependencies
Diffstat (limited to 'client/src/app/account')
-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
-rw-r--r--client/src/app/account/account-videos/account-videos.component.ts5
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 @@
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 }
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,