From 1869c87535d31a73a26c5d07718cdf94300cc332 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 27 Mar 2018 13:42:57 +0200 Subject: show quota in stats, display quota on the about page, fixes #405 (#421) move videoQuota under a user object, use byte PipeTransform --- client/src/app/about/about.component.html | 8 ++++++++ client/src/app/about/about.component.ts | 6 +++++- client/src/app/core/server/server.service.ts | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'client/src') diff --git a/client/src/app/about/about.component.html b/client/src/app/about/about.component.html index 3bb86208c..bcb4ed2be 100644 --- a/client/src/app/about/about.component.html +++ b/client/src/app/about/about.component.html @@ -13,6 +13,14 @@
Terms
+ +
+ This instance provides a baseline quota of {{ userVideoQuota | bytes: 0 }} space for the videos of its users. +
+ + + This instance provides unlimited space for the videos of its users. +
diff --git a/client/src/app/about/about.component.ts b/client/src/app/about/about.component.ts index adad32b26..7edc013e1 100644 --- a/client/src/app/about/about.component.ts +++ b/client/src/app/about/about.component.ts @@ -23,6 +23,10 @@ export class AboutComponent implements OnInit { return this.serverService.getConfig().instance.name } + get userVideoQuota () { + return this.serverService.getConfig().user.videoQuota + } + ngOnInit () { this.serverService.getAbout() .subscribe( @@ -31,7 +35,7 @@ export class AboutComponent implements OnInit { this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms) }, - err => this.notificationsService.error('Error', err) + err => this.notificationsService.error('Error getting about from server', err) ) } diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 206ec7bcd..987d64d2a 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -5,6 +5,7 @@ import 'rxjs/add/operator/do' import { ReplaySubject } from 'rxjs/ReplaySubject' import { ServerConfig } from '../../../../../shared' import { About } from '../../../../../shared/models/server/about.model' +import { ServerStats } from '../../../../../shared/models/server/server-stats.model' import { environment } from '../../../environments/environment' @Injectable() @@ -51,6 +52,9 @@ export class ServerService { file: { extensions: [] } + }, + user: { + videoQuota: -1 } } private videoCategories: Array<{ id: number, label: string }> = [] -- cgit v1.2.3