Compare commits
No commits in common. "278e130614313d8ed1b43d051822f000b9f80b4d" and "e263ce050ac42d020dd0b9e1dbd8607684fe7726" have entirely different histories.
278e130614
...
e263ce050a
|
@ -176,15 +176,8 @@ wars.route('/:id')
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete linked appearances
|
// delete players having this war ID as foreign key
|
||||||
PlayerModel.find({warId: item._id}).remove().exec();
|
PlayerModel.find({warId: item._id}).remove().exec();
|
||||||
LogKillModel.find({war: item._id}).remove().exec();
|
|
||||||
LogRespawnModel.find({war: item._id}).remove().exec();
|
|
||||||
LogReviveModel.find({war: item._id}).remove().exec();
|
|
||||||
LogFlagModel.find({war: item._id}).remove().exec();
|
|
||||||
LogBudgetModel.find({war: item._id}).remove().exec();
|
|
||||||
LogTransportModel.find({war: item._id}).remove().exec();
|
|
||||||
LogPointsModel.find({war: item._id}).remove().exec();
|
|
||||||
|
|
||||||
// check if logfiles exist and delete from fs
|
// check if logfiles exist and delete from fs
|
||||||
const warDir = __dirname + '/../resource/logs/' + req.params.id;
|
const warDir = __dirname + '/../resource/logs/' + req.params.id;
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:host /deep/ .nav-link:hover {
|
:host /deep/ .nav-link:hover {
|
||||||
background: #afafaf;
|
background: #286090;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,21 +100,6 @@
|
||||||
|
|
||||||
/* ########### CHART-TAB ######## */
|
/* ########### CHART-TAB ######## */
|
||||||
|
|
||||||
.btn-dark {
|
|
||||||
background: #4b4b4b;
|
|
||||||
color: #f5f5f5;
|
|
||||||
border-color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-dark:hover {
|
|
||||||
background: #afafaf;
|
|
||||||
color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-dark.active {
|
|
||||||
background: #222222;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chart-container {
|
.chart-container {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
margin: 2%;
|
margin: 2%;
|
||||||
|
@ -132,6 +117,6 @@
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*.dropdown-menu > li > a {*/
|
.dropdown-menu > li > a {
|
||||||
/*cursor: pointer;*/
|
cursor: pointer;
|
||||||
/*}*/
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
'left=20,top=20,width=1380,height=600,toolbar=1,resizable=0'); return false;"
|
'left=20,top=20,width=1380,height=600,toolbar=1,resizable=0'); return false;"
|
||||||
href="resource/logs/{{war._id}}/clean.log">
|
href="resource/logs/{{war._id}}/clean.log">
|
||||||
Logfile anzeigen</a>
|
Logfile anzeigen</a>
|
||||||
<form *ngIf="staticTabs.tabs[0].active" class="form-group">
|
<form class="form-group">
|
||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
<input type="radio" name="fractSelect"
|
<input type="radio" name="fractSelect"
|
||||||
[checked]="(fractionRadioSelect == undefined) ? 'true' : 'false'"
|
[checked]="(fractionRadioSelect == undefined) ? 'true' : 'false'"
|
||||||
|
@ -117,16 +117,16 @@
|
||||||
<!--</div>-->
|
<!--</div>-->
|
||||||
|
|
||||||
<div class="chart-select-group btn-group" (click)="selectChart()">
|
<div class="chart-select-group btn-group" (click)="selectChart()">
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelPoints}}">{{labelPoints}}</label>
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel" btnRadio="{{labelPoints}}">{{labelPoints}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelBudget}}">{{labelBudget}}</label>
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel" btnRadio="{{labelBudget}}">{{labelBudget}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelKill}}">{{labelKill}}</label>
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel" btnRadio="{{labelKill}}">{{labelKill}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label>
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel" btnRadio="{{labelFriendlyFire}}">{{labelFriendlyFire}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelRevive}}">{{labelRevive}}</label>
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel" btnRadio="{{labelRevive}}">{{labelRevive}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel"
|
||||||
btnRadio="{{labelStabilize}}">{{labelStabilize}}</label>
|
btnRadio="{{labelStabilize}}">{{labelStabilize}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel"
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel"
|
||||||
btnRadio="{{labelTransport}}">{{labelTransport}}</label>
|
btnRadio="{{labelTransport}}">{{labelTransport}}</label>
|
||||||
<label class="btn btn-default btn-dark" [(ngModel)]="chartSelectModel" btnRadio="{{labelFlag}}">{{labelFlag}}</label>
|
<label class="btn btn-default" [(ngModel)]="chartSelectModel" btnRadio="{{labelFlag}}">{{labelFlag}}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="showLineChart" class="chart-container">
|
<div *ngIf="showLineChart" class="chart-container">
|
||||||
|
|
|
@ -51,8 +51,6 @@ export class WarDetailComponent {
|
||||||
tmpStabilizeData;
|
tmpStabilizeData;
|
||||||
tmpFlagCaptureData;
|
tmpFlagCaptureData;
|
||||||
|
|
||||||
initialized;
|
|
||||||
|
|
||||||
colorScheme = {
|
colorScheme = {
|
||||||
domain: ['#0000FF', '#B22222']
|
domain: ['#0000FF', '#B22222']
|
||||||
};
|
};
|
||||||
|
@ -79,6 +77,7 @@ export class WarDetailComponent {
|
||||||
autoscale = true;
|
autoscale = true;
|
||||||
timeline = false;
|
timeline = false;
|
||||||
roundDomains = true;
|
roundDomains = true;
|
||||||
|
fractionChartsInitialized: boolean = false;
|
||||||
|
|
||||||
startDateObj;
|
startDateObj;
|
||||||
|
|
||||||
|
@ -102,14 +101,7 @@ export class WarDetailComponent {
|
||||||
this.rows = war.players;
|
this.rows = war.players;
|
||||||
this.playerChart = ChartUtils.getSingleDataArray('CSAT', war.playersOpfor, 'NATO', war.playersBlufor);
|
this.playerChart = ChartUtils.getSingleDataArray('CSAT', war.playersOpfor, 'NATO', war.playersBlufor);
|
||||||
|
|
||||||
this.initialized = {
|
this.fractionChartsInitialized = false;
|
||||||
basic: false,
|
|
||||||
budget: false,
|
|
||||||
kill: false,
|
|
||||||
revive: false,
|
|
||||||
transport: false,
|
|
||||||
flag: false
|
|
||||||
};
|
|
||||||
Object.assign(this, [this.playerChart, this.lineChartData, this.areaChartData]);
|
Object.assign(this, [this.playerChart, this.lineChartData, this.areaChartData]);
|
||||||
this.chartSelectModel = this.labelPoints;
|
this.chartSelectModel = this.labelPoints;
|
||||||
|
|
||||||
|
@ -142,32 +134,25 @@ export class WarDetailComponent {
|
||||||
this.lineChartData = this.tmpPointData;
|
this.lineChartData = this.tmpPointData;
|
||||||
break;
|
break;
|
||||||
case this.labelBudget:
|
case this.labelBudget:
|
||||||
this.initBudgetData();
|
|
||||||
this.lineChartData = this.tmpBudgetData;
|
this.lineChartData = this.tmpBudgetData;
|
||||||
break;
|
break;
|
||||||
case this.labelKill:
|
case this.labelKill:
|
||||||
this.initKillData();
|
|
||||||
this.lineChartData = this.tmpKillData;
|
this.lineChartData = this.tmpKillData;
|
||||||
break;
|
break;
|
||||||
case this.labelFriendlyFire:
|
case this.labelFriendlyFire:
|
||||||
this.initKillData();
|
|
||||||
this.lineChartData = this.tmpFrienlyFireData;
|
this.lineChartData = this.tmpFrienlyFireData;
|
||||||
break;
|
break;
|
||||||
case this.labelRevive:
|
case this.labelRevive:
|
||||||
this.initRevive();
|
|
||||||
this.lineChartData = this.tmpReviveData;
|
this.lineChartData = this.tmpReviveData;
|
||||||
break;
|
break;
|
||||||
case this.labelStabilize:
|
case this.labelStabilize:
|
||||||
this.initRevive();
|
|
||||||
this.lineChartData = this.tmpStabilizeData;
|
this.lineChartData = this.tmpStabilizeData;
|
||||||
break;
|
break;
|
||||||
case this.labelTransport:
|
case this.labelTransport:
|
||||||
this.initTransportData();
|
|
||||||
this.lineChartData = this.tmpTransportData;
|
this.lineChartData = this.tmpTransportData;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.initFlagHoldData();
|
|
||||||
this.showLineChart = false;
|
this.showLineChart = false;
|
||||||
this.areaChartData = this.tmpFlagCaptureData;
|
this.areaChartData = this.tmpFlagCaptureData;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +180,7 @@ export class WarDetailComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
loadFractionData() {
|
loadFractionData() {
|
||||||
if (this.initialized.basic) {
|
if (this.fractionChartsInitialized) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,11 +188,17 @@ export class WarDetailComponent {
|
||||||
|
|
||||||
this.logsService.getFullLog(this.war._id).subscribe((data) => {
|
this.logsService.getFullLog(this.war._id).subscribe((data) => {
|
||||||
this.logData = data;
|
this.logData = data;
|
||||||
|
|
||||||
this.initPointData();
|
this.initPointData();
|
||||||
this.showLineChart = true;
|
this.initBudgetData();
|
||||||
this.lineChartLabel = this.labelPoints;
|
this.initKillData();
|
||||||
this.lineChartData = this.tmpPointData;
|
this.initRevive();
|
||||||
this.initialized.basic = true;
|
this.initTransportData();
|
||||||
|
this.initFlagHoldData();
|
||||||
|
|
||||||
|
this.addFinalTimeDataEntriesAndPopulate(new Date(this.war.endDate));
|
||||||
|
|
||||||
|
this.fractionChartsInitialized = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,13 +207,9 @@ export class WarDetailComponent {
|
||||||
this.tmpPointData[0].series.push(ChartUtils.getSeriesEntry(new Date(pointEntry.time), pointEntry.ptBlufor));
|
this.tmpPointData[0].series.push(ChartUtils.getSeriesEntry(new Date(pointEntry.time), pointEntry.ptBlufor));
|
||||||
this.tmpPointData[1].series.push(ChartUtils.getSeriesEntry(new Date(pointEntry.time), pointEntry.ptOpfor));
|
this.tmpPointData[1].series.push(ChartUtils.getSeriesEntry(new Date(pointEntry.time), pointEntry.ptOpfor));
|
||||||
});
|
});
|
||||||
this.addFinalTimeData(this.tmpPointData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initBudgetData() {
|
initBudgetData() {
|
||||||
if (this.initialized.budget) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.logData.budget.forEach(budgetEntry => {
|
this.logData.budget.forEach(budgetEntry => {
|
||||||
const budgetEntryDate = new Date(budgetEntry.time);
|
const budgetEntryDate = new Date(budgetEntry.time);
|
||||||
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
|
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
|
||||||
|
@ -234,14 +221,9 @@ export class WarDetailComponent {
|
||||||
this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value));
|
this.tmpBudgetData[fractionOld].series[this.tmpBudgetData[fractionOld].series.length - 1].value));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.addFinalTimeData(this.tmpBudgetData);
|
|
||||||
this.initialized.budget = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initKillData() {
|
initKillData() {
|
||||||
if (!this.initialized.kill) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let killCountBlufor = 0, killCountOpfor = 0, ffKillCountBlufor = 0, ffKillCountOpfor = 0;
|
let killCountBlufor = 0, killCountOpfor = 0, ffKillCountBlufor = 0, ffKillCountOpfor = 0;
|
||||||
|
|
||||||
for (const {killEntry, index} of this.logData.kill.map((killEntry, index) => ({killEntry, index}))) {
|
for (const {killEntry, index} of this.logData.kill.map((killEntry, index) => ({killEntry, index}))) {
|
||||||
|
@ -276,16 +258,9 @@ export class WarDetailComponent {
|
||||||
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
|
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addFinalTimeData(this.tmpKillData);
|
|
||||||
this.addFinalTimeData(this.tmpFrienlyFireData)
|
|
||||||
this.initialized.kill = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initRevive() {
|
initRevive() {
|
||||||
if (this.initialized.revive) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let reviveCountBlufor = 0, reviveCountOpfor = 0, stabilizeCountBlufor = 0, stabilizeCountOpfor = 0;
|
let reviveCountBlufor = 0, reviveCountOpfor = 0, stabilizeCountBlufor = 0, stabilizeCountOpfor = 0;
|
||||||
for (const {reviveEntry, index} of this.logData.revive.map((reviveEntry, index) => ({reviveEntry, index}))) {
|
for (const {reviveEntry, index} of this.logData.revive.map((reviveEntry, index) => ({reviveEntry, index}))) {
|
||||||
const reviveEntryDate = new Date(reviveEntry.time);
|
const reviveEntryDate = new Date(reviveEntry.time);
|
||||||
|
@ -317,15 +292,9 @@ export class WarDetailComponent {
|
||||||
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
|
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.addFinalTimeData(this.tmpReviveData);
|
|
||||||
this.addFinalTimeData(this.tmpStabilizeData);
|
|
||||||
this.initialized.revive = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initTransportData() {
|
initTransportData() {
|
||||||
if (this.initialized.transport) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let transportCountBlufor = 0, transportCountOpfor = 0;
|
let transportCountBlufor = 0, transportCountOpfor = 0;
|
||||||
for (const {transportEntry, index} of this.logData.transport.map((transportEntry, index) => ({
|
for (const {transportEntry, index} of this.logData.transport.map((transportEntry, index) => ({
|
||||||
transportEntry,
|
transportEntry,
|
||||||
|
@ -342,15 +311,9 @@ export class WarDetailComponent {
|
||||||
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
|
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.addFinalTimeData(this.tmpTransportData);
|
|
||||||
this.initialized.transport = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initFlagHoldData() {
|
initFlagHoldData() {
|
||||||
if (this.initialized.flag) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let flagStatusBlufor = true;
|
let flagStatusBlufor = true;
|
||||||
let flagStatusOpfor = true;
|
let flagStatusOpfor = true;
|
||||||
this.tmpFlagCaptureData[0].series.push(ChartUtils.getSeriesEntry(this.startDateObj, flagStatusBlufor));
|
this.tmpFlagCaptureData[0].series.push(ChartUtils.getSeriesEntry(this.startDateObj, flagStatusBlufor));
|
||||||
|
@ -358,17 +321,14 @@ export class WarDetailComponent {
|
||||||
|
|
||||||
this.logData.flag.forEach(flagEntry => {
|
this.logData.flag.forEach(flagEntry => {
|
||||||
if (flagEntry.flagFraction === 'BLUFOR') {
|
if (flagEntry.flagFraction === 'BLUFOR') {
|
||||||
flagStatusBlufor = !flagEntry.capture;
|
flagStatusBlufor = !flagEntry.capture
|
||||||
} else {
|
} else {
|
||||||
flagStatusOpfor = !flagEntry.capture;
|
flagStatusOpfor = !flagEntry.capture;
|
||||||
}
|
}
|
||||||
this.tmpFlagCaptureData[flagEntry.flagFraction === 'BLUFOR' ? 0 : 1].series.push(
|
this.tmpFlagCaptureData[flagEntry.flagFraction === 'BLUFOR' ? 0 : 1].series.push(
|
||||||
ChartUtils.getSeriesEntry(new Date(flagEntry.time), flagEntry.flagFraction === 'BLUFOR' ? flagStatusBlufor : flagStatusOpfor)
|
ChartUtils.getSeriesEntry(new Date(flagEntry.time), flagEntry.fraction === 'BLUFOR' ? flagStatusBlufor : flagStatusOpfor)
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addFinalTimeData(this.tmpFlagCaptureData);
|
|
||||||
this.initialized.flag = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static isTwoMinutesAhead(entryDate: Date, tmpData: any): boolean {
|
private static isTwoMinutesAhead(entryDate: Date, tmpData: any): boolean {
|
||||||
|
@ -394,18 +354,21 @@ export class WarDetailComponent {
|
||||||
this.tmpBudgetData[1].series.push(ChartUtils.getSeriesEntry(this.startDateObj, this.war.budgetOpfor));
|
this.tmpBudgetData[1].series.push(ChartUtils.getSeriesEntry(this.startDateObj, this.war.budgetOpfor));
|
||||||
}
|
}
|
||||||
|
|
||||||
addFinalTimeData(tmpCollection) {
|
addFinalTimeDataEntriesAndPopulate(endDate) {
|
||||||
const endDate = new Date(this.war.endDate);
|
[this.tmpPointData, this.tmpTransportData, this.tmpReviveData, this.tmpStabilizeData,
|
||||||
if (tmpCollection === this.tmpBudgetData) {
|
this.tmpKillData, this.tmpFrienlyFireData, this.tmpFlagCaptureData].forEach(tmp => {
|
||||||
this.tmpBudgetData[0].series.push(ChartUtils.getSeriesEntry(endDate, this.war.endBudgetBlufor));
|
|
||||||
this.tmpBudgetData[1].series.push(ChartUtils.getSeriesEntry(endDate, this.war.endBudgetOpfor));
|
|
||||||
} else {
|
|
||||||
for (let j in [0, 1]) {
|
for (let j in [0, 1]) {
|
||||||
if (tmpCollection[j].series[tmpCollection[j].series.length - 1].name < endDate) {
|
if (tmp[j].series[tmp[j].series.length - 1].name < endDate) {
|
||||||
tmpCollection[j].series.push(ChartUtils.getSeriesEntry(endDate, tmpCollection[j].series[tmpCollection[j].series.length - 1].value));
|
tmp[j].series.push(ChartUtils.getSeriesEntry(endDate, tmp[j].series[tmp[j].series.length - 1].value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
this.tmpBudgetData[0].series.push(ChartUtils.getSeriesEntry(endDate, this.war.endBudgetBlufor));
|
||||||
|
this.tmpBudgetData[1].series.push(ChartUtils.getSeriesEntry(endDate, this.war.endBudgetOpfor));
|
||||||
|
|
||||||
|
this.showLineChart = true;
|
||||||
|
this.lineChartLabel = this.labelPoints;
|
||||||
|
this.lineChartData = this.tmpPointData;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue