From b764380ac23f4e9d4677d08acdc3474c2931a16d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Jan 2020 10:11:28 +0100 Subject: Add ability to list redundancies --- .../instance/instance-statistics.component.ts | 23 ++++------------------ 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'client/src/app/shared/instance/instance-statistics.component.ts') diff --git a/client/src/app/shared/instance/instance-statistics.component.ts b/client/src/app/shared/instance/instance-statistics.component.ts index 8ec728f05..40aa8a4c0 100644 --- a/client/src/app/shared/instance/instance-statistics.component.ts +++ b/client/src/app/shared/instance/instance-statistics.component.ts @@ -1,9 +1,6 @@ -import { map } from 'rxjs/operators' -import { HttpClient } from '@angular/common/http' import { Component, OnInit } from '@angular/core' -import { I18n } from '@ngx-translate/i18n-polyfill' import { ServerStats } from '@shared/models/server' -import { environment } from '../../../environments/environment' +import { ServerService } from '@app/core' @Component({ selector: 'my-instance-statistics', @@ -11,27 +8,15 @@ import { environment } from '../../../environments/environment' styleUrls: [ './instance-statistics.component.scss' ] }) export class InstanceStatisticsComponent implements OnInit { - private static BASE_STATS_URL = environment.apiUrl + '/api/v1/server/stats' - serverStats: ServerStats = null constructor ( - private http: HttpClient, - private i18n: I18n + private serverService: ServerService ) { } ngOnInit () { - this.getStats() - .subscribe( - res => { - this.serverStats = res - } - ) - } - - getStats () { - return this.http - .get(InstanceStatisticsComponent.BASE_STATS_URL) + this.serverService.getServerStats() + .subscribe(res => this.serverStats = res) } } -- cgit v1.2.3