Add LogsService

pull/15/head
HardiReady 2017-10-22 18:06:37 +02:00
parent a8960506c6
commit b266d6f972
44 changed files with 152 additions and 77 deletions

View File

@ -2,10 +2,7 @@
// modules // modules
const express = require('express'); const express = require('express');
const logger = require('debug')('cc:wars'); const logger = require('debug')('cc:logs');
// HTTP status codes by name
const codes = require('./http-codes');
const routerHandling = require('../middleware/router-handling'); const routerHandling = require('../middleware/router-handling');
@ -18,16 +15,14 @@ const LogTransportModel = require('../models/logs/transport');
const LogFlagModel = require('../models/logs/flag'); const LogFlagModel = require('../models/logs/flag');
const LogPointsModel = require('../models/logs/points'); const LogPointsModel = require('../models/logs/points');
const notFoundError = new Error('No logs found');
const logsRouter = express.Router(); const logsRouter = express.Router();
function processLogRequest(model, filter, res, next) { function processLogRequest(model, filter, res, next) {
model.find(filter, {}, {sort: {time: 1}}, (err, log) => { model.find(filter, {}, {sort: {time: 1}}, (err, log) => {
if (err) return next(err); if (err) return next(err);
if (!log || log.length === 0) { if (!log || log.length === 0) {
const err = notFoundError; const err = new Error('No logs found');
err.status = codes.notfound; err.status = require('./http-codes').notfound;
return next(err) return next(err)
} }
res.locals.items = log; res.locals.items = log;

View File

@ -2,7 +2,7 @@ import {Component} from "@angular/core";
import {AppUser, Squad} from "../models/model-interfaces"; import {AppUser, Squad} from "../models/model-interfaces";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {AppUserService} from "../services/app-user-service/app-user.service"; import {AppUserService} from "../services/app-user-service/app-user.service";
import {SquadService} from "../services/squad-service/squad.service"; import {SquadService} from "../services/army-management/squad.service";
@Component({ @Component({

View File

@ -1,8 +1,8 @@
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {NavigationEnd, NavigationStart, Router} from '@angular/router'; import {NavigationEnd, NavigationStart, Router} from '@angular/router';
import {LoginService} from './services/login-service/login-service'; import {LoginService} from './services/app-user-service/login-service';
import {PromotionService} from "./services/promotion-service/promotion.service"; import {PromotionService} from "./services/army-management/promotion.service";
import {AwardingService} from "./services/awarding-service/awarding.service"; import {AwardingService} from "./services/army-management/awarding.service";
import {RouteConfig} from "./app.config"; import {RouteConfig} from "./app.config";
declare function require(url: string); declare function require(url: string);

View File

@ -3,19 +3,20 @@ export class AppConfig {
public readonly apiUrl = '/api'; public readonly apiUrl = '/api';
public readonly apiAppUserPath = this.apiUrl + '/account/'; public readonly apiAppUserPath = this.apiUrl + '/account/';
public readonly apiAwardPath = this.apiUrl + '/awardings';
public readonly apiDecorationPath = this.apiUrl + '/decorations/';
public readonly apiAuthenticationPath = this.apiUrl + '/authenticate'; public readonly apiAuthenticationPath = this.apiUrl + '/authenticate';
public readonly apiSignupPath = this.apiUrl + '/authenticate/signup'; public readonly apiAwardPath = this.apiUrl + '/awardings';
public readonly apiRankPath = this.apiUrl + '/ranks/'; public readonly apiCampaignPath = this.apiUrl + '/campaigns';
public readonly apiSquadPath = this.apiUrl + '/squads/'; public readonly apiDecorationPath = this.apiUrl + '/decorations/';
public readonly apiUserPath = this.apiUrl + '/users/'; public readonly apiLogsPath = this.apiUrl + '/logs';
public readonly apiOverviewPath = this.apiUrl + '/overview'; public readonly apiOverviewPath = this.apiUrl + '/overview';
public readonly apiPlayersPath = this.apiUrl + '/players'; public readonly apiPlayersPath = this.apiUrl + '/players';
public readonly apiRequestAwardPath = this.apiUrl + '/request/award';
public readonly apiPromotionPath = this.apiUrl + '/request/promotion'; public readonly apiPromotionPath = this.apiUrl + '/request/promotion';
public readonly apiRankPath = this.apiUrl + '/ranks/';
public readonly apiRequestAwardPath = this.apiUrl + '/request/award';
public readonly apiSignupPath = this.apiUrl + '/authenticate/signup';
public readonly apiSquadPath = this.apiUrl + '/squads/';
public readonly apiUserPath = this.apiUrl + '/users/';
public readonly apiWarPath = this.apiUrl + '/wars'; public readonly apiWarPath = this.apiUrl + '/wars';
public readonly apiCampaignPath = this.apiUrl + '/campaigns';
} }

View File

@ -2,24 +2,24 @@ import {NgModule} from '@angular/core';
import {BrowserModule} from "@angular/platform-browser"; import {BrowserModule} from "@angular/platform-browser";
import {HttpModule} from '@angular/http'; import {HttpModule} from '@angular/http';
import {AppComponent} from './app.component'; import {AppComponent} from './app.component';
import {LoginService} from "./services/login-service/login-service"; import {LoginService} from "./services/app-user-service/login-service";
import {appRouting, routingComponents, routingProviders} from './app.routing'; import {appRouting, routingComponents, routingProviders} from './app.routing';
import {SquadService} from "./services/squad-service/squad.service"; import {SquadService} from "./services/army-management/squad.service";
import {SquadStore} from "./services/stores/squad.store"; import {SquadStore} from "./services/stores/squad.store";
import {DecorationStore} from "./services/stores/decoration.store"; import {DecorationStore} from "./services/stores/decoration.store";
import {DecorationService} from "./services/decoration-service/decoration.service"; import {DecorationService} from "./services/army-management/decoration.service";
import {RankStore} from "./services/stores/rank.store"; import {RankStore} from "./services/stores/rank.store";
import {RankService} from "./services/rank-service/rank.service"; import {RankService} from "./services/army-management/rank.service";
import {AppConfig} from "./app.config"; import {AppConfig} from "./app.config";
import {LoginGuardAdmin, LoginGuardHL, LoginGuardSQL} from "./login/login.guard"; import {LoginGuardAdmin, LoginGuardHL, LoginGuardSQL} from "./login/login.guard";
import {AwardingService} from "./services/awarding-service/awarding.service"; import {AwardingService} from "./services/army-management/awarding.service";
import {HttpClient} from "./services/http-client"; import {HttpClient} from "./services/http-client";
import {ArmyService} from "./services/army-service/army.service"; import {ArmyService} from "./services/army-service/army.service";
import {ClipboardModule} from 'ngx-clipboard'; import {ClipboardModule} from 'ngx-clipboard';
import {PromotionService} from "./services/promotion-service/promotion.service"; import {PromotionService} from "./services/army-management/promotion.service";
import {SharedModule} from "./shared.module"; import {SharedModule} from "./shared.module";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {UserService} from "./services/user-service/user.service"; import {UserService} from "./services/army-management/user.service";
import {UserStore} from "./services/stores/user.store"; import {UserStore} from "./services/stores/user.store";
import {CookieService} from "ngx-cookie-service"; import {CookieService} from "ngx-cookie-service";

View File

@ -1,10 +1,10 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {Award, User} from "../models/model-interfaces"; import {Award, User} from "../models/model-interfaces";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {UserService} from "../services/user-service/user.service"; import {UserService} from "../services/army-management/user.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";
import {RouteConfig} from "../app.config"; import {RouteConfig} from "../app.config";
import {AwardingService} from "../services/awarding-service/awarding.service"; import {AwardingService} from "../services/army-management/awarding.service";
@Component({ @Component({

View File

@ -5,7 +5,7 @@ import {FormControl} from "@angular/forms";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {Decoration} from "../../models/model-interfaces"; import {Decoration} from "../../models/model-interfaces";
import {DecorationService} from "../../services/decoration-service/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
@Component({ @Component({
selector: 'decoration-list', selector: 'decoration-list',

View File

@ -2,7 +2,7 @@ import {decorationRoutesModule, decorationsRoutingComponents} from "./decoration
import {SharedModule} from "../shared.module"; import {SharedModule} from "../shared.module";
import {CommonModule} from "@angular/common"; import {CommonModule} from "@angular/common";
import {DecorationStore} from "../services/stores/decoration.store"; import {DecorationStore} from "../services/stores/decoration.store";
import {DecorationService} from "../services/decoration-service/decoration.service"; import {DecorationService} from "../services/army-management/decoration.service";
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {ButtonsModule} from "ngx-bootstrap"; import {ButtonsModule} from "ngx-bootstrap";

View File

@ -2,7 +2,7 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {Decoration} from "../../models/model-interfaces"; import {Decoration} from "../../models/model-interfaces";
import {DecorationService} from "../../services/decoration-service/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";
@Component({ @Component({

View File

@ -1,6 +1,6 @@
import {Component, OnInit} from "@angular/core"; import {Component, OnInit} from "@angular/core";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {LoginService} from "../services/login-service/login-service"; import {LoginService} from "../services/app-user-service/login-service";
import {RouteConfig} from "../app.config"; import {RouteConfig} from "../app.config";

View File

@ -1,6 +1,6 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router'; import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';
import {LoginService} from "../services/login-service/login-service"; import {LoginService} from "../services/app-user-service/login-service";
@Injectable() @Injectable()
export class LoginGuardSQL implements CanActivate { export class LoginGuardSQL implements CanActivate {

View File

@ -1,6 +1,6 @@
import {Component, OnInit} from "@angular/core"; import {Component, OnInit} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {LoginService} from "../services/login-service/login-service"; import {LoginService} from "../services/app-user-service/login-service";
import {RouteConfig} from "../app.config"; import {RouteConfig} from "../app.config";

View File

@ -2,7 +2,7 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {Rank} from "../../models/model-interfaces"; import {Rank} from "../../models/model-interfaces";
import {RankService} from "../../services/rank-service/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";

View File

@ -5,7 +5,7 @@ import {FormControl} from "@angular/forms";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {Rank} from "../../models/model-interfaces"; import {Rank} from "../../models/model-interfaces";
import {RankService} from "../../services/rank-service/rank.service"; import {RankService} from "../../services/army-management/rank.service";
@Component({ @Component({
selector: 'rank-list', selector: 'rank-list',

View File

@ -2,7 +2,7 @@ import {NgModule} from "@angular/core";
import {rankRouterModule, ranksRoutingComponents} from "./ranks.routing"; import {rankRouterModule, ranksRoutingComponents} from "./ranks.routing";
import {SharedModule} from "../shared.module"; import {SharedModule} from "../shared.module";
import {CommonModule} from "@angular/common"; import {CommonModule} from "@angular/common";
import {RankService} from "../services/rank-service/rank.service"; import {RankService} from "../services/army-management/rank.service";
import {RankStore} from "../services/stores/rank.store"; import {RankStore} from "../services/stores/rank.store";
import {ButtonsModule} from "ngx-bootstrap"; import {ButtonsModule} from "ngx-bootstrap";

View File

@ -2,10 +2,10 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Award, Decoration, User} from "../../models/model-interfaces"; import {Award, Decoration, User} from "../../models/model-interfaces";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {AwardingService} from "../../services/awarding-service/awarding.service"; import {AwardingService} from "../../services/army-management/awarding.service";
import {DecorationService} from "../../services/decoration-service/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
import {UserService} from "../../services/user-service/user.service"; import {UserService} from "../../services/army-management/user.service";
import {LoginService} from "../../services/login-service/login-service"; import {LoginService} from "../../services/app-user-service/login-service";
@Component({ @Component({

View File

@ -1,7 +1,7 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {Award} from "../../models/model-interfaces"; import {Award} from "../../models/model-interfaces";
import {AwardingService} from "../../services/awarding-service/awarding.service"; import {AwardingService} from "../../services/army-management/awarding.service";
import {LoginService} from "../../services/login-service/login-service"; import {LoginService} from "../../services/app-user-service/login-service";
@Component({ @Component({

View File

@ -1,8 +1,8 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {Promotion, Rank} from "../../models/model-interfaces"; import {Promotion, Rank} from "../../models/model-interfaces";
import {RankService} from "../../services/rank-service/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {PromotionService} from "../../services/promotion-service/promotion.service"; import {PromotionService} from "../../services/army-management/promotion.service";
import {LoginService} from "../../services/login-service/login-service"; import {LoginService} from "../../services/app-user-service/login-service";
@Component({ @Component({

View File

@ -2,10 +2,10 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Rank, User} from "../../models/model-interfaces"; import {Rank, User} from "../../models/model-interfaces";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {UserService} from "../../services/user-service/user.service"; import {UserService} from "../../services/army-management/user.service";
import {RankService} from "../../services/rank-service/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {PromotionService} from "../../services/promotion-service/promotion.service"; import {PromotionService} from "../../services/army-management/promotion.service";
import {LoginService} from "../../services/login-service/login-service"; import {LoginService} from "../../services/app-user-service/login-service";
@Component({ @Component({

View File

@ -3,8 +3,8 @@ import {Http, Response} from "@angular/http";
import "rxjs/add/operator/map"; import "rxjs/add/operator/map";
import {AppConfig} from "../../app.config"; import {AppConfig} from "../../app.config";
import {AwardingService} from "../awarding-service/awarding.service"; import {AwardingService} from "../army-management/awarding.service";
import {PromotionService} from "../promotion-service/promotion.service"; import {PromotionService} from "../army-management/promotion.service";
import {CookieService} from "ngx-cookie-service"; import {CookieService} from "ngx-cookie-service";
@Injectable() @Injectable()

View File

@ -0,0 +1,76 @@
import {Injectable} from "@angular/core";
import {AppConfig} from "../../app.config";
import {HttpClient} from "../http-client";
import {URLSearchParams} from "@angular/http";
@Injectable()
export class LogsService {
constructor(private http: HttpClient,
private config: AppConfig) {
}
getBudgetLogs(warId: string, fraction = '') {
console.log("CALL")
const params = new URLSearchParams();
params.append('fraction', fraction);
return this.http.get(this.config.apiLogsPath + '/' + warId + '/budget', params)
.map(res => res.json())
}
getRespawnLogs(warId: string, playerName = '') {
const params = new URLSearchParams();
params.append('player', playerName);
return this.http.get(this.config.apiLogsPath + '/' + warId + '/respawn', params)
.map(res => res.json())
}
getPointsLogs(warId: string, fraction = '') {
const params = new URLSearchParams();
params.append('fraction', fraction);
return this.http.get(this.config.apiLogsPath + '/' + warId + '/points', params)
.map(res => res.json())
}
getReviveLogs(warId: string, medicName = '', patientName = '', fraction = '', stabilizedOnly = false, reviveOnly = false) {
const params = new URLSearchParams();
params.append('medic', medicName);
params.append('patient', patientName);
params.append('fraction', fraction);
params.append('stabilized', stabilizedOnly ? 'true' : '');
params.append('revive', reviveOnly ? 'true' : '');
return this.http.get(this.config.apiLogsPath + '/' + warId + '/revive', params)
.map(res => res.json())
}
getKillLogs(warId: string, shooterName = '', targetName = '', fraction = '', friendlyFireOnly = false, notFriendlyFireOnly = false) {
const params = new URLSearchParams();
params.append('shooter', shooterName);
params.append('target', targetName);
params.append('fraction', fraction);
params.append('friendlyFire', friendlyFireOnly ? 'true' : '');
params.append('noFriendlyFire', notFriendlyFireOnly ? 'true' : '');
return this.http.get(this.config.apiLogsPath + '/' + warId + '/kills', params)
.map(res => res.json())
}
getTransportLogs(warId: string, driverName = '', passengerName = '', fraction = '') {
const params = new URLSearchParams();
params.append('driver', driverName);
params.append('passenger', passengerName);
params.append('fraction', fraction);
return this.http.get(this.config.apiLogsPath + '/' + warId + '/transport', params)
.map(res => res.json())
}
getFlagLogs(warId: string, playerName = '', fraction = '', captureOnly = false, defendOnly = false) {
const params = new URLSearchParams();
params.append('player', playerName);
params.append('fraction', fraction);
params.append('capture', captureOnly ? 'true' : '');
params.append('defend', defendOnly ? 'true' : '');
return this.http.get(this.config.apiLogsPath + '/' + warId + '/flag', params)
.map(res => res.json())
}
}

View File

@ -2,7 +2,7 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {Squad} from "../../models/model-interfaces"; import {Squad} from "../../models/model-interfaces";
import {SquadService} from "../../services/squad-service/squad.service"; import {SquadService} from "../../services/army-management/squad.service";
import {Subscription} from "rxjs/Subscription"; import {Subscription} from "rxjs/Subscription";

View File

@ -5,7 +5,7 @@ import {FormControl} from "@angular/forms";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {Squad} from "../../models/model-interfaces"; import {Squad} from "../../models/model-interfaces";
import {SquadService} from "../../services/squad-service/squad.service"; import {SquadService} from "../../services/army-management/squad.service";
@Component({ @Component({
selector: 'squad-list', selector: 'squad-list',

View File

@ -3,7 +3,7 @@ import {CommonModule} from "@angular/common";
import {SharedModule} from "../shared.module"; import {SharedModule} from "../shared.module";
import {squadRouterModule, squadsRoutingComponents} from "./squads.routing"; import {squadRouterModule, squadsRoutingComponents} from "./squads.routing";
import {SquadStore} from "../services/stores/squad.store"; import {SquadStore} from "../services/stores/squad.store";
import {SquadService} from "../services/squad-service/squad.service"; import {SquadService} from "../services/army-management/squad.service";
import {ButtonsModule} from "ngx-bootstrap"; import {ButtonsModule} from "ngx-bootstrap";
@NgModule({ @NgModule({

View File

@ -1,7 +1,7 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {ActivatedRoute} from "@angular/router"; import {ActivatedRoute} from "@angular/router";
import {CampaignPlayer} from "../../models/model-interfaces"; import {CampaignPlayer} from "../../models/model-interfaces";
import {PlayerService} from "../../services/player-service/player.service"; import {PlayerService} from "../../services/logs/player.service";
import {ChartUtils} from "../../utils/chart-utils"; import {ChartUtils} from "../../utils/chart-utils";
import {Location} from '@angular/common'; import {Location} from '@angular/common';

View File

@ -2,7 +2,7 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {Campaign} from "../../models/model-interfaces"; import {Campaign} from "../../models/model-interfaces";
import {CampaignService} from "../../services/campaign-service/campaign.service"; import {CampaignService} from "../../services/logs/campaign.service";
@Component({ @Component({

View File

@ -1,7 +1,7 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {ActivatedRoute} from "@angular/router"; import {ActivatedRoute} from "@angular/router";
import {CarouselConfig} from "ngx-bootstrap"; import {CarouselConfig} from "ngx-bootstrap";
import {CampaignService} from "../../services/campaign-service/campaign.service"; import {CampaignService} from "../../services/logs/campaign.service";
import {ChartUtils} from "../../utils/chart-utils"; import {ChartUtils} from "../../utils/chart-utils";

View File

@ -2,18 +2,19 @@ import {NgModule} from '@angular/core';
import {CommonModule} from "@angular/common"; import {CommonModule} from "@angular/common";
import {SharedModule} from "../shared.module"; import {SharedModule} from "../shared.module";
import {statsRouterModule, statsRoutingComponents} from "./stats.routing"; import {statsRouterModule, statsRoutingComponents} from "./stats.routing";
import {WarService} from "../services/war-service/war.service"; import {WarService} from "../services/logs/war.service";
import {NgxChartsModule} from "@swimlane/ngx-charts"; import {NgxChartsModule} from "@swimlane/ngx-charts";
import {AccordionModule, CarouselModule} from "ngx-bootstrap"; import {AccordionModule, CarouselModule} from "ngx-bootstrap";
import {CampaignService} from "../services/campaign-service/campaign.service"; import {CampaignService} from "../services/logs/campaign.service";
import {NgxDatatableModule} from "@swimlane/ngx-datatable"; import {NgxDatatableModule} from "@swimlane/ngx-datatable";
import {PlayerService} from "../services/player-service/player.service"; import {PlayerService} from "../services/logs/player.service";
import {LogsService} from "../services/logs/logs.service";
@NgModule({ @NgModule({
declarations: statsRoutingComponents, declarations: statsRoutingComponents,
imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule,
AccordionModule.forRoot(), CarouselModule.forRoot(), NgxDatatableModule], AccordionModule.forRoot(), CarouselModule.forRoot(), NgxDatatableModule],
providers: [WarService, CampaignService, PlayerService] providers: [WarService, CampaignService, PlayerService, LogsService]
}) })
export class StatsModule { export class StatsModule {
static routes = statsRouterModule; static routes = statsRouterModule;

View File

@ -1,7 +1,8 @@
import {Component, ElementRef, ViewChild} from "@angular/core"; import {Component, ElementRef, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {WarService} from "../../services/war-service/war.service"; import {WarService} from "../../services/logs/war.service";
import {War} from "../../models/model-interfaces"; import {War} from "../../models/model-interfaces";
import {LogsService} from "../../services/logs/logs.service";
@Component({ @Component({
@ -32,7 +33,8 @@ export class WarDetailComponent {
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
private router: Router, private router: Router,
private warService: WarService) { private warService: WarService,
private logsService: LogsService) {
Object.assign(this, this.playerChart) Object.assign(this, this.playerChart)
} }

View File

@ -1,6 +1,6 @@
import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core"; import {ChangeDetectionStrategy, Component, EventEmitter} from "@angular/core";
import {War} from "../../models/model-interfaces"; import {War} from "../../models/model-interfaces";
import {LoginService} from "../../services/login-service/login-service"; import {LoginService} from "../../services/app-user-service/login-service";
@Component({ @Component({
selector: 'pjm-war-item', selector: 'pjm-war-item',

View File

@ -1,9 +1,9 @@
import {Component, OnInit} from "@angular/core"; import {Component, OnInit} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Campaign, War} from "../../models/model-interfaces"; import {Campaign, War} from "../../models/model-interfaces";
import {WarService} from "../../services/war-service/war.service"; import {WarService} from "../../services/logs/war.service";
import {LoginService} from "../../services/login-service/login-service"; import {LoginService} from "../../services/app-user-service/login-service";
import {CampaignService} from "../../services/campaign-service/campaign.service"; import {CampaignService} from "../../services/logs/campaign.service";
import {RouteConfig} from "../../app.config"; import {RouteConfig} from "../../app.config";
@Component({ @Component({

View File

@ -1,9 +1,9 @@
import {Component, ViewChild} from "@angular/core"; import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {WarService} from "../../services/war-service/war.service"; import {WarService} from "../../services/logs/war.service";
import {War} from "../../models/model-interfaces"; import {War} from "../../models/model-interfaces";
import {CampaignService} from "../../services/campaign-service/campaign.service"; import {CampaignService} from "../../services/logs/campaign.service";
@Component({ @Component({

View File

@ -2,8 +2,8 @@ import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Award, Decoration} from "../../models/model-interfaces"; import {Award, Decoration} from "../../models/model-interfaces";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";
import {AwardingService} from "../../services/awarding-service/awarding.service"; import {AwardingService} from "../../services/army-management/awarding.service";
import {DecorationService} from "../../services/decoration-service/decoration.service"; import {DecorationService} from "../../services/army-management/decoration.service";
@Component({ @Component({

View File

@ -1,9 +1,9 @@
import {Component, ViewChild} from "@angular/core"; import {Component, ViewChild} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Rank, Squad, User} from "../../models/model-interfaces"; import {Rank, Squad, User} from "../../models/model-interfaces";
import {UserService} from "../../services/user-service/user.service"; import {UserService} from "../../services/army-management/user.service";
import {SquadService} from "../../services/squad-service/squad.service"; import {SquadService} from "../../services/army-management/squad.service";
import {RankService} from "../../services/rank-service/rank.service"; import {RankService} from "../../services/army-management/rank.service";
import {Subscription} from "rxjs"; import {Subscription} from "rxjs";
import {NgForm} from "@angular/forms"; import {NgForm} from "@angular/forms";

View File

@ -4,7 +4,7 @@ import {Location} from "@angular/common";
import {FormControl} from "@angular/forms"; import {FormControl} from "@angular/forms";
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {Observable} from "rxjs/Observable"; import {Observable} from "rxjs/Observable";
import {UserService} from "../../services/user-service/user.service"; import {UserService} from "../../services/army-management/user.service";
import {User} from "../../models/model-interfaces"; import {User} from "../../models/model-interfaces";
import {ADD, LOAD} from "../../services/stores/user.store"; import {ADD, LOAD} from "../../services/stores/user.store";