Übersicht über alle Spieler, Squads und Armeen
diff --git a/static/src/app/statistic/overview/stats-overview.component.ts b/static/src/app/statistic/overview/stats-overview.component.ts
index a390b79..8487a47 100644
--- a/static/src/app/statistic/overview/stats-overview.component.ts
+++ b/static/src/app/statistic/overview/stats-overview.component.ts
@@ -20,7 +20,7 @@ export class StatisticOverviewComponent {
pointData: any[] = [];
pointSumData: any[] = [];
playerData: any[] = [];
- currentData : any[];
+ currentData: any[] = [];
activeSlideIndex;
colorScheme = {
@@ -78,9 +78,18 @@ export class StatisticOverviewComponent {
goToSlide(index: number) {
switch (index) {
- case 0: this.currentData = this.pointSumData; this.yAxisLabel="Gesamtpunkte"; break;
- case 1: this.currentData = this.pointData; this.yAxisLabel="Punkte"; break;
- case 2: this.currentData = this.playerData; this.yAxisLabel="Anzahl Spieler"; break;
+ case 0:
+ this.currentData = this.pointSumData;
+ this.yAxisLabel = "Gesamtpunkte";
+ break;
+ case 1:
+ this.currentData = this.pointData;
+ this.yAxisLabel = "Punkte";
+ break;
+ case 2:
+ this.currentData = this.playerData;
+ this.yAxisLabel = "Anzahl Spieler";
+ break;
}
this.activeSlideIndex = index;
diff --git a/static/src/app/statistic/war-list/war-list.component.ts b/static/src/app/statistic/war-list/war-list.component.ts
index 9fdcfca..17d39a3 100644
--- a/static/src/app/statistic/war-list/war-list.component.ts
+++ b/static/src/app/statistic/war-list/war-list.component.ts
@@ -4,6 +4,7 @@ import {Campaign, War} from "../../models/model-interfaces";
import {WarService} from "../../services/war-service/war.service";
import {LoginService} from "../../services/login-service/login-service";
import {CampaignService} from "../../services/campaign-service/campaign.service";
+import {RouteConfig} from "../../app.config";
@Component({
selector: 'war-list',
@@ -25,9 +26,19 @@ export class WarListComponent implements OnInit {
ngOnInit() {
this.campaignService.getAllCampaigns().subscribe((items) => {
+ const subPathWar = 'war/';
+ const subPathOverview = 'overview/';
this.campaignService.campaigns = items;
this.campaigns = items;
- this.selectOverview(this.campaigns[0]._id);
+
+ const url = this.router.url;
+ if (url.endsWith(RouteConfig.statsPath)) {
+ this.selectOverview(this.campaigns[0]._id);
+ } else if (url.indexOf(subPathWar) !== -1) {
+ this.selectedWarId = url.substring(url.lastIndexOf(subPathWar) + subPathWar.length, url.lastIndexOf(")"));
+ } else if (url.indexOf(subPathOverview) !== -1) {
+ this.selectedWarId = url.substring(url.lastIndexOf(subPathOverview) + subPathOverview.length, url.lastIndexOf(")"));
+ }
});
}