fix log parser; readjust war detail view
parent
d3f3b3410a
commit
55a4662b40
|
@ -3,6 +3,7 @@
|
||||||
"licence": "CC BY-SA 4.0",
|
"licence": "CC BY-SA 4.0",
|
||||||
"description": "RESTful API for Operation Pandora Trigger Command Center, includes signature generator",
|
"description": "RESTful API for Operation Pandora Trigger Command Center, includes signature generator",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
|
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "NODE_ENV=production node server.js",
|
"start": "NODE_ENV=production node server.js",
|
||||||
|
|
|
@ -150,7 +150,7 @@ wars.route('/:id')
|
||||||
err.status = codes.notfound;
|
err.status = codes.notfound;
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
PlayerModel.find({warId: item._id}, {}, {sort: {sort: 'desc'}}, (err, items) => {
|
PlayerModel.find({warId: item._id}, {}, {sort: {kill: 'desc'}}, (err, items) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const timeStringToDecimal = require('../tools/util').timeStringToDecimal;
|
const timeStringToDecimal = require('../tools/util').timeStringToDecimal;
|
||||||
const arrayContains = require('./util').arrayContains;
|
const playerArrayContains = require('./util').playerArrayContains;
|
||||||
|
|
||||||
const parseWarLog = (lineArray, war) => {
|
const parseWarLog = (lineArray, war) => {
|
||||||
const nameToLongError = 'Error: ENAMETOOLONG: name too long, open \'';
|
const nameToLongError = 'Error: ENAMETOOLONG: name too long, open \'';
|
||||||
|
@ -20,7 +20,7 @@ const parseWarLog = (lineArray, war) => {
|
||||||
|
|
||||||
const addPlayersIfNotExists = (inputPlayers) => {
|
const addPlayersIfNotExists = (inputPlayers) => {
|
||||||
inputPlayers.forEach(player => {
|
inputPlayers.forEach(player => {
|
||||||
if (player && player.name && player.fraction && !arrayContains(stats.players, player)) {
|
if (player && player.name && player.fraction && !playerArrayContains(stats.players, player)) {
|
||||||
player['warId'] = war._id;
|
player['warId'] = war._id;
|
||||||
stats.players.push(player);
|
stats.players.push(player);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,11 @@ const sortCollectionBy = (collection, key) => {
|
||||||
return collection;
|
return collection;
|
||||||
};
|
};
|
||||||
|
|
||||||
const arrayContains = (arr, item) => {
|
const playerArrayContains = (arr, item) => {
|
||||||
let i = 0, count = arr.length, matchFound = false;
|
let i = 0, count = arr.length, matchFound = false;
|
||||||
|
|
||||||
for (; i < count; i++) {
|
for (; i < count; i++) {
|
||||||
if (arr[i] === item) {
|
if (arr[i].name === item.name && arr[i].fraction === item.fraction) {
|
||||||
matchFound = true;
|
matchFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,6 @@ const decimalToTimeString = (decimal) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.sortCollection = sortCollectionBy;
|
exports.sortCollection = sortCollectionBy;
|
||||||
exports.arrayContains = arrayContains;
|
exports.playerArrayContains = playerArrayContains;
|
||||||
exports.timeStringToDecimal = timeStringToDecimal;
|
exports.timeStringToDecimal = timeStringToDecimal;
|
||||||
exports.decimalToTimeString = decimalToTimeString;
|
exports.decimalToTimeString = decimalToTimeString;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
"name": "opt-cc",
|
"name": "opt-cc",
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run deploy-static-prod && npm start --prefix ./api",
|
"start": "npm run deploy-static-prod && npm start --prefix ./api",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "opt-cc-static",
|
"name": "opt-cc-static",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"author": "Florian Hartwich <hardi@noarch.de>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"angular-cli": {},
|
"angular-cli": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -30,7 +31,6 @@
|
||||||
"jquery": "^3.1.0",
|
"jquery": "^3.1.0",
|
||||||
"jquery-ui": "^1.12.0",
|
"jquery-ui": "^1.12.0",
|
||||||
"jquery-ui-bundle": "^1.11.4",
|
"jquery-ui-bundle": "^1.11.4",
|
||||||
"ngx-bootstrap": "^2.0.0-beta.6",
|
|
||||||
"ngx-clipboard": "^8.1.0",
|
"ngx-clipboard": "^8.1.0",
|
||||||
"ngx-cookie-service": "^1.0.9",
|
"ngx-cookie-service": "^1.0.9",
|
||||||
"ngx-infinite-scroll": "^0.5.2",
|
"ngx-infinite-scroll": "^0.5.2",
|
||||||
|
|
|
@ -91,6 +91,10 @@ export class CampaignPlayerDetailComponent {
|
||||||
this.reviveData = this.assignData(this.yAxisRevive, "revive");
|
this.reviveData = this.assignData(this.yAxisRevive, "revive");
|
||||||
this.captureData = this.assignData(this.yAxisCapture, "flagTouch");
|
this.captureData = this.assignData(this.yAxisCapture, "flagTouch");
|
||||||
|
|
||||||
|
if (this.totalDeath === 0) {
|
||||||
|
// avoid infinite or NaN with no death
|
||||||
|
this.totalDeath = 1;
|
||||||
|
}
|
||||||
this.kdRatio = parseFloat((this.totalKills / this.totalDeath).toFixed(2));
|
this.kdRatio = parseFloat((this.totalKills / this.totalDeath).toFixed(2));
|
||||||
if (this.kdRatio > 1) this.maxKd = this.kdRatio * 1.7;
|
if (this.kdRatio > 1) this.maxKd = this.kdRatio * 1.7;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
width: 4%;
|
width: 4%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.head-field {
|
||||||
|
font-size: 24px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1500px) {
|
@media screen and (min-width: 1500px) {
|
||||||
.vertical-spacer {
|
.vertical-spacer {
|
||||||
width: 15%;
|
width: 15%;
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
<div class=vertical-spacer>
|
<div class=vertical-spacer>
|
||||||
</div>
|
</div>
|
||||||
<div style="overflow:hidden">
|
<div style="overflow:hidden">
|
||||||
<div style="width: 920px;min-height: 263px;">
|
<div style="width: 920px;min-height: 205px;">
|
||||||
<h2>{{war.title}} - vom {{war.date | date: 'dd.MM.yyyy'}}</h2>
|
<h2>{{war.title}} - vom {{war.date | date: 'dd.MM.yyyy'}}</h2>
|
||||||
<h3 class="pull-left" style="width: 250px">
|
<div class="pull-left head-field" style="width: 250px">
|
||||||
<h4>Endpunktestand:</h4>
|
<h4>Endpunktestand:</h4>
|
||||||
<span class="text-blufor" style="font-weight: bold; margin-right: 10px">NATO {{war.ptBlufor}}</span>
|
<span class="text-blufor" style="font-weight: bold; margin-right: 10px">NATO {{war.ptBlufor}}</span>
|
||||||
<span style="font-size: x-large">|</span>
|
<span style="font-size: x-large">|</span>
|
||||||
<span class="text-opfor" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} CSAT</span>
|
<span class="text-opfor" style="font-weight: bold; margin-left: 10px;">{{war.ptOpfor}} CSAT</span>
|
||||||
</h3>
|
</div>
|
||||||
|
|
||||||
<h3 class="pull-left" style="padding-left: 150px;">
|
<div class="pull-left head-field " style="padding-left: 150px;">
|
||||||
<h4>Teilnehmer:</h4>
|
<h4 style="margin-bottom: 0;">Teilnehmer:</h4>
|
||||||
<ngx-charts-pie-chart
|
<ngx-charts-pie-chart
|
||||||
[view]="[150, 150]"
|
[view]="[120, 120]"
|
||||||
[scheme]="{domain: ['#B22222', '#0000FF']}"
|
[scheme]="{domain: ['#B22222', '#0000FF']}"
|
||||||
[results]="playerChart"
|
[results]="playerChart"
|
||||||
[legend]="false"
|
[legend]="false"
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
[doughnut]="false"
|
[doughnut]="false"
|
||||||
[gradient]="false">
|
[gradient]="false">
|
||||||
</ngx-charts-pie-chart>
|
</ngx-charts-pie-chart>
|
||||||
</h3>
|
</div>
|
||||||
|
|
||||||
<div class="pull-left " style="padding-left: 150px; padding-top:15px">
|
<div class="pull-left " style="padding-left: 150px; padding-top:15px">
|
||||||
<a class="btn btn-default" style="margin: 20px" target="_blank" href="resource/logs/{{war._id}}/clean.log">Logfile
|
<a class="btn btn-default" style="margin: 20px" target="_blank" href="resource/logs/{{war._id}}/clean.log">Logfile
|
||||||
|
@ -52,9 +52,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--may be added in future: [sorts]="[{prop: 'sort', dir: 'desc'}]"-->
|
|
||||||
<ngx-datatable
|
<ngx-datatable
|
||||||
[rows]="rows"
|
[rows]="rows"
|
||||||
|
[sorts]="[{prop: 'kill', dir: 'desc'}]"
|
||||||
[reorderable]="reorderable"
|
[reorderable]="reorderable"
|
||||||
[messages]="{emptyMessage: 'Loading...'}"
|
[messages]="{emptyMessage: 'Loading...'}"
|
||||||
[headerHeight]="cellHeight"
|
[headerHeight]="cellHeight"
|
||||||
|
|
|
@ -26,7 +26,7 @@ div.user-list-entry, a.user-list-entry {
|
||||||
background: lightgrey;
|
background: lightgrey;
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span > a, span.glyphicon, span.icon-award{
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue