]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+page-not-found/page-not-found.component.ts
fix remote subscribe input alignment
[github/Chocobozzz/PeerTube.git] / client / src / app / +page-not-found / page-not-found.component.ts
1 import { Component, OnInit } from '@angular/core'
2 import { Title } from '@angular/platform-browser'
3 import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
4
5 @Component({
6 selector: 'my-page-not-found',
7 templateUrl: './page-not-found.component.html',
8 styleUrls: [ './page-not-found.component.scss' ]
9 })
10 export class PageNotFoundComponent implements OnInit {
11 status = HttpStatusCode.NOT_FOUND_404
12
13 public constructor (
14 private titleService: Title
15 ) {}
16
17 ngOnInit () {
18 if (this.pathname.includes('teapot')) {
19 this.status = HttpStatusCode.I_AM_A_TEAPOT_418
20 this.titleService.setTitle($localize`I'm a teapot` + ' - PeerTube')
21 }
22 }
23
24 get pathname () {
25 return window.location.pathname
26 }
27
28 getMascotName () {
29 switch (this.status) {
30 case HttpStatusCode.I_AM_A_TEAPOT_418:
31 return 'happy'
32 case HttpStatusCode.NOT_FOUND_404:
33 default:
34 return 'defeated'
35 }
36 }
37 }