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',
quotaHelpIndication = ''
serverConfig: ServerConfig
- constructor (private serverService: ServerService) { }
+ constructor (
+ private serverService: ServerService,
+ private modalService: PeertubeModalService
+ ) { }
get initialUserVideoQuota () {
return this.serverConfig.user.videoQuota
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
return this.serverService.getServerVersionAndCommit()
}
+ openQuickSettingsHighlight () {
+ this.modalService.openQuickSettingsSubject.next()
+ }
+
private getApproximateTime (seconds: number) {
const hours = Math.floor(seconds / 3600)
let pluralSuffix = ''