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