From a00045a2184e4cb24b838e95937e7ffedcd66b2b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 27 Aug 2019 09:59:36 +0200 Subject: Improve features table --- .../instance/instance-features-table.component.ts | 36 ++-------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'client/src/app/shared/instance/instance-features-table.component.ts') diff --git a/client/src/app/shared/instance/instance-features-table.component.ts b/client/src/app/shared/instance/instance-features-table.component.ts index a53082a93..46df4d0b2 100644 --- a/client/src/app/shared/instance/instance-features-table.component.ts +++ b/client/src/app/shared/instance/instance-features-table.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core' import { ServerService } from '@app/core' import { I18n } from '@ngx-translate/i18n-polyfill' +import { ServerConfig } from '@shared/models' @Component({ selector: 'my-instance-features-table', @@ -8,8 +9,8 @@ import { I18n } from '@ngx-translate/i18n-polyfill' styleUrls: [ './instance-features-table.component.scss' ] }) export class InstanceFeaturesTableComponent implements OnInit { - features: { label: string, value?: boolean }[] = [] quotaHelpIndication = '' + config: ServerConfig constructor ( private i18n: I18n, @@ -28,7 +29,7 @@ export class InstanceFeaturesTableComponent implements OnInit { ngOnInit () { this.serverService.configLoaded .subscribe(() => { - this.buildFeatures() + this.config = this.serverService.getConfig() this.buildQuotaHelpIndication() }) } @@ -41,37 +42,6 @@ export class InstanceFeaturesTableComponent implements OnInit { if (policy === 'display') return this.i18n('Displayed') } - private buildFeatures () { - const config = this.serverService.getConfig() - - this.features = [ - { - label: this.i18n('User registration allowed'), - value: config.signup.allowed - }, - { - label: this.i18n('Video uploads require manual validation by moderators'), - value: config.autoBlacklist.videos.ofUsers.enabled - }, - { - label: this.i18n('Transcode your videos in multiple resolutions'), - value: config.transcoding.enabledResolutions.length !== 0 - }, - { - label: this.i18n('HTTP import (YouTube, Vimeo, direct URL...)'), - value: config.import.videos.http.enabled - }, - { - label: this.i18n('Torrent import'), - value: config.import.videos.torrent.enabled - }, - { - label: this.i18n('P2P enabled'), - value: config.tracker.enabled - } - ] - } - private getApproximateTime (seconds: number) { const hours = Math.floor(seconds / 3600) let pluralSuffix = '' -- cgit v1.2.3