Compare commits

..

No commits in common. "9fb39b0af2d0a29bdcf9086f4c090dd1f9e6fb72" and "f6317d7fbc7fd9fcd83d4fae87335c4149e57c1c" have entirely different histories.

7 changed files with 22 additions and 49 deletions

View File

@ -24,9 +24,6 @@ const vehicleRegex = /(vehicle:\s(.*?)\))/;
const categoryRegex = /(category:\s(.*?)\))/; const categoryRegex = /(category:\s(.*?)\))/;
const parseWarLog = (lineArray, war) => { const parseWarLog = (lineArray, war) => {
let flagBlufor = true;
let flagOpfor = true;
const NAME_TOO_LONG_ERROR = 'Error: ENAMETOOLONG: name too long, open \''; const NAME_TOO_LONG_ERROR = 'Error: ENAMETOOLONG: name too long, open \'';
const stats = { const stats = {
@ -167,29 +164,18 @@ const parseWarLog = (lineArray, war) => {
/** /**
* FLAG * FLAG
*/ */
stats.clean.push(line);
const playerName = line.substring(line.lastIndexOf('rt von ') + 7).slice(0, -1);
const flagFraction = line.includes('NATO Flagge') ? 'BLUFOR' : 'OPFOR'; const flagFraction = line.includes('NATO Flagge') ? 'BLUFOR' : 'OPFOR';
const capture = !!line.includes('Flagge erobert'); const capture = !!line.includes('Flagge erobert');
if ((flagFraction === 'BLUFOR' && ((capture && flagBlufor) || (!capture && !flagBlufor))) || stats.flag.push({
(flagFraction === 'OPFOR' && ((capture && flagOpfor) || (!capture && !flagOpfor)))) { war: war._id,
stats.clean.push(line); time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]),
player: playerName,
const playerName = line.substring(line.lastIndexOf('rt von ') + 7).slice(0, -1); flagFraction: flagFraction,
capture: capture,
if (flagFraction === 'BLUFOR') { });
flagBlufor = !capture;
} else if (flagFraction === 'OPFOR') {
flagOpfor = !capture;
}
stats.flag.push({
war: war._id,
time: getFullTimeDate(war.date, line.split(WHITESPACE)[5]),
player: playerName,
flagFraction: flagFraction,
capture: capture,
});
}
} else if (line.includes('(Punkte)')) { } else if (line.includes('(Punkte)')) {
/** /**
* POINTS * POINTS

View File

@ -98,7 +98,7 @@
<li *ngIf="!loginService.isLoggedIn()" routerLinkActive="active"> <li *ngIf="!loginService.isLoggedIn()" routerLinkActive="active">
<a routerLink='{{config.loginPath}}' class="link">{{'navigation.top.login' | translate}}</a> <a routerLink='{{config.loginPath}}' class="link">{{'navigation.top.login' | translate}}</a>
</li> </li>
<li class="dropdown" *ngIf="FEATURE_LOCALIZATION_ENABLED"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false" style="padding: 12px 12px 10px 12px;"> aria-expanded="false" style="padding: 12px 12px 10px 12px;">
<mat-icon svgIcon="{{(language === 'de') ? 'flag-de' : 'flag-gb'}}"></mat-icon> <mat-icon svgIcon="{{(language === 'de') ? 'flag-de' : 'flag-gb'}}"></mat-icon>

View File

@ -6,7 +6,7 @@ import {AwardingService} from './services/army-management/awarding.service';
import {RouteConfig} from './app.config'; import {RouteConfig} from './app.config';
import {DOCUMENT} from '@angular/common'; import {DOCUMENT} from '@angular/common';
import {DomSanitizer} from '@angular/platform-browser'; import {DomSanitizer} from '@angular/platform-browser';
import {MatIconRegistry} from '@angular/material'; import {MatIconRegistry, MatSelectChange} from '@angular/material';
import {SpinnerService} from './services/user-interface/spinner/spinner.service'; import {SpinnerService} from './services/user-interface/spinner/spinner.service';
import {TranslateService} from '@ngx-translate/core'; import {TranslateService} from '@ngx-translate/core';
import {SettingsService} from './services/settings.service'; import {SettingsService} from './services/settings.service';
@ -20,8 +20,6 @@ declare function require(url: string);
}) })
export class AppComponent implements OnInit { export class AppComponent implements OnInit {
readonly FEATURE_LOCALIZATION_ENABLED = false;
config = RouteConfig; config = RouteConfig;
loading = false; loading = false;

View File

@ -33,7 +33,7 @@ export class CampaignService {
submitCampaign(campaign: Campaign) { submitCampaign(campaign: Campaign) {
let requestUrl: string; let requestUrl: string;
let requestMethod: RequestMethod; let requestMethod: RequestMethod
let accessType; let accessType;
if (campaign._id) { if (campaign._id) {

View File

@ -12,7 +12,7 @@
{{'stats.campaign.title.all.time.overview' | translate}} {{'stats.campaign.title.all.time.overview' | translate}}
</div> </div>
<div class="campaign-entry" <div class="campaign-entry"
*ngFor="let campaign of campaigns$ | async" *ngFor="let campaign of campaigns"
[ngClass]="{active : campaign._id === selectedCampaignId}" [ngClass]="{active : campaign._id === selectedCampaignId}"
(click)="select(campaign)"> (click)="select(campaign)">
{{campaign.title}} {{campaign.title}}

View File

@ -1,25 +1,15 @@
import { import {Component, ElementRef, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild} from '@angular/core';
Component,
ElementRef,
EventEmitter,
Input,
OnInit,
Output,
ViewChild
} from '@angular/core';
import {Campaign} from '../../../models/model-interfaces'; import {Campaign} from '../../../models/model-interfaces';
import {LoginService} from '../../../services/app-user-service/login-service'; import {LoginService} from '../../../services/app-user-service/login-service';
import {Observable} from 'rxjs';
import {CampaignService} from '../../../services/logs/campaign.service';
@Component({ @Component({
selector: 'campaign-navigation', selector: 'campaign-navigation',
templateUrl: './campaign-navigation.component.html', templateUrl: './campaign-navigation.component.html',
styleUrls: ['./campaign-navigation.component.css'] styleUrls: ['./campaign-navigation.component.css']
}) })
export class CampaignNavigationComponent implements OnInit { export class CampaignNavigationComponent implements OnChanges {
campaigns$: Observable<Campaign[]>; @Input() campaigns: Campaign[];
@Input() selectedCampaignId; @Input() selectedCampaignId;
@ -37,15 +27,13 @@ export class CampaignNavigationComponent implements OnInit {
repeater; repeater;
constructor(public loginService: LoginService, constructor(public loginService: LoginService) {
private campaignService: CampaignService) {
this.campaigns$ = campaignService.campaigns$;
} }
ngOnInit() { ngOnChanges(changes: SimpleChanges) {
this.campaigns$.subscribe(campaigns => { if (!changes.selectedCampaignId) {
this.isRightScrollVisible = campaigns.length > 4; this.isRightScrollVisible = this.campaigns.length > 4;
}); }
} }
select(campaign) { select(campaign) {

View File

@ -1,4 +1,5 @@
<campaign-navigation <campaign-navigation
[campaigns]="campaigns"
[selectedCampaignId]="selectedCampaign._id" [selectedCampaignId]="selectedCampaign._id"
(campaignSelect)="switchCampaign($event)" (campaignSelect)="switchCampaign($event)"
(campaignEdit)="editCampaign($event)" (campaignEdit)="editCampaign($event)"