diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-15 11:17:03 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-07-29 18:15:53 +0200 |
commit | bc99dfe54e093e69ba8fd06d36b36fbbda3f45de (patch) | |
tree | 2c13497b77928c2593310746e3ec33333e2b4d66 /client/src/app/core | |
parent | 654a188f80fc1f089aa14837084664c908fe27d2 (diff) | |
download | PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.tar.gz PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.tar.zst PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.zip |
variable columns for users list, more columns possible, badge display for statuses
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/users/user.service.ts | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/client/src/app/core/users/user.service.ts b/client/src/app/core/users/user.service.ts index 2c817d45e..5f9300bec 100644 --- a/client/src/app/core/users/user.service.ts +++ b/client/src/app/core/users/user.service.ts | |||
@@ -374,13 +374,23 @@ export class UserService { | |||
374 | private formatUser (user: UserServerModel) { | 374 | private formatUser (user: UserServerModel) { |
375 | let videoQuota | 375 | let videoQuota |
376 | if (user.videoQuota === -1) { | 376 | if (user.videoQuota === -1) { |
377 | videoQuota = this.i18n('Unlimited') | 377 | videoQuota = '∞' |
378 | } else { | 378 | } else { |
379 | videoQuota = this.bytesPipe.transform(user.videoQuota, 0) | 379 | videoQuota = this.bytesPipe.transform(user.videoQuota, 0) |
380 | } | 380 | } |
381 | 381 | ||
382 | const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0) | 382 | const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0) |
383 | 383 | ||
384 | let videoQuotaDaily | ||
385 | let videoQuotaUsedDaily | ||
386 | if (user.videoQuotaDaily === -1) { | ||
387 | videoQuotaDaily = '∞' | ||
388 | videoQuotaUsedDaily = this.bytesPipe.transform(0, 0) | ||
389 | } else { | ||
390 | videoQuotaDaily = this.bytesPipe.transform(user.videoQuotaDaily, 0) | ||
391 | videoQuotaUsedDaily = this.bytesPipe.transform(user.videoQuotaUsedDaily || 0, 0) | ||
392 | } | ||
393 | |||
384 | const roleLabels: { [ id in UserRole ]: string } = { | 394 | const roleLabels: { [ id in UserRole ]: string } = { |
385 | [UserRole.USER]: this.i18n('User'), | 395 | [UserRole.USER]: this.i18n('User'), |
386 | [UserRole.ADMINISTRATOR]: this.i18n('Administrator'), | 396 | [UserRole.ADMINISTRATOR]: this.i18n('Administrator'), |
@@ -390,7 +400,13 @@ export class UserService { | |||
390 | return Object.assign(user, { | 400 | return Object.assign(user, { |
391 | roleLabel: roleLabels[user.role], | 401 | roleLabel: roleLabels[user.role], |
392 | videoQuota, | 402 | videoQuota, |
393 | videoQuotaUsed | 403 | videoQuotaUsed, |
404 | rawVideoQuota: user.videoQuota, | ||
405 | rawVideoQuotaUsed: user.videoQuotaUsed, | ||
406 | videoQuotaDaily, | ||
407 | videoQuotaUsedDaily, | ||
408 | rawVideoQuotaDaily: user.videoQuotaDaily, | ||
409 | rawVideoQuotaUsedDaily: user.videoQuotaUsedDaily | ||
394 | }) | 410 | }) |
395 | } | 411 | } |
396 | } | 412 | } |