diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-11 10:56:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-11 10:58:09 +0200 |
commit | 5d79474cc66383ecbfcef6366f63a34c3af21cbf (patch) | |
tree | 6b2cd85c25294ca04c94cbbcc90353d25e9cee06 /client/src/app/+admin/system/debug/debug.service.ts | |
parent | 2b3f1919fda81c2781ceeb9071d426c184e1b21c (diff) | |
download | PeerTube-5d79474cc66383ecbfcef6366f63a34c3af21cbf.tar.gz PeerTube-5d79474cc66383ecbfcef6366f63a34c3af21cbf.tar.zst PeerTube-5d79474cc66383ecbfcef6366f63a34c3af21cbf.zip |
Add debug component to help admins to fix IP issues
Diffstat (limited to 'client/src/app/+admin/system/debug/debug.service.ts')
-rw-r--r-- | client/src/app/+admin/system/debug/debug.service.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/client/src/app/+admin/system/debug/debug.service.ts b/client/src/app/+admin/system/debug/debug.service.ts new file mode 100644 index 000000000..6c722d177 --- /dev/null +++ b/client/src/app/+admin/system/debug/debug.service.ts | |||
@@ -0,0 +1,25 @@ | |||
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 | } | ||