]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/+admin/system/debug/debug.service.ts
Add debug component to help admins to fix IP issues
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / system / debug / debug.service.ts
1 import { catchError } from 'rxjs/operators'
2 import { HttpClient } from '@angular/common/http'
3 import { Injectable } from '@angular/core'
4 import { Observable } from 'rxjs'
5 import { environment } from '../../../../environments/environment'
6 import { RestExtractor, RestService } from '../../../shared'
7 import { Debug } from '@shared/models/server'
8
9 @Injectable()
10 export class DebugService {
11 private static BASE_DEBUG_URL = environment.apiUrl + '/api/v1/server/debug'
12
13 constructor (
14 private authHttp: HttpClient,
15 private restService: RestService,
16 private restExtractor: RestExtractor
17 ) {}
18
19 getDebug (): Observable<Debug> {
20 return this.authHttp.get<Debug>(DebugService.BASE_DEBUG_URL)
21 .pipe(
22 catchError(err => this.restExtractor.handleError(err))
23 )
24 }
25 }