Compare commits

..

No commits in common. "15fb7de1e39f2a14c50db1ee30bd25145bbf50c7" and "90510eac93b51bd5cbd5bd14ba243427f40275a5" have entirely different histories.

17 changed files with 190 additions and 240 deletions

View File

@ -3,6 +3,7 @@
+ _id: `` (string, required) - log entry id + _id: `` (string, required) - log entry id
+ war: `` (string, required) - warId + war: `` (string, required) - warId
+ time: `` (string, required) - logging timestamp + time: `` (string, required) - logging timestamp
+ __v: 0 (number, required) - object version number
# LogPoints (Log) # LogPoints (Log)
## Properties ## Properties
@ -73,14 +74,14 @@
#LogVehicle (Log) #LogVehicle (Log)
## Properties ## Properties
+ shooter: `HardiReady` (string, required) - name of player who shot the vehicle + shooter: `HardiReady` (string, required) - name of player who shot the vehicle
+ additionalShooter: `[GNC]Paolo`, `Dominik` (array[string], required) - additional crew members of shooter vehicle + additionalShooter: [`[GNC]Paolo`, `Dominik`] (array[string], required) - additional crew members of shooter vehicle
+ target: `T-100` (string, required) - name of the vehicle + target: `T-100` (string, required) - name of the vehicle
+ fraction: `BLUFOR` (enum, required) - fraction of the shooter + fraction: `BLUFOR` (enum, required) - fraction of the shooter
+ Members + Members
+ `BLUFOR` + `BLUFOR`
+ `OPFOR` + `OPFOR`
+ `NONE` + `NONE`
+ vehicleClass: `LIGHT` (enum[string], required) - class of shot vehicle + vehicleClass: `LIGHT` (enum, required) - class of shot vehicle
+ Members + Members
+ `LIGHT` + `LIGHT`
+ `HEAVY` + `HEAVY`

View File

@ -3,49 +3,37 @@
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const Schema = mongoose.Schema; const Schema = mongoose.Schema;
const LogBudgetSchema = new Schema( const LogBudgetSchema = new Schema({
{ war: {
war: { type: mongoose.Schema.Types.ObjectId,
type: mongoose.Schema.Types.ObjectId, ref: 'War',
ref: 'War', required: true,
required: true,
},
time: {
type: Date,
required: true,
},
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR'],
required: true,
},
oldBudget: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
newBudget: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
buy: {
type: Boolean,
required: true,
},
player: {
type: String,
},
item: {
type: String,
},
}, },
{ time: {
collection: 'logBudget', type: Date,
versionKey: false, required: true,
}); },
fraction: {
type: String,
enum: ['BLUFOR', 'OPFOR'],
required: true,
},
oldBudget: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
newBudget: {
type: Number,
get: (v) => Math.round(v),
set: (v) => Math.round(v),
required: true,
},
}, {
collection: 'logBudget',
versionKey: false,
});
// optional more indices // optional more indices
LogBudgetSchema.index({war: 1}); LogBudgetSchema.index({war: 1});

View File

@ -13,12 +13,6 @@ const VehicleClasses = Object.freeze({
const playerNameRegex = /(^|,\s)(.*?)\s\(/g; const playerNameRegex = /(^|,\s)(.*?)\s\(/g;
const budgetPlayerNameRegex = /\d*\.\s(.*)\s\(ver\)kaufte/;
const budgetItemNameRegex = /\(ver\)kaufte\s(.*)\"$/;
const budgetRespawnNameRegex = /Respawn\svon\s(.*)\"$/;
const vehicleNameEndRegex = /\s\(\w+:/; const vehicleNameEndRegex = /\s\(\w+:/;
const sideRegex = /(side:\s(.*?)\))/; const sideRegex = /(side:\s(.*?)\))/;
@ -184,7 +178,7 @@ const parseWarLog = (lineArray, war) => {
const playerName = line.substring(line.lastIndexOf('Respawn von ') + 12, line.lastIndexOf('"')); const playerName = line.substring(line.lastIndexOf('Respawn von ') + 12, line.lastIndexOf('"'));
stats.respawn.push(getRespawnEntry(budg, playerName, war._id, war.date)); stats.respawn.push(getRespawnEntry(budg, playerName, war._id, war.date));
} }
stats.budget.push(getBudgetEntry(line, budg, war._id, war.date)); stats.budget.push(getBudgetEntry(budg, war._id, war.date));
} }
} else if (line.includes('(Fahne)') && !line.includes('Dominator')) { } else if (line.includes('(Fahne)') && !line.includes('Dominator')) {
/** /**
@ -411,37 +405,14 @@ const getPointsEntry = (pt, line, warId, warDate) => {
}; };
}; };
const getBudgetEntry = (line, budg, warId, warDate) => { const getBudgetEntry = (budg, warId, warDate) => {
const timestamp = getFullTimeDate(warDate, budg[5]); return {
const oldBudget = transformMoneyString(budg[9]);
const newBudget = transformMoneyString(budg[12]);
const fraction = budg[7] === 'NATO' ? 'BLUFOR' : 'OPFOR';
const budgetEntry = {
war: warId, war: warId,
time: timestamp, time: getFullTimeDate(warDate, budg[5]),
fraction: fraction, fraction: budg[7] === 'NATO' ? 'BLUFOR' : 'OPFOR',
oldBudget: oldBudget, oldBudget: transformMoneyString(budg[9]),
newBudget: newBudget, newBudget: transformMoneyString(budg[12]),
buy: oldBudget <= newBudget,
}; };
const budgetRespawnMatch = budgetRespawnNameRegex.exec(line);
if (budgetRespawnMatch && budgetRespawnMatch.length > 1) {
budgetEntry.player = budgetRespawnMatch[1];
budgetEntry.item = 'Respawn';
} else {
const itemNameMatch = budgetItemNameRegex.exec(line);
const playerNameMatch = budgetPlayerNameRegex.exec(line);
if (playerNameMatch && playerNameMatch.length > 1) {
budgetEntry.player = playerNameMatch[1];
}
if (itemNameMatch && itemNameMatch.length > 1) {
budgetEntry.item = itemNameMatch[1];
}
}
return budgetEntry;
}; };
const getPlayerInfoFromString = (inputString) => { const getPlayerInfoFromString = (inputString) => {

View File

@ -20,7 +20,7 @@
[legendTitle]="legendTitle" [legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="chartYAxisLabel" [yAxisLabel]="lineChartLabel"
[autoScale]="autoscale" [autoScale]="autoscale"
[timeline]="timeline" [timeline]="timeline"
[roundDomains]="roundDomains"> [roundDomains]="roundDomains">
@ -32,15 +32,15 @@
[scheme]="colorScheme" [scheme]="colorScheme"
[results]="barChartData" [results]="barChartData"
[xAxis]="xAxis" [xAxis]="xAxis"
[yAxis]="yAxis" [yAxis]="barShowYAxis"
[legend]="legend" [legend]="legend"
[legendTitle]="legendTitle" [legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="barShowXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[animations]="barAnimations" [animations]="barAnimations"
[barPadding]="barPadding" [barPadding]="barPadding"
[xAxisTickFormatting]="axisFormatX" [xAxisTickFormatting]="axisFormat"
[yAxisTickFormatting]="axisFormatY"> [xAxisLabel]="'Minute'">
<ng-template #tooltipTemplate let-model="model"> <ng-template #tooltipTemplate let-model="model">
<small>{{'stats.fraction.tooltip.flag.minute' | translate}} {{model.series}}</small> <small>{{'stats.fraction.tooltip.flag.minute' | translate}} {{model.series}}</small>
<div>{{model.name}} {{'stats.fraction.tooltip.flag.flag' | translate}}</div> <div>{{model.name}} {{'stats.fraction.tooltip.flag.flag' | translate}}</div>

View File

@ -7,24 +7,24 @@
:host /deep/ mat-button-toggle { :host /deep/ mat-button-toggle {
color: #666666; color: #666666;
background: #e7e7e7; background: #e7e7e7;
}
:hover { :host /deep/ mat-button-toggle:hover {
background: #afafaf; background: #afafaf;
} }
&.mat-button-toggle-checked { :host /deep/ mat-button-toggle.mat-button-toggle-checked {
background: #ffffff; background: #ffffff;
} }
label.mat-button-toggle-label { :host /deep/ label.mat-button-toggle-label {
margin: 2px 0; margin: 2px 0;
} }
div.mat-button-toggle-label-content { :host /deep/ div.mat-button-toggle-label-content {
line-height: 25px; line-height: 25px;
margin-bottom: 0; margin-bottom: 0;
font-weight: normal; font-weight: normal;
}
} }
.chart-container { .chart-container {

View File

@ -1,4 +1,5 @@
import {Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core'; import {Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
import * as d3 from 'd3';
import {ChartUtils} from '../../../utils/chart-utils'; import {ChartUtils} from '../../../utils/chart-utils';
import {Fraction} from '../../../utils/fraction.enum'; import {Fraction} from '../../../utils/fraction.enum';
import {War} from '../../../models/model-interfaces'; import {War} from '../../../models/model-interfaces';
@ -8,7 +9,7 @@ import {TranslateService} from '@ngx-translate/core';
@Component({ @Component({
selector: 'war-detail-fraction', selector: 'war-detail-fraction',
templateUrl: './fraction-stats.component.html', templateUrl: './fraction-stats.component.html',
styleUrls: ['./fraction-stats.component.scss'] styleUrls: ['./fraction-stats.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
}) })
export class FractionStatsComponent implements OnInit, OnChanges { export class FractionStatsComponent implements OnInit, OnChanges {
@ -47,10 +48,10 @@ export class FractionStatsComponent implements OnInit, OnChanges {
labels; labels;
labelsKeys; labelsKeys;
chartYAxisLabel: string; lineChartLabel: string;
// line chart
showLineChart = true; showLineChart = true;
stepCurve = d3.curveStepAfter;
gradient = false; gradient = false;
yAxis = true; yAxis = true;
xAxis = true; xAxis = true;
@ -62,15 +63,16 @@ export class FractionStatsComponent implements OnInit, OnChanges {
timeline = false; timeline = false;
roundDomains = true; roundDomains = true;
// bar chart
barPadding = 0; barPadding = 0;
barAnimations = false; barAnimations = false;
barShowYAxis = false;
barShowXAxisLabel = true;
constructor(private translate: TranslateService) { constructor(private translate: TranslateService) {
} }
ngOnInit() { ngOnInit() {
this.setChartYAxisLabel(this.labels.points); this.setLineChartLabel(this.labels.points);
} }
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
@ -136,7 +138,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.activeChartSelect = newSelection; this.activeChartSelect = newSelection;
if (this.activeChartSelect !== this.labels.flag) { if (this.activeChartSelect !== this.labels.flag) {
this.showLineChart = true; this.showLineChart = true;
this.setChartYAxisLabel(this.activeChartSelect); this.setLineChartLabel(this.activeChartSelect);
switch (this.activeChartSelect) { switch (this.activeChartSelect) {
case this.labels.points: case this.labels.points:
this.lineChartData = this.tmpPointData; this.lineChartData = this.tmpPointData;
@ -206,7 +208,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1; const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1; const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1;
if (ChartUtils.isOneMinuteAhead(budgetEntryDate, this.tmpBudgetData)) { if (this.isTwoMinutesAhead(budgetEntryDate, this.tmpBudgetData)) {
this.tmpBudgetData[fractionChange].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), budgetEntry.newBudget)); this.tmpBudgetData[fractionChange].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), budgetEntry.newBudget));
this.tmpBudgetData[fractionOld].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time), this.tmpBudgetData[fractionOld].series.push(ChartUtils.getSeriesEntry(new Date(budgetEntry.time),
this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value)); this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value));
@ -231,7 +233,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
if (killEntry.fraction === 'OPFOR') { if (killEntry.fraction === 'OPFOR') {
killCountOpfor++; killCountOpfor++;
} }
if (ChartUtils.isOneMinuteAhead(killEntryDate, this.tmpKillData)) { if (this.isTwoMinutesAhead(killEntryDate, this.tmpKillData)) {
this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor)); this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor));
this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor)); this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor));
} }
@ -242,7 +244,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
if (killEntry.fraction === 'OPFOR') { if (killEntry.fraction === 'OPFOR') {
ffKillCountOpfor++; ffKillCountOpfor++;
} }
if (ChartUtils.isOneMinuteAhead(killEntryDate, this.tmpFrienlyFireData)) { if (this.isTwoMinutesAhead(killEntryDate, this.tmpFrienlyFireData)) {
this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor)); this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor));
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor)); this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
} }
@ -273,7 +275,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
reviveCountOpfor++; reviveCountOpfor++;
} }
if (ChartUtils.isOneMinuteAhead(reviveEntryDate, this.tmpReviveData)) { if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpReviveData)) {
this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor)); this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor));
this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor)); this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor));
} }
@ -283,7 +285,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
stabilizeCountOpfor++; stabilizeCountOpfor++;
} }
if (ChartUtils.isOneMinuteAhead(reviveEntryDate, this.tmpStabilizeData)) { if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpStabilizeData)) {
this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor)); this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor));
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor)); this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
} }
@ -342,7 +344,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} }
} }
} }
if (ChartUtils.isOneMinuteAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) { if (this.isTwoMinutesAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor)); this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor));
this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor)); this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor));
if (vehicleEntry.vehicleClass) { if (vehicleEntry.vehicleClass) {
@ -374,8 +376,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
transportCountOpfor++; transportCountOpfor++;
} }
if (ChartUtils.isOneMinuteAhead(transportEntryDate, this.tmpTransportData) || if (this.isTwoMinutesAhead(transportEntryDate, this.tmpTransportData) || index === this.logData.transport.length - 1) {
index === this.logData.transport.length - 1) {
this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor)); this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor));
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor)); this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
} }
@ -450,6 +451,10 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.initialized.flag = true; this.initialized.flag = true;
} }
protected isTwoMinutesAhead(entryDate: Date, tmpData: any): boolean {
return entryDate.getTime() >= tmpData[0].series[tmpData[0].series.length - 1].name.getTime() + (1.5 * 60000);
}
initializeTempCollections() { initializeTempCollections() {
this.tmpPointData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpPointData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR); this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
@ -491,21 +496,17 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} }
} }
setChartYAxisLabel(i18n: string) { setLineChartLabel(i18n: string) {
this.translate.get(i18n).subscribe((translated) => { this.translate.get(i18n).subscribe((translated) => {
this.chartYAxisLabel = translated; this.lineChartLabel = translated;
}); });
} }
axisFormatX(val) { axisFormat(val) {
if (val % 10 === 0) { if (val % 10 === 0) {
return val; return val
} else { } else {
return ''; return ''
} }
} }
axisFormatY(val) {
return '';
}
} }

View File

@ -4,7 +4,7 @@
height: 68vh; height: 68vh;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12); box-shadow: 0 5px 5px -3px rgba(0,0,0,.2), 0 8px 10px 1px rgba(0,0,0,.14), 0 3px 14px 2px rgba(0,0,0,.12);
border-bottom: 1px solid #dadada; border-bottom: 1px solid #dadada;
} }

View File

@ -1,25 +1,22 @@
<div class="fade-in scoreboard-table"> <div class="fade-in scoreboard-table">
<mat-table matSort <mat-table matSort
[dataSource]="sortedRows" [dataSource]="sortedRows"
matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
(matSortChange)="sortScoreboardData($event)" (matSortChange)="sortScoreboardData($event)"
class="mat-elevation-z8"> class="mat-elevation-z8">
<ng-container matColumnDef="{{tableHead[0].prop}}"> <ng-container matColumnDef="{{tableHead[0].prop}}">
<mat-header-cell *matHeaderCellDef <mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
<mat-cell *matCellDef="let element" <mat-cell *matCellDef="let element"
[style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR"> [style.color]="element['fraction'] === 'BLUFOR' ? fraction.COLOR_BLUFOR : fraction.COLOR_OPFOR">
{{element.name}} {{element.name}}
</mat-cell> </mat-cell>
</ng-container> </ng-container>
<ng-container matColumnDef="{{tableHead[1].prop}}"> <ng-container matColumnDef="{{tableHead[1].prop}}">
<mat-header-cell *matHeaderCellDef <mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell>
mat-sort-header="{{tableHead[1].prop}}">{{tableHead[1].head | translate}}</mat-header-cell> <mat-cell *matCellDef="let element">{{element.fraction === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
<mat-cell *matCellDef="let element">{{element.fraction ===
'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}}</mat-cell>
</ng-container> </ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}"> <ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">

View File

@ -7,14 +7,14 @@
:host /deep/ mat-button-toggle { :host /deep/ mat-button-toggle {
color: #666666; color: #666666;
background: #e7e7e7; background: #e7e7e7;
}
:hover { :host /deep/ mat-button-toggle:hover {
background: #afafaf; background: #afafaf;
} }
&.mat-button-toggle-checked { :host /deep/ mat-button-toggle.mat-button-toggle-checked {
background: #ffffff; background: #ffffff;
}
} }
:host /deep/ label.mat-button-toggle-label { :host /deep/ label.mat-button-toggle-label {

View File

@ -21,7 +21,6 @@
[showXAxisLabel]="showXAxisLabel" [showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel" [showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="barChartLabel" [yAxisLabel]="barChartLabel"
[animations]="barAnimations"
[barPadding]="barPadding" [barPadding]="barPadding"
[roundDomains]="roundDomains"> [roundDomains]="roundDomains">
</ngx-charts-bar-vertical> </ngx-charts-bar-vertical>

View File

@ -5,10 +5,10 @@ import {ChartUtils} from '../../../utils/chart-utils';
@Component({ @Component({
selector: 'cc-server-statistics', selector: 'cc-server-statistics',
templateUrl: './server-stats.component.html', templateUrl: './server-stats.component.html',
styleUrls: ['./server-stats.component.scss'] styleUrls: ['./server-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
}) })
export class ServerStatsComponent implements OnInit, OnChanges { export class ServerStatsComponent implements OnInit, OnChanges {
@ViewChild('overview') private overviewContainer: ElementRef; @ViewChild('overview') private overviewContainer: ElementRef;
@ -54,7 +54,6 @@ export class ServerStatsComponent implements OnInit, OnChanges {
autoscale = true; autoscale = true;
timeline = false; timeline = false;
roundDomains = true; roundDomains = true;
barAnimations = false;
barPadding = 2; barPadding = 2;
colorScheme = { colorScheme = {
name: 'nightLights', name: 'nightLights',
@ -76,8 +75,8 @@ export class ServerStatsComponent implements OnInit, OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if ((changes.war || changes.performanceData) && this.performanceData) { if ((changes.war || changes.performanceData) && this.performanceData) {
this.translate.get(['stats.performance.select.timeline.label.minimum', this.translate.get(['stats.performance.select.timeline.label.minimum',
'stats.performance.select.timeline.label.average', 'stats.performance.select.timeline.label.average',
'stats.performance.select.timeline.label.maximum']).subscribe((res) => { 'stats.performance.select.timeline.label.maximum']).subscribe((res) => {
const resValues = Object.keys(res).map(val => res[val]); const resValues = Object.keys(res).map(val => res[val]);
this.initializeChartData(resValues[2], resValues[0], resValues[1]); this.initializeChartData(resValues[2], resValues[0], resValues[1]);
}); });
@ -163,13 +162,13 @@ export class ServerStatsComponent implements OnInit, OnChanges {
} }
} }
this.tmpSingleAvg.push({ this.tmpSingleAvg.push({
name: entry.entityName, name: entry.entityName,
value: entry.singleAvgFps value: entry.singleAvgFps
}); });
this.tmpSingleMin.push({ this.tmpSingleMin.push({
name: entry.entityName, name: entry.entityName,
value: entry.singleMinFps value: entry.singleMinFps
}); });
}); });
tmpAvgArray = tmpAvgArray.map(x => Math.round(x / this.performanceData.length)); tmpAvgArray = tmpAvgArray.map(x => Math.round(x / this.performanceData.length));

View File

@ -0,0 +1,77 @@
.war-header-container {
width: 920px;
min-height: 165px;
padding-top: 12px;
margin: auto;
}
.head-field {
font-size: 22px;
margin-top: 10px;
margin-bottom: 10px;
}
form.tab-control {
padding: 10px;
}
span.tab-control {
margin: 4px 30px 4px 55px;
padding: 4px 16px;
}
.nav-tabs > li.active > a {
background: #ffffff;
border-bottom: none;
}
.nav-tabs > li.active {
position: relative;
top: 1px;
z-index: 10;
}
.nav-tabs mat-icon {
color: #666666;
height: 26px;
width: 26px;
display: inline-block;
vertical-align: middle;
}
:host/deep/.mat-icon-stats-performance g {
stroke: #666666;
}
.nav-tabs {
width: 1000px;
margin: auto;
clear: both;
border-bottom: 0;
}
.nav-tab-hidden {
visibility: hidden;
}
.nav-tabs > li > a {
background: #e7e7e7;
border: 1px solid #dadada;
}
.nav-tabs > li:not(.active) > a:hover {
background: #afafaf;
}
.nav-tabs > li:last-child {
margin-left: 65px;
}
.nav-link {
cursor: pointer !important;
color: #666666 !important;
}
.nav-tabs > li.deactivated > a.nav-link {
cursor: not-allowed !important;
}

View File

@ -1,79 +0,0 @@
.war-header-container {
width: 920px;
min-height: 165px;
padding-top: 12px;
margin: auto;
}
.head-field {
font-size: 22px;
margin-top: 10px;
margin-bottom: 10px;
}
form.tab-control {
padding: 10px;
}
span.tab-control {
margin: 4px 30px 4px 55px;
padding: 4px 16px;
}
:host /deep/ .mat-icon-stats-performance g {
stroke: #666666;
}
.nav-tabs {
width: 1000px;
margin: auto;
clear: both;
border-bottom: 0;
mat-icon {
color: #666666;
height: 26px;
width: 26px;
display: inline-block;
vertical-align: middle;
}
> li {
> a {
background: #e7e7e7;
border: 1px solid #dadada;
}
}
> li.active {
position: relative;
top: 1px;
z-index: 10;
> a {
background: #ffffff;
border-bottom: none;
}
}
> li:not(.active) > a:hover {
background: #afafaf;
}
> li.deactivated > a.nav-link {
cursor: not-allowed !important;
}
> li:last-child {
margin-left: 65px;
}
}
.nav-tab-hidden {
visibility: hidden;
}
.nav-link {
cursor: pointer !important;
color: #666666 !important;
}

View File

@ -11,7 +11,7 @@ import {ScoreboardComponent} from '../scoreboard/scoreboard.component';
@Component({ @Component({
selector: 'war-detail', selector: 'war-detail',
templateUrl: './war-header.component.html', templateUrl: './war-header.component.html',
styleUrls: ['./war-header.component.scss'] styleUrls: ['./war-header.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
}) })
export class WarHeaderComponent implements OnInit { export class WarHeaderComponent implements OnInit {

View File

@ -3,7 +3,7 @@
border-right: 1px solid #dadada; border-right: 1px solid #dadada;
} }
.war-item:hover, .selected { .war-item:hover, .selected{
background: linear-gradient(80deg, white 0%, #e7e7e7 120%); background: linear-gradient(80deg, white 0%, #e7e7e7 120%);
border-bottom: 1px solid #dadada; border-bottom: 1px solid #dadada;
} }

View File

@ -9,7 +9,7 @@
cursor: pointer; cursor: pointer;
} }
.list-header:hover, .selected { .list-header:hover, .selected{
background: linear-gradient(80deg, white 0%, #e7e7e7 120%); background: linear-gradient(80deg, white 0%, #e7e7e7 120%);
} }

View File

@ -34,8 +34,4 @@ export class ChartUtils {
'value': value2 'value': value2
}]; }];
} }
public static isOneMinuteAhead(entryDate: Date, tmpData: any): boolean {
return entryDate.getTime() >= tmpData[0].series[tmpData[0].series.length - 1].name.getTime() + 60000;
}
} }