X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-instance%2Finstance-features-table.component.ts;h=6335de450144f801204212f6e3ce8d48110e6994;hb=047f9585dd91d7765d78522edebfb64107450512;hp=76b595c20e3bf2c95433e5bd6b8cc49dd7aed06c;hpb=66357162f8e1227495f09bd4f68446aad7071c6d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.ts b/client/src/app/shared/shared-instance/instance-features-table.component.ts index 76b595c20..6335de450 100644 --- a/client/src/app/shared/shared-instance/instance-features-table.component.ts +++ b/client/src/app/shared/shared-instance/instance-features-table.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core' import { ServerService } from '@app/core' import { ServerConfig } from '@shared/models' +import { PeertubeModalService } from '../shared-main/peertube-modal/peertube-modal.service' @Component({ selector: 'my-instance-features-table', @@ -11,7 +12,10 @@ export class InstanceFeaturesTableComponent implements OnInit { quotaHelpIndication = '' serverConfig: ServerConfig - constructor (private serverService: ServerService) { } + constructor ( + private serverService: ServerService, + private modalService: PeertubeModalService + ) { } get initialUserVideoQuota () { return this.serverConfig.user.videoQuota @@ -21,8 +25,21 @@ export class InstanceFeaturesTableComponent implements OnInit { return Math.min(this.initialUserVideoQuota, this.serverConfig.user.videoQuotaDaily) } + get maxInstanceLives () { + const value = this.serverConfig.live.maxInstanceLives + if (value === -1) return $localize`Unlimited` + + return value + } + + get maxUserLives () { + const value = this.serverConfig.live.maxUserLives + if (value === -1) return $localize`Unlimited` + + return value + } + ngOnInit () { - this.serverConfig = this.serverService.getTmpConfig() this.serverService.getConfig() .subscribe(config => { this.serverConfig = config @@ -42,6 +59,10 @@ export class InstanceFeaturesTableComponent implements OnInit { return this.serverService.getServerVersionAndCommit() } + openQuickSettingsHighlight () { + this.modalService.openQuickSettingsSubject.next() + } + private getApproximateTime (seconds: number) { const hours = Math.floor(seconds / 3600) let pluralSuffix = ''