]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+about/about-instance/about-instance.component.ts
36e7a8e5b00f5cc8a339269554d144217c0c2cd3
[github/Chocobozzz/PeerTube.git] / client / src / app / +about / about-instance / about-instance.component.ts
1 import { Component, OnInit } from '@angular/core'
2 import { Notifier, ServerService } from '@app/core'
3 import { MarkdownService } from '@app/videos/shared'
4 import { I18n } from '@ngx-translate/i18n-polyfill'
5
6 @Component({
7 selector: 'my-about-instance',
8 templateUrl: './about-instance.component.html',
9 styleUrls: [ './about-instance.component.scss' ]
10 })
11 export class AboutInstanceComponent implements OnInit {
12 shortDescription = ''
13 descriptionHTML = ''
14 termsHTML = ''
15
16 constructor (
17 private notifier: Notifier,
18 private serverService: ServerService,
19 private markdownService: MarkdownService,
20 private i18n: I18n
21 ) {}
22
23 get instanceName () {
24 return this.serverService.getConfig().instance.name
25 }
26
27 get userVideoQuota () {
28 return this.serverService.getConfig().user.videoQuota
29 }
30
31 get isSignupAllowed () {
32 return this.serverService.getConfig().signup.allowed
33 }
34
35 ngOnInit () {
36 this.serverService.getAbout()
37 .subscribe(
38 res => {
39 this.shortDescription = res.instance.shortDescription
40 this.descriptionHTML = this.markdownService.textMarkdownToHTML(res.instance.description)
41 this.termsHTML = this.markdownService.textMarkdownToHTML(res.instance.terms)
42 },
43
44 () => this.notifier.error(this.i18n('Cannot get about information from server'))
45 )
46 }
47
48 }