X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Finstance%2Finstance-features-table.component.ts;h=46df4d0b29d1228f8b846a2ab06bbe8f21fb80e4;hb=a00045a2184e4cb24b838e95937e7ffedcd66b2b;hp=a53082a93c234c32b2051afc887cb44bc8963389;hpb=ccc00cb2aac1360921b957f3ecb3be7eb55dfa1b;p=github%2FChocobozzz%2FPeerTube.git 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 = ''