]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
More modern avatar upload, quota represented with progress bars
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-settings / my-account-settings.component.ts
index ada98401c754af9b82a9a7746d26bcfcf1ba3a52..5f2db985487dc873f0aff6fb824d6a909d708542 100644 (file)
@@ -17,9 +17,11 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
 
   userVideoQuota = '0'
   userVideoQuotaUsed = 0
+  userVideoQuotaPercentage = 15
 
   userVideoQuotaDaily = '0'
   userVideoQuotaUsedDaily = 0
+  userVideoQuotaDailyPercentage = 15
 
   constructor (
     private viewportScroller: ViewportScroller,
@@ -40,12 +42,14 @@ export class MyAccountSettingsComponent implements OnInit, AfterViewChecked {
       () => {
         if (this.user.videoQuota !== -1) {
           this.userVideoQuota = new BytesPipe().transform(this.user.videoQuota, 0).toString()
+          this.userVideoQuotaPercentage = this.user.videoQuota * 100 / this.userVideoQuotaUsed
         } else {
           this.userVideoQuota = this.i18n('Unlimited')
         }
 
         if (this.user.videoQuotaDaily !== -1) {
           this.userVideoQuotaDaily = new BytesPipe().transform(this.user.videoQuotaDaily, 0).toString()
+          this.userVideoQuotaDailyPercentage = this.user.videoQuotaDaily * 100 / this.userVideoQuotaUsedDaily
         } else {
           this.userVideoQuotaDaily = this.i18n('Unlimited')
         }