Release v1.9.2 (#54)

* Fix transport stats value drop on navigation (CC-88)
* Add player transport stats to campaign detail view (CC-83)
* Add additional budget information to db enry (CC-15)
* use sass for war header
* Improve fraction stats and scss usage
* Use stacked bar chart for flag capture visualization (CC-72)
* Update mongoose method usage o drop deprecated use
* Security restrictive npm dependency updates and mongoose settings adjustment
* Migrate load indicator to SASS (CC-87)
* Improve load indicator positioning (CC-87)
* Add OPT branded load indicator (CC-87)
pull/55/head
hardi 2019-02-17 19:46:24 +01:00 committed by Gogs
parent ec2beb56a0
commit b6deb56fc0
49 changed files with 1968 additions and 3174 deletions

200
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "opt-cc",
"version": "1.8.0",
"version": "1.9.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -10,10 +10,10 @@
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
"dev": true,
"requires": {
"co": "4.6.0",
"fast-deep-equal": "1.1.0",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.3.1"
"co": "^4.6.0",
"fast-deep-equal": "^1.0.0",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0"
}
},
"ansi-styles": {
@ -22,7 +22,7 @@
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "1.9.2"
"color-convert": "^1.9.0"
}
},
"asn1": {
@ -62,7 +62,7 @@
"dev": true,
"optional": true,
"requires": {
"tweetnacl": "0.14.5"
"tweetnacl": "^0.14.3"
}
},
"builtin-modules": {
@ -83,9 +83,9 @@
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "3.2.1",
"escape-string-regexp": "1.0.5",
"supports-color": "5.4.0"
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"supports-color": {
@ -94,7 +94,7 @@
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
"dev": true,
"requires": {
"has-flag": "3.0.0"
"has-flag": "^3.0.0"
}
}
}
@ -126,7 +126,7 @@
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
"dev": true,
"requires": {
"delayed-stream": "1.0.0"
"delayed-stream": "~1.0.0"
}
},
"commander": {
@ -141,15 +141,15 @@
"integrity": "sha512-6XiIYtYzmGEccNZFkih5JOH92jLA4ulZArAYy5j1uDSdrPLB3KzdE8GW7t2fHPcg9ry2+5LP9IEYzXzxw9lFdA==",
"dev": true,
"requires": {
"chalk": "2.4.1",
"chalk": "^2.4.1",
"commander": "2.6.0",
"date-fns": "1.29.0",
"lodash": "4.17.10",
"read-pkg": "3.0.0",
"date-fns": "^1.23.0",
"lodash": "^4.5.1",
"read-pkg": "^3.0.0",
"rx": "2.3.24",
"spawn-command": "0.0.2-1",
"supports-color": "3.2.3",
"tree-kill": "1.2.0"
"spawn-command": "^0.0.2-1",
"supports-color": "^3.2.3",
"tree-kill": "^1.1.0"
}
},
"core-js": {
@ -170,7 +170,7 @@
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"dev": true,
"requires": {
"assert-plus": "1.0.0"
"assert-plus": "^1.0.0"
}
},
"date-fns": {
@ -192,7 +192,7 @@
"dev": true,
"optional": true,
"requires": {
"jsbn": "0.1.1"
"jsbn": "~0.1.0"
}
},
"error-ex": {
@ -201,7 +201,7 @@
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"requires": {
"is-arrayish": "0.2.1"
"is-arrayish": "^0.2.1"
}
},
"escape-string-regexp": {
@ -246,9 +246,9 @@
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
"dev": true,
"requires": {
"asynckit": "0.4.0",
"asynckit": "^0.4.0",
"combined-stream": "1.0.6",
"mime-types": "2.1.18"
"mime-types": "^2.1.12"
}
},
"getpass": {
@ -257,7 +257,7 @@
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"dev": true,
"requires": {
"assert-plus": "1.0.0"
"assert-plus": "^1.0.0"
}
},
"graceful-fs": {
@ -278,8 +278,8 @@
"integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
"dev": true,
"requires": {
"ajv": "5.5.2",
"har-schema": "2.0.0"
"ajv": "^5.1.0",
"har-schema": "^2.0.0"
}
},
"has-flag": {
@ -306,9 +306,9 @@
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"dev": true,
"requires": {
"assert-plus": "1.0.0",
"jsprim": "1.4.1",
"sshpk": "1.14.2"
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"is-arrayish": {
@ -323,7 +323,7 @@
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
"dev": true,
"requires": {
"builtin-modules": "1.1.1"
"builtin-modules": "^1.0.0"
}
},
"is-typedarray": {
@ -356,11 +356,11 @@
"integrity": "sha1-M4WseQGSEwy+Iw6ALsAskhW7/to=",
"dev": true,
"requires": {
"hoek": "4.2.1",
"isemail": "2.2.1",
"items": "2.1.1",
"moment": "2.22.2",
"topo": "2.0.2"
"hoek": "4.x.x",
"isemail": "2.x.x",
"items": "2.x.x",
"moment": "2.x.x",
"topo": "2.x.x"
}
},
"jsbn": {
@ -412,16 +412,16 @@
"integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"parse-json": "4.0.0",
"pify": "3.0.0",
"strip-bom": "3.0.0"
"graceful-fs": "^4.1.2",
"parse-json": "^4.0.0",
"pify": "^3.0.0",
"strip-bom": "^3.0.0"
}
},
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
"dev": true
},
"mime-db": {
@ -436,7 +436,7 @@
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"dev": true,
"requires": {
"mime-db": "1.33.0"
"mime-db": "~1.33.0"
}
},
"minimist": {
@ -457,10 +457,10 @@
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
"dev": true,
"requires": {
"hosted-git-info": "2.6.1",
"is-builtin-module": "1.0.0",
"semver": "5.5.0",
"validate-npm-package-license": "3.0.3"
"hosted-git-info": "^2.1.4",
"is-builtin-module": "^1.0.0",
"semver": "2 || 3 || 4 || 5",
"validate-npm-package-license": "^3.0.1"
}
},
"oauth-sign": {
@ -475,8 +475,8 @@
"integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
"dev": true,
"requires": {
"error-ex": "1.3.2",
"json-parse-better-errors": "1.0.2"
"error-ex": "^1.3.1",
"json-parse-better-errors": "^1.0.1"
}
},
"path-type": {
@ -485,7 +485,7 @@
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true,
"requires": {
"pify": "3.0.0"
"pify": "^3.0.0"
}
},
"performance-now": {
@ -518,9 +518,9 @@
"integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true,
"requires": {
"load-json-file": "4.0.0",
"normalize-package-data": "2.4.0",
"path-type": "3.0.0"
"load-json-file": "^4.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^3.0.0"
}
},
"request": {
@ -529,26 +529,26 @@
"integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==",
"dev": true,
"requires": {
"aws-sign2": "0.7.0",
"aws4": "1.7.0",
"caseless": "0.12.0",
"combined-stream": "1.0.6",
"extend": "3.0.1",
"forever-agent": "0.6.1",
"form-data": "2.3.2",
"har-validator": "5.0.3",
"http-signature": "1.2.0",
"is-typedarray": "1.0.0",
"isstream": "0.1.2",
"json-stringify-safe": "5.0.1",
"mime-types": "2.1.18",
"oauth-sign": "0.8.2",
"performance-now": "2.1.0",
"qs": "6.5.2",
"safe-buffer": "5.1.2",
"tough-cookie": "2.3.4",
"tunnel-agent": "0.6.0",
"uuid": "3.3.2"
"aws-sign2": "~0.7.0",
"aws4": "^1.6.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.5",
"extend": "~3.0.1",
"forever-agent": "~0.6.1",
"form-data": "~2.3.1",
"har-validator": "~5.0.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.17",
"oauth-sign": "~0.8.2",
"performance-now": "^2.1.0",
"qs": "~6.5.1",
"safe-buffer": "^5.1.1",
"tough-cookie": "~2.3.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.1.0"
}
},
"rx": {
@ -587,8 +587,8 @@
"integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
"dev": true,
"requires": {
"spdx-expression-parse": "3.0.0",
"spdx-license-ids": "3.0.0"
"spdx-expression-parse": "^3.0.0",
"spdx-license-ids": "^3.0.0"
}
},
"spdx-exceptions": {
@ -603,8 +603,8 @@
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
"dev": true,
"requires": {
"spdx-exceptions": "2.1.0",
"spdx-license-ids": "3.0.0"
"spdx-exceptions": "^2.1.0",
"spdx-license-ids": "^3.0.0"
}
},
"spdx-license-ids": {
@ -619,15 +619,15 @@
"integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=",
"dev": true,
"requires": {
"asn1": "0.2.3",
"assert-plus": "1.0.0",
"bcrypt-pbkdf": "1.0.2",
"dashdash": "1.14.1",
"ecc-jsbn": "0.1.1",
"getpass": "0.1.7",
"jsbn": "0.1.1",
"safer-buffer": "2.1.2",
"tweetnacl": "0.14.5"
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"strip-bom": {
@ -642,7 +642,7 @@
"integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
"dev": true,
"requires": {
"has-flag": "1.0.0"
"has-flag": "^1.0.0"
},
"dependencies": {
"has-flag": {
@ -659,7 +659,7 @@
"integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=",
"dev": true,
"requires": {
"hoek": "4.2.1"
"hoek": "4.x.x"
}
},
"tough-cookie": {
@ -668,7 +668,7 @@
"integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
"dev": true,
"requires": {
"punycode": "1.4.1"
"punycode": "^1.4.1"
}
},
"tree-kill": {
@ -683,7 +683,7 @@
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true,
"requires": {
"safe-buffer": "5.1.2"
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
@ -705,8 +705,8 @@
"integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==",
"dev": true,
"requires": {
"spdx-correct": "3.0.0",
"spdx-expression-parse": "3.0.0"
"spdx-correct": "^3.0.0",
"spdx-expression-parse": "^3.0.0"
}
},
"verror": {
@ -715,9 +715,9 @@
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"dev": true,
"requires": {
"assert-plus": "1.0.0",
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "1.3.0"
"extsprintf": "^1.2.0"
}
},
"wait-on": {
@ -726,11 +726,11 @@
"integrity": "sha512-hDwJ674+7dfiiK/cxtYCwPxlnjXDjto/pCz1PF02sXUhqCqCWsgvxZln0699PReWqXXgkxqkF6DDo5Rj9sjNvw==",
"dev": true,
"requires": {
"core-js": "2.5.7",
"joi": "9.2.0",
"minimist": "1.2.0",
"request": "2.87.0",
"rx": "4.1.0"
"core-js": "^2.4.1",
"joi": "^9.2.0",
"minimist": "^1.2.0",
"request": "^2.78.0",
"rx": "^4.1.0"
},
"dependencies": {
"rx": {

View File

@ -1,6 +1,6 @@
{
"name": "opt-cc",
"version": "1.9.1",
"version": "1.9.2",
"author": "Florian Hartwich <hardi@noarch.de>",
"private": true,
"scripts": {

View File

@ -3,7 +3,6 @@
+ _id: `` (string, required) - log entry id
+ war: `` (string, required) - warId
+ time: `` (string, required) - logging timestamp
+ __v: 0 (number, required) - object version number
# LogPoints (Log)
## Properties
@ -74,14 +73,14 @@
#LogVehicle (Log)
## Properties
+ 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
+ fraction: `BLUFOR` (enum, required) - fraction of the shooter
+ Members
+ `BLUFOR`
+ `OPFOR`
+ `NONE`
+ vehicleClass: `LIGHT` (enum, required) - class of shot vehicle
+ vehicleClass: `LIGHT` (enum[string], required) - class of shot vehicle
+ Members
+ `LIGHT`
+ `HEAVY`

View File

@ -5,6 +5,11 @@ module.exports = {
database: {
uri: 'mongodb://localhost:27017/',
db: 'cc',
mongooseConfig: {
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false,
},
},
prod: {

View File

@ -3,37 +3,49 @@
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const LogBudgetSchema = new Schema({
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
required: true,
const LogBudgetSchema = new Schema(
{
war: {
type: mongoose.Schema.Types.ObjectId,
ref: 'War',
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: {
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,
},
}, {
collection: 'logBudget',
versionKey: false,
});
{
collection: 'logBudget',
versionKey: false,
});
// optional more indices
LogBudgetSchema.index({war: 1});

158
server/package-lock.json generated
View File

@ -1111,9 +1111,9 @@
"dev": true
},
"bluebird": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
"integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
},
"bmp-js": {
"version": "0.1.0",
@ -1267,9 +1267,9 @@
"dev": true
},
"bson": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz",
"integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg=="
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz",
"integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA=="
},
"buffer": {
"version": "3.6.0",
@ -6312,9 +6312,9 @@
}
},
"kareem": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.2.1.tgz",
"integrity": "sha512-xpDFy8OxkFM+vK6pXy6JmH92ibeEFUuDWzas5M9L7MzVmHW3jzwAHxodCPV/BYkf4A31bVDLyonrMfp9RXb/oA=="
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.0.tgz",
"integrity": "sha512-6hHxsp9e6zQU8nXsP+02HGWXwTkOEw6IROhF2ZA28cYbUk4eJ6QbtZvdqZOdD9YPKghG3apk5eOCvs+tLl3lRg=="
},
"keypress": {
"version": "0.1.0",
@ -6605,9 +6605,9 @@
}
},
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
"version": "4.17.11",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
},
"lodash._basecopy": {
"version": "3.0.1",
@ -6671,7 +6671,8 @@
"lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
"dev": true
},
"lodash.isarguments": {
"version": "3.1.0",
@ -6912,6 +6913,12 @@
"timers-ext": "^0.1.5"
}
},
"memory-pager": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
"optional": true
},
"meow": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
@ -7140,21 +7147,37 @@
}
},
"mongodb": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.0.tgz",
"integrity": "sha512-fSDZRq9FomRqeDSM7MpMTLa8sz+STs3nZ7Ib0+xvmaKZ6nquNDN4zGDsVhjto6UozFvHMDYJMAfJwhqUygXs9g==",
"version": "3.1.13",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.13.tgz",
"integrity": "sha512-sz2dhvBZQWf3LRNDhbd30KHVzdjZx9IKC0L+kSZ/gzYquCF5zPOgGqRz6sSCqYZtKP2ekB4nfLxhGtzGHnIKxA==",
"requires": {
"mongodb-core": "3.1.0"
"mongodb-core": "3.1.11",
"safe-buffer": "^5.1.2"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
"mongodb-core": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.0.tgz",
"integrity": "sha512-qRjG62Fu//CZhkgn0jA/k8jh5MhACIq8cOJUryH6sck87pgt+C222MSD02tsCq5zNo/B6ZFHtNodZ2qpf8E86g==",
"version": "3.1.11",
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.11.tgz",
"integrity": "sha512-rD2US2s5qk/ckbiiGFHeu+yKYDXdJ1G87F6CG3YdaZpzdOm5zpoAZd/EKbPmFO6cQZ+XVXBXBJ660sSI0gc6qg==",
"requires": {
"bson": "~1.0.4",
"bson": "^1.1.0",
"require_optional": "^1.0.1",
"safe-buffer": "^5.1.2",
"saslprep": "^1.0.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
"mongodb-memory-server": {
@ -7177,28 +7200,33 @@
}
},
"mongoose": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.2.0.tgz",
"integrity": "sha512-PCChMFJHO8C+M2JYqLhOzpiDD54VoW7XbS0V9V/R6PRJOZ4GNmT4KQzyFDaXZTNRpeQpSPlz5x5Szk/kpdYY9g==",
"version": "5.4.13",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.4.13.tgz",
"integrity": "sha512-4dgmFbtNECbW3ZMS6ha2pebinUzZo789scdccdyyajbmaunBPqZJqp6eO6pThIqDsgSOkRi4IrzkZm8kmhtZMA==",
"requires": {
"async": "2.6.1",
"bson": "~1.0.5",
"kareem": "2.2.1",
"lodash.get": "4.4.2",
"mongodb": "3.1.0",
"mongodb-core": "3.1.0",
"bson": "~1.1.0",
"kareem": "2.3.0",
"mongodb": "3.1.13",
"mongodb-core": "3.1.11",
"mongoose-legacy-pluralize": "1.0.2",
"mpath": "0.4.1",
"mquery": "3.0.0",
"ms": "2.0.0",
"mpath": "0.5.1",
"mquery": "3.2.0",
"ms": "2.1.1",
"regexp-clone": "0.0.1",
"safe-buffer": "5.1.2",
"sliced": "1.0.1"
},
"dependencies": {
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
@ -7235,38 +7263,26 @@
}
},
"mpath": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.4.1.tgz",
"integrity": "sha512-NNY/MpBkALb9jJmjpBlIi6GRoLveLUM0pJzgbp9vY9F7IQEb/HREC/nxrixechcQwd1NevOhJnWWV8QQQRE+OA=="
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.5.1.tgz",
"integrity": "sha512-H8OVQ+QEz82sch4wbODFOz+3YQ61FYz/z3eJ5pIdbMEaUzDqA268Wd+Vt4Paw9TJfvDgVKaayC0gBzMIw2jhsg=="
},
"mquery": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mquery/-/mquery-3.0.0.tgz",
"integrity": "sha512-WL1Lk8v4l8VFSSwN3yCzY9TXw+fKVYKn6f+w86TRzOLSE8k1yTgGaLBPUByJQi8VcLbOdnUneFV/y3Kv874pnQ==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.0.tgz",
"integrity": "sha512-qPJcdK/yqcbQiKoemAt62Y0BAc0fTEKo1IThodBD+O5meQRJT/2HSe5QpBNwaa4CjskoGrYWsEyjkqgiE0qjhg==",
"requires": {
"bluebird": "3.5.0",
"debug": "2.6.9",
"bluebird": "3.5.1",
"debug": "3.1.0",
"regexp-clone": "0.0.1",
"sliced": "0.0.5"
"safe-buffer": "5.1.2",
"sliced": "1.0.1"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"sliced": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz",
"integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8="
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
}
},
@ -9018,10 +9034,13 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"saslprep": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.0.tgz",
"integrity": "sha512-5lvKUEQ7lAN5/vPl5d3k8FQeDbEamu9kizfATfLLWV5h6Mkh1xcieR1FSsJkcSRUk49lF2tAW8gzXWVwtwZVhw==",
"optional": true
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.2.tgz",
"integrity": "sha512-4cDsYuAjXssUSjxHKRe4DTZC0agDwsCqcMqtJAQPzC74nJ7LfAJflAtC1Zed5hMzEQKj82d3tuzqdGNRsLJ4Gw==",
"optional": true,
"requires": {
"sparse-bitfield": "^3.0.3"
}
},
"sax": {
"version": "1.2.4",
@ -9520,6 +9539,15 @@
"resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",
"integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw=="
},
"sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
"integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
"optional": true,
"requires": {
"memory-pager": "^1.0.2"
}
},
"spawn-args": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/spawn-args/-/spawn-args-0.2.0.tgz",

View File

@ -31,9 +31,9 @@
"imagemin-pngquant": "^5.0.0",
"jimp": "^0.6.0",
"jsonwebtoken": "^7.4.3",
"lodash": "^4.17.4",
"lodash": "^4.17.11",
"mkdirp": "^0.5.1",
"mongoose": "^5.0.3",
"mongoose": "^5.4.13",
"morgan": "^1.9.1",
"multer": "^1.3.0",
"node-html-parser": "^1.1.10",

View File

@ -104,16 +104,16 @@ campaigns.route('/:id')
WarModel.find({campaign: req.params.id}, (err, wars) => {
wars.forEach((item) => {
// delete linked appearances
PlayerModel.find({warId: item._id}).remove().exec();
LogKillModel.find({war: item._id}).remove().exec();
LogVehicleKillModel.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();
LogPlayerCountModel.find({war: item._id}).remove().exec();
PlayerModel.find({warId: item._id}).deleteMany();
LogKillModel.find({war: item._id}).deleteMany();
LogVehicleKillModel.find({war: item._id}).deleteMany();
LogRespawnModel.find({war: item._id}).deleteMany();
LogReviveModel.find({war: item._id}).deleteMany();
LogFlagModel.find({war: item._id}).deleteMany();
LogBudgetModel.find({war: item._id}).deleteMany();
LogTransportModel.find({war: item._id}).deleteMany();
LogPointsModel.find({war: item._id}).deleteMany();
LogPlayerCountModel.find({war: item._id}).deleteMany();
// check if logfiles exist and delete from fs
const warDir = resourceLocation + item.id;

View File

@ -170,7 +170,7 @@ decorationRouter.route('/:id')
}
// deleted all awardings linked to this decoration
AwardingsModel.find({decorationId: id}).remove().exec();
AwardingsModel.find({decorationId: id}).deleteMany();
// delete graphic
fs.unlink(resourceLocation.concat(id).concat('.png'),

View File

@ -43,7 +43,7 @@ logsRouter.route('/:warId')
const sort = {sort: {time: 1}};
const pointsObjects = LogPointsModel.find(filter, {}, sort);
const budgetObjects = LogBudgetModel.find(filter, {}, sort);
const budgetObjects = LogBudgetModel.find(filter, {player: 0, item: 0, buy: 0}, sort);
const respawnObjects = LogRespawnModel.find(filter, {}, sort);
const reviveObjects = LogReviveModel.find(filter, {}, sort);
const killObjects = LogKillModel.find(filter, {}, sort);

View File

@ -191,7 +191,7 @@ users.route('/:id')
}
// deleted all awardings linked to this user
AwardingModel.find({userId: req.params.id}).remove().exec();
AwardingModel.find({userId: req.params.id}).deleteOne();
// check if signature exists and delete compressed and uncompressed file
const fileMinified = resourceLocation + req.params.id + '.png';

View File

@ -115,78 +115,81 @@ errorResponseWare(app);
if (process.env.NODE_ENV === config.test.unit.env || process.env.NODE_ENV === config.test.dredd.env) {
const MongodbMemoryServer = require('mongodb-memory-server').default;
const mongoServer = new MongodbMemoryServer();
mongoose.Promise = Promise;
mongoServer.getConnectionString().then((mongoUri) => {
mongoose.connect(mongoUri, {useNewUrlParser: true});
mongoServer.getConnectionString()
.then((mongoUri) => {
mongoose.connect(mongoUri, config.database.mongooseConfig);
mongoose.connection.on('error', (e) => {
if (e.message.code === 'ETIMEDOUT') {
error(e);
mongoose.connect(mongoUri);
}
error(e);
});
mongoose.connection.on('error', (e) => {
if (e.message.code === 'ETIMEDOUT') {
error(e);
mongoose.connect(mongoUri);
}
error(e);
});
if (process.env.NODE_ENV === config.test.dredd.env) {
const mongoPortAndDB = mongoUri.replace('mongodb://localhost:', '').split('/');
exec(
__dirname + '/apib/dredd/populate-data.sh'
.concat(' -p ').concat(mongoPortAndDB[0])
.concat(' -d ').concat(mongoPortAndDB[1]), (err, stdout, stderr) => {
if (err) {
error(err.message);
} else {
logger('\x1b[32m%s\x1b[0m', stderr);
}
});
}
if (process.env.NODE_ENV === config.test.dredd.env) {
const mongoPortAndDB = mongoUri.replace('mongodb://localhost:', '').split('/');
exec(
__dirname + '/apib/dredd/populate-data.sh'
.concat(' -p ').concat(mongoPortAndDB[0])
.concat(' -d ').concat(mongoPortAndDB[1]), (err, stdout, stderr) => {
if (err) {
error(err.message);
} else {
logger('\x1b[32m%s\x1b[0m', stderr);
}
});
}
mongoose.connection.once('open', () => {
logger(`MongoDB successfully connected to ${mongoUri}`);
app.listen(config.test.port);
logger('Listening on port ' + config.test.port);
});
});
mongoose.connection.once('open', () => {
logger(`MongoDB successfully connected to ${mongoUri}`);
app.listen(config.test.port);
logger('Listening on port ' + config.test.port);
});
});
} else {
mongoose.connect(config.database.uri + config.database.db, {useNewUrlParser: true}).then((db) => {
let cronWorkerPID;
if (cluster.isMaster) {
// Fork workers
for (let i = 0; i < numWorkers; i++) {
if (i === 0) {
const spawnedWorker = cluster.fork({START_CRON: true});
cronWorkerPID = spawnedWorker.process.pid;
} else {
cluster.fork();
}
}
logger(`Master ${process.pid} is running. Forking ${numWorkers} workers`);
mongoose.connect(config.database.uri + config.database.db, config.database.mongooseConfig)
.then((db) => {
let cronWorkerPID;
if (cluster.isMaster) {
// Fork workers
for (let i = 0; i < numWorkers; i++) {
if (i === 0) {
const spawnedWorker = cluster.fork({START_CRON: true});
cronWorkerPID = spawnedWorker.process.pid;
} else {
cluster.fork();
}
}
logger(`Master ${process.pid} is running. Forking ${numWorkers} workers`);
// Check if worker id is died
cluster.on('exit', (worker, code, signal) => {
logger(`worker ${worker.process.pid} died`);
if (worker.process.pid === cronWorkerPID) {
const spawnedWorker = cluster.fork({START_CRON: true});
cronWorkerPID = spawnedWorker.process.pid;
} else {
cluster.fork();
}
});
} else {
app.listen(config.port, (err) => {
if (err) {
error(`Error on startup ${err}`);
} else {
logger(`Worker ${process.pid} started. Listening on port ${config.port}`);
if (process.env.START_CRON) {
logger(`Attaching cronJobs to cluster worker ${process.pid}`);
signatureCronJob.start();
backupCronJob.start();
}
}
});
}
});
// Check if worker id is died
cluster.on('exit', (worker, code, signal) => {
logger(`worker ${worker.process.pid} died`);
if (worker.process.pid === cronWorkerPID) {
const spawnedWorker = cluster.fork({START_CRON: true});
cronWorkerPID = spawnedWorker.process.pid;
} else {
cluster.fork();
}
});
} else {
app.listen(config.port, (err) => {
if (err) {
error(`Error on startup ${err}`);
} else {
logger(`Worker ${process.pid} started. Listening on port ${config.port}`);
if (process.env.START_CRON) {
logger(`Attaching cronJobs to cluster worker ${process.pid}`);
signatureCronJob.start();
backupCronJob.start();
}
}
});
}
});
}
module.exports = app;

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block
describe('Awardings', () => {
beforeEach((done) => { // Before each test we empty the database
AwardingModel.remove({}, (err) => {
AwardingModel.deleteMany({}, (err) => {
done();
});
});

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block
describe('Command', () => {
beforeEach((done) => { // Before each test we empty the database
AwardingModel.remove({}, (err) => {
AwardingModel.deleteMany({}, (err) => {
done();
});
});

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block
describe('Decorations', () => {
beforeEach((done) => { // Before each test we empty the database
DecorationModel.remove({}, (err) => {
DecorationModel.deleteMany({}, (err) => {
done();
});
});

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block
describe('Ranks', () => {
beforeEach((done) => { // Before each test we empty the database
RankModel.remove({}, (err) => {
RankModel.deleteMany({}, (err) => {
done();
});
});

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block
describe('Squads', () => {
beforeEach((done) => { // Before each test we empty the database
SquadModel.remove({}, (err) => {
SquadModel.deleteMany({}, (err) => {
done();
});
});

View File

@ -15,7 +15,7 @@ chai.use(chaiHttp);
// Our parent block
describe('Users', () => {
beforeEach((done) => { // Before each test we empty the database
UserModel.remove({}, (err) => {
UserModel.deleteMany({}, (err) => {
done();
});
});

View File

@ -13,6 +13,12 @@ const VehicleClasses = Object.freeze({
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 sideRegex = /(side:\s(.*?)\))/;
@ -178,7 +184,7 @@ const parseWarLog = (lineArray, war) => {
const playerName = line.substring(line.lastIndexOf('Respawn von ') + 12, line.lastIndexOf('"'));
stats.respawn.push(getRespawnEntry(budg, playerName, war._id, war.date));
}
stats.budget.push(getBudgetEntry(budg, war._id, war.date));
stats.budget.push(getBudgetEntry(line, budg, war._id, war.date));
}
} else if (line.includes('(Fahne)') && !line.includes('Dominator')) {
/**
@ -405,14 +411,37 @@ const getPointsEntry = (pt, line, warId, warDate) => {
};
};
const getBudgetEntry = (budg, warId, warDate) => {
return {
const getBudgetEntry = (line, budg, warId, warDate) => {
const timestamp = getFullTimeDate(warDate, budg[5]);
const oldBudget = transformMoneyString(budg[9]);
const newBudget = transformMoneyString(budg[12]);
const fraction = budg[7] === 'NATO' ? 'BLUFOR' : 'OPFOR';
const budgetEntry = {
war: warId,
time: getFullTimeDate(warDate, budg[5]),
fraction: budg[7] === 'NATO' ? 'BLUFOR' : 'OPFOR',
oldBudget: transformMoneyString(budg[9]),
newBudget: transformMoneyString(budg[12]),
time: timestamp,
fraction: fraction,
oldBudget: oldBudget,
newBudget: newBudget,
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) => {

3876
static/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -39,13 +39,13 @@
"jquery-ui-bundle": "^1.11.4",
"ngx-clipboard": "^11.1.1",
"ngx-cookie-service": "^1.0.10",
"ngx-infinite-scroll": "^0.5.2",
"ngx-infinite-scroll": "^7.0.1",
"rxjs-compat": "^6.2.1",
"ts-helpers": "^1.1.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.8.3",
"@angular-devkit/build-angular": "^0.13.1",
"@types/jasmine": "2.5.38",
"@types/node": "^6.0.89",
"codelyzer": "^4.4.2",

View File

@ -137,7 +137,11 @@
</div>
</div>
<span *ngIf="loading" class="load-indicator load-arrow glyphicon-refresh-animate"></span>
<div *ngIf="loading" class="load-indicator">
<div class="opt-loader"></div>
<mat-icon svgIcon="opt-logo-core" class="opt-logo-core"></mat-icon>
</div>
<button mat-icon-button
mat-mini-fab

View File

@ -1,3 +1,5 @@
@import "style/load-indicator.scss";
ul {
list-style-type: none;
margin: 0;
@ -43,7 +45,7 @@ li {
}
#scrollTopBtn:hover {
background: rgba(16, 16, 16);
background: #101010;
}
.unprocessed {

View File

@ -18,7 +18,7 @@ declare function require(url: string);
@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css', 'style/load-indicator.css']
styleUrls: ['app.component.scss']
})
export class AppComponent implements OnInit {
@ -36,7 +36,7 @@ export class AppComponent implements OnInit {
// to load from assets/icon folder
svgIcons = {
'opt-logo': 'general/opt-logo',
'loading-arrows': 'general/loading-arrows',
'opt-logo-core': 'general/opt-logo-core',
'add': 'outline-add_box-24px',
'add-user': 'twotone-person_add-24px',
'award': 'award',

View File

@ -37,7 +37,8 @@
[xAxis]="xAxis"
[yAxis]="yAxis"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel">
[showYAxisLabel]="showYAxisLabel"
[animations]="animations">
</ngx-charts-bar-horizontal>
</div>
</div>
@ -59,6 +60,7 @@
[yAxisLabel]="category.label"
[autoScale]="autoscale"
[timeline]="timeline"
[animations]="animations"
[roundDomains]="roundDomains">
</ngx-charts-line-chart>
</div>

View File

@ -9,7 +9,7 @@ import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'campaign-player-detail',
templateUrl: './campaign-player-detail.component.html',
styleUrls: ['./campaign-player-detail.component.css', '../../../style/list-entry.css',
styleUrls: ['./campaign-player-detail.component.scss', '../../../style/list-entry.css',
'../../../style/hide-scrollbar.css', '../../../style/overview.css']
})
export class CampaignPlayerDetailComponent implements OnInit {
@ -46,6 +46,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
autoscale = false;
timeline = false;
roundDomains = true;
animations = false;
kdRatio = 0;
maxKd = 1.7;
@ -53,7 +54,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
respawnDeathRatio = 0;
maxRespawnDeathRatio = 1;
playerAttributeNameMap = PlayerUtils.tmpAttributeDisplayNames.slice(2, PlayerUtils.tmpAttributeDisplayNames.length);
playerAttributeNameMap = PlayerUtils.attributeDisplayNames.slice(2, PlayerUtils.attributeDisplayNames.length);
constructor(private playerService: PlayerService,
private translate: TranslateService) {
@ -81,18 +82,18 @@ export class CampaignPlayerDetailComponent implements OnInit {
this.initDataArray();
const totalDeathDiv = this.graphData[7].total === 0 ? 1 : this.graphData[7].total;
const totalDeathDiv = this.graphData[9].total === 0 ? 1 : this.graphData[9].total;
this.kdRatio = parseFloat((this.graphData[0].total / totalDeathDiv).toFixed(2));
if (this.kdRatio > 1) {
this.maxKd = this.kdRatio * 1.7;
}
this.respawnDeathRatio = parseFloat((this.graphData[8].total / totalDeathDiv).toFixed(2));
this.respawnDeathRatio = parseFloat((this.graphData[10].total / totalDeathDiv).toFixed(2));
// we can not directly push to target array, since only full reference changes trigger the refresh of data
const tmpSumData = [];
this.graphData.forEach(dataSet => {
tmpSumData.push({name: dataSet.label, value: dataSet.total});
tmpSumData.push({name: dataSet.label, value: dataSet.total ? dataSet.total : 0});
});
this.sumData = tmpSumData;
});
@ -100,7 +101,7 @@ export class CampaignPlayerDetailComponent implements OnInit {
private initDataArray() {
this.graphData.forEach(dataSet => {
const killObj = {
const dataObj = {
name: dataSet.label,
series: []
};
@ -108,15 +109,21 @@ export class CampaignPlayerDetailComponent implements OnInit {
let total = 0;
for (let i = 0; i < playerLength; i++) {
const warDateString = ChartUtils.getShortDateString(this.campaignPlayer.players[i].warId.date);
const value = this.campaignPlayer.players[i][dataSet.key];
killObj.series.push({
const valueField = this.campaignPlayer.players[i][dataSet.key];
let value = valueField ? valueField : 0;
if (dataSet.key === 'travelDistance' || dataSet.key === 'driverDistance') {
value = Math.round(value / 1000); // meters to km
}
dataObj.series.push({
name: warDateString,
value: value
});
total += value;
}
dataSet.data = [killObj];
dataSet.data = [dataObj];
dataSet.refLine = [{value: total / playerLength, name: this.translations['stats.player.detail.graph.average']}];
dataSet.total = total;
});

View File

@ -20,7 +20,7 @@
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="lineChartLabel"
[yAxisLabel]="chartYAxisLabel"
[autoScale]="autoscale"
[timeline]="timeline"
[roundDomains]="roundDomains">
@ -28,20 +28,25 @@
</div>
<div *ngIf="!showLineChart" class="chart-container">
<ngx-charts-area-chart
<ngx-charts-bar-vertical-stacked
[scheme]="colorScheme"
[results]="areaChartData"
[results]="barChartData"
[xAxis]="xAxis"
[yAxis]="yAxis"
[curve]="stepCurve"
[legend]="legend"
[legendTitle]="legendTitle"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[yAxisLabel]="labelFlag"
[autoScale]="autoscale"
[timeline]="timeline"
[roundDomains]="false">
</ngx-charts-area-chart>
[animations]="barAnimations"
[barPadding]="barPadding"
[xAxisTickFormatting]="axisFormatX"
[yAxisTickFormatting]="axisFormatY">
<ng-template #tooltipTemplate let-model="model">
<small>{{'stats.fraction.tooltip.flag.minute' | translate}} {{model.series}}</small>
<div>{{model.name}} {{'stats.fraction.tooltip.flag.flag' | translate}}</div>
<div *ngIf="model.value === 0">{{'stats.fraction.tooltip.flag.lost' | translate}}</div>
<div *ngIf="model.value !== 0">{{'stats.fraction.tooltip.flag.safe' | translate}}</div>
</ng-template>
</ngx-charts-bar-vertical-stacked>
</div>
</div>

View File

@ -0,0 +1,37 @@
.chart-select-group {
display: flex;
width: fit-content;
margin: auto;
}
:host /deep/ mat-button-toggle {
color: #666666;
background: #e7e7e7;
:hover {
background: #afafaf;
}
&.mat-button-toggle-checked {
background: #ffffff;
}
label.mat-button-toggle-label {
margin: 2px 0;
}
div.mat-button-toggle-label-content {
line-height: 25px;
margin-bottom: 0;
font-weight: normal;
}
}
.chart-container {
width: 95%;
margin: 2%;
min-width: 900px;
height: 50vh;
padding: 15px;
float: left;
}

View File

@ -1,5 +1,4 @@
import {Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
import * as d3 from 'd3';
import {ChartUtils} from '../../../utils/chart-utils';
import {Fraction} from '../../../utils/fraction.enum';
import {War} from '../../../models/model-interfaces';
@ -9,7 +8,7 @@ import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'war-detail-fraction',
templateUrl: './fraction-stats.component.html',
styleUrls: ['./fraction-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
styleUrls: ['./fraction-stats.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
})
export class FractionStatsComponent implements OnInit, OnChanges {
@ -28,7 +27,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
public activeChartSelect: string;
lineChartData: any[] = [];
areaChartData: any[] = [];
barChartData: any[] = [];
tmpPointData;
tmpBudgetData;
@ -38,7 +37,6 @@ export class FractionStatsComponent implements OnInit, OnChanges {
tmpTransportData;
tmpReviveData;
tmpStabilizeData;
tmpFlagCaptureData;
tmpPlayerCountData;
colorScheme = {
@ -49,10 +47,10 @@ export class FractionStatsComponent implements OnInit, OnChanges {
labels;
labelsKeys;
lineChartLabel: string;
chartYAxisLabel: string;
// line chart
showLineChart = true;
stepCurve = d3.curveStepAfter;
gradient = false;
yAxis = true;
xAxis = true;
@ -64,11 +62,15 @@ export class FractionStatsComponent implements OnInit, OnChanges {
timeline = false;
roundDomains = true;
// bar chart
barPadding = 0;
barAnimations = false;
constructor(private translate: TranslateService) {
}
ngOnInit() {
this.setLineChartLabel(this.labels.points);
this.setChartYAxisLabel(this.labels.points);
}
ngOnChanges(changes: SimpleChanges) {
@ -84,7 +86,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.initializeToggleButtons();
Object.assign(this, [this.lineChartData, this.areaChartData]);
Object.assign(this, [this.lineChartData, this.barChartData]);
this.activeChartSelect = this.labels.points;
this.startDateObj = new Date(this.war.date);
@ -134,7 +136,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.activeChartSelect = newSelection;
if (this.activeChartSelect !== this.labels.flag) {
this.showLineChart = true;
this.setLineChartLabel(this.activeChartSelect);
this.setChartYAxisLabel(this.activeChartSelect);
switch (this.activeChartSelect) {
case this.labels.points:
this.lineChartData = this.tmpPointData;
@ -175,7 +177,6 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else {
this.initFlagHoldData();
this.showLineChart = false;
this.areaChartData = this.tmpFlagCaptureData;
}
}
@ -205,7 +206,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
const fractionChange = budgetEntry.fraction === 'BLUFOR' ? 0 : 1;
const fractionOld = budgetEntry.fraction !== 'BLUFOR' ? 0 : 1;
if (this.isTwoMinutesAhead(budgetEntryDate, this.tmpBudgetData)) {
if (ChartUtils.isOneMinuteAhead(budgetEntryDate, this.tmpBudgetData)) {
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[this.tmpBudgetData[fractionOld].series.length - 1].value));
@ -230,7 +231,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
if (killEntry.fraction === 'OPFOR') {
killCountOpfor++;
}
if (this.isTwoMinutesAhead(killEntryDate, this.tmpKillData)) {
if (ChartUtils.isOneMinuteAhead(killEntryDate, this.tmpKillData)) {
this.tmpKillData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountBlufor));
this.tmpKillData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, killCountOpfor));
}
@ -241,7 +242,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
if (killEntry.fraction === 'OPFOR') {
ffKillCountOpfor++;
}
if (this.isTwoMinutesAhead(killEntryDate, this.tmpFrienlyFireData)) {
if (ChartUtils.isOneMinuteAhead(killEntryDate, this.tmpFrienlyFireData)) {
this.tmpFrienlyFireData[0].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountBlufor));
this.tmpFrienlyFireData[1].series.push(ChartUtils.getSeriesEntry(killEntryDate, ffKillCountOpfor));
}
@ -272,7 +273,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else {
reviveCountOpfor++;
}
if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpReviveData)) {
if (ChartUtils.isOneMinuteAhead(reviveEntryDate, this.tmpReviveData)) {
this.tmpReviveData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountBlufor));
this.tmpReviveData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, reviveCountOpfor));
}
@ -282,7 +283,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else {
stabilizeCountOpfor++;
}
if (this.isTwoMinutesAhead(reviveEntryDate, this.tmpStabilizeData)) {
if (ChartUtils.isOneMinuteAhead(reviveEntryDate, this.tmpStabilizeData)) {
this.tmpStabilizeData[0].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountBlufor));
this.tmpStabilizeData[1].series.push(ChartUtils.getSeriesEntry(reviveEntryDate, stabilizeCountOpfor));
}
@ -341,7 +342,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
}
}
}
if (this.isTwoMinutesAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
if (ChartUtils.isOneMinuteAhead(vehicleEntryDate, this.tmpVehicleData) || index === this.logData.vehicle.length - 1) {
this.tmpVehicleData[0].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountBlufor));
this.tmpVehicleData[1].series.push(ChartUtils.getSeriesEntry(vehicleEntryDate, vehicleKillCountOpfor));
if (vehicleEntry.vehicleClass) {
@ -373,7 +374,8 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else {
transportCountOpfor++;
}
if (this.isTwoMinutesAhead(transportEntryDate, this.tmpTransportData) || index === this.logData.transport.length - 1) {
if (ChartUtils.isOneMinuteAhead(transportEntryDate, this.tmpTransportData) ||
index === this.logData.transport.length - 1) {
this.tmpTransportData[0].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountBlufor));
this.tmpTransportData[1].series.push(ChartUtils.getSeriesEntry(transportEntryDate, transportCountOpfor));
}
@ -402,28 +404,52 @@ export class FractionStatsComponent implements OnInit, OnChanges {
}
let flagStatusBlufor = true;
let flagStatusOpfor = true;
this.tmpFlagCaptureData[0].series.push(ChartUtils.getSeriesEntry(this.startDateObj, flagStatusBlufor));
this.tmpFlagCaptureData[1].series.push(ChartUtils.getSeriesEntry(this.startDateObj, flagStatusOpfor));
const flagStatusMap = {
blufor: {0: flagStatusBlufor},
opfor: {0: flagStatusOpfor},
};
this.logData.flag.forEach(flagEntry => {
this.logData.flag.forEach((flagEntry) => {
if (flagEntry.flagFraction === 'BLUFOR') {
flagStatusBlufor = !flagEntry.capture;
} else {
flagStatusOpfor = !flagEntry.capture;
}
this.tmpFlagCaptureData[flagEntry.flagFraction === 'BLUFOR' ? 0 : 1].series.push(
ChartUtils.getSeriesEntry(new Date(flagEntry.time), flagEntry.flagFraction === 'BLUFOR' ? flagStatusBlufor : flagStatusOpfor)
);
const entryMinute = Math.round((new Date(flagEntry.time).getTime() - new Date(this.war.date).getTime()) / 60000);
flagStatusMap.blufor[entryMinute] = flagStatusBlufor;
flagStatusMap.opfor[entryMinute] = flagStatusOpfor;
});
this.addFinalTimeData(this.tmpFlagCaptureData);
const data = [];
let lastExistingIdx = 0;
const finishMinute = Math.round((new Date(this.war.endDate).getTime() - new Date(this.war.date).getTime()) / 60000);
for (let t = 0; t <= finishMinute; t++) {
if (flagStatusMap.blufor.hasOwnProperty(t) && flagStatusMap.opfor.hasOwnProperty(t)) {
lastExistingIdx = t;
}
data.push({
name: t,
series: [
{
name: Fraction.BLUFOR,
value: flagStatusMap.blufor[lastExistingIdx] ? 1 : 0
}
]
});
data.push({
name: t,
series: [
{
name: Fraction.OPFOR,
value: flagStatusMap.opfor[lastExistingIdx] ? -1 : 0
}
]
});
}
this.barChartData = data;
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() {
this.tmpPointData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpBudgetData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
@ -435,7 +461,6 @@ export class FractionStatsComponent implements OnInit, OnChanges {
this.tmpTransportData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpReviveData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpStabilizeData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpFlagCaptureData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
this.tmpPlayerCountData = ChartUtils.getMultiDataArray(Fraction.BLUFOR, Fraction.OPFOR);
[this.tmpKillData, this.tmpFrienlyFireData, this.tmpVehicleData, this.tmpReviveData, this.tmpStabilizeData,
@ -466,9 +491,21 @@ export class FractionStatsComponent implements OnInit, OnChanges {
}
}
setLineChartLabel(i18n: string) {
setChartYAxisLabel(i18n: string) {
this.translate.get(i18n).subscribe((translated) => {
this.lineChartLabel = translated;
this.chartYAxisLabel = translated;
});
}
axisFormatX(val) {
if (val % 10 === 0) {
return val;
} else {
return '';
}
}
axisFormatY(val) {
return '';
}
}

View File

@ -4,7 +4,7 @@
height: 68vh;
overflow-x: hidden;
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;
}

View File

@ -1,22 +1,25 @@
<div class="fade-in scoreboard-table">
<mat-table matSort
[dataSource]="sortedRows"
matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
(matSortChange)="sortScoreboardData($event)"
class="mat-elevation-z8">
[dataSource]="sortedRows"
matSortActive="{{tableHead[2].prop}}" matSortDirection="asc" matSortDisableClear
(matSortChange)="sortScoreboardData($event)"
class="mat-elevation-z8">
<ng-container matColumnDef="{{tableHead[0].prop}}">
<mat-header-cell *matHeaderCellDef mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
<mat-header-cell *matHeaderCellDef
mat-sort-header="{{tableHead[0].prop}}">{{tableHead[0].head | translate}}</mat-header-cell>
<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}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="{{tableHead[1].prop}}">
<mat-header-cell *matHeaderCellDef 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-header-cell *matHeaderCellDef
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>
</ng-container>
<ng-container *ngFor="let column of tableHead.slice(2, tableHead.length)" matColumnDef="{{column.prop}}">

View File

@ -26,10 +26,6 @@ export class ScoreboardComponent implements OnChanges {
isSteamUUID = PlayerUtils.isSteamUUID;
cellHeight = 40;
columnWidth = 65;
rows = [];
sortedRows = [];
@ -52,11 +48,16 @@ export class ScoreboardComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges) {
if (changes.war) {
this.war.players.forEach(player => {
// meters to kilometer or fill with null, since optional
player.travelDistance = player.travelDistance ? Math.round(player.travelDistance / 1000) : 0;
player.driverDistance = player.driverDistance ? Math.round(player.driverDistance / 1000) : 0;
});
changes.war.currentValue.players
.filter(player => !player.initalized)
.forEach(player => {
// meters to kilometer or fill with null, since optional
player.travelDistance = player.travelDistance ? Math.round(player.travelDistance / 1000) : 0;
player.driverDistance = player.driverDistance ? Math.round(player.driverDistance / 1000) : 0;
// mark initialized to avoid processing again on navigation
player.initalized = true;
});
this.rows = changes.war.currentValue.players;
this.currentSort.active = 'kill';

View File

@ -1,37 +0,0 @@
.chart-select-group {
display: flex;
width: fit-content;
margin: auto;
}
:host /deep/ mat-button-toggle {
color: #666666;
background: #e7e7e7;
}
:host /deep/ mat-button-toggle:hover {
background: #afafaf;
}
:host /deep/ mat-button-toggle.mat-button-toggle-checked {
background: #ffffff;
}
:host /deep/ label.mat-button-toggle-label {
margin: 2px 0;
}
:host /deep/ div.mat-button-toggle-label-content {
line-height: 25px;
margin-bottom: 0;
font-weight: normal;
}
.chart-container {
width: 95%;
margin: 2%;
min-width: 900px;
height: 50vh;
padding: 15px;
float: left;
}

View File

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

View File

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

View File

@ -5,10 +5,10 @@ import {ChartUtils} from '../../../utils/chart-utils';
@Component({
selector: 'cc-server-statistics',
templateUrl: './server-stats.component.html',
styleUrls: ['./server-stats.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
})
selector: 'cc-server-statistics',
templateUrl: './server-stats.component.html',
styleUrls: ['./server-stats.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
})
export class ServerStatsComponent implements OnInit, OnChanges {
@ViewChild('overview') private overviewContainer: ElementRef;
@ -17,8 +17,6 @@ export class ServerStatsComponent implements OnInit, OnChanges {
@Input() performanceData: any;
startDateObj: Date;
public activeChartSelect: string;
showBarChart = true;
@ -42,7 +40,6 @@ export class ServerStatsComponent implements OnInit, OnChanges {
};
readonly labelsAsString = Object.keys(this.labels)
.map((key) => this.labels[key]);
lineChartSeriesLabels: string[];
gradient = false;
yAxis = true;
@ -54,6 +51,7 @@ export class ServerStatsComponent implements OnInit, OnChanges {
autoscale = true;
timeline = false;
roundDomains = true;
barPadding = 2;
colorScheme = {
name: 'nightLights',
selectable: false,
@ -74,8 +72,8 @@ export class ServerStatsComponent implements OnInit, OnChanges {
ngOnChanges(changes: SimpleChanges) {
if ((changes.war || changes.performanceData) && this.performanceData) {
this.translate.get(['stats.performance.select.timeline.label.minimum',
'stats.performance.select.timeline.label.average',
'stats.performance.select.timeline.label.maximum']).subscribe((res) => {
'stats.performance.select.timeline.label.average',
'stats.performance.select.timeline.label.maximum']).subscribe((res) => {
const resValues = Object.keys(res).map(val => res[val]);
this.initializeChartData(resValues[2], resValues[0], resValues[1]);
});
@ -161,13 +159,13 @@ export class ServerStatsComponent implements OnInit, OnChanges {
}
}
this.tmpSingleAvg.push({
name: entry.entityName,
value: entry.singleAvgFps
});
name: entry.entityName,
value: entry.singleAvgFps
});
this.tmpSingleMin.push({
name: entry.entityName,
value: entry.singleMinFps
});
name: entry.entityName,
value: entry.singleMinFps
});
});
tmpAvgArray = tmpAvgArray.map(x => Math.round(x / this.performanceData.length));

View File

@ -1,77 +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;
}
.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

@ -0,0 +1,79 @@
.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({
selector: 'war-detail',
templateUrl: './war-header.component.html',
styleUrls: ['./war-header.component.css', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
styleUrls: ['./war-header.component.scss', '../../../style/list-entry.css', '../../../style/hide-scrollbar.css']
})
export class WarHeaderComponent implements OnInit {

View File

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

View File

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

View File

@ -1,49 +0,0 @@
.load-indicator {
position: absolute;
top: 50%;
z-index: 10000;
left: 46%;
filter: drop-shadow(3px 1px 2px #dadada);
}
@media only screen and (min-width: 1200px) {
.load-indicator {
left: 47.4%;
}
}
@media only screen and (min-width: 1376px) {
.load-indicator {
left: 48%;
}
}
@media only screen and (min-width: 1600px) {
.load-indicator {
left: 48.2%;
}
}
@media only screen and (min-width: 1925px) {
.load-indicator {
left: 48.7%;
}
}
.load-arrow {
background: url(../../assets/icon/general/loading-arrows.svg) no-repeat;
display: block;
width: 70px;
height: 70px;
}
/* Loading Animation */
.glyphicon-refresh-animate {
animation: spin 1.5s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@ -0,0 +1,51 @@
$primary-color: #dadada;
$secondary-color: #666666;
$indicator-width: 100px;
$indicator-height: 100px;
.load-indicator {
width: $indicator-width;
height: $indicator-height;
position: absolute;
top: calc(50% - (#{$indicator-height} / 2));
left: calc(50% - (#{$indicator-width} / 2));
z-index: 10000;
filter: drop-shadow(3px 1px 2px $secondary-color);
.opt-loader {
border: 3px solid $secondary-color;
border-top: 3px solid $primary-color;
border-radius: 50%;
display: inline-block;
position: absolute;
width: 100%;
height: 100%;
animation: spin 2s linear infinite, fade 2s linear infinite;
}
.opt-logo-core {
width: $indicator-width * 0.85;
height: $indicator-height * 0.85;
margin: 6px 8px;
stroke: $secondary-color;
color: $primary-color;
}
}
@keyframes fade {
0%, 100% {
opacity: 0.5;
}
50% {
opacity: 1;
}
}
@keyframes spin {
0% {
transform: rotate(0deg)
}
100% {
transform: rotate(360deg)
}
}

View File

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

View File

@ -28,6 +28,10 @@
"stats.fraction.select.stabilize": "Stabilisiert",
"stats.fraction.select.flag": "Flaggenbesitz",
"stats.fraction.select.player.count": "Spieleranzahl",
"stats.fraction.tooltip.flag.minute": "Minute",
"stats.fraction.tooltip.flag.flag": "Flagge",
"stats.fraction.tooltip.flag.safe": "Gesichert",
"stats.fraction.tooltip.flag.lost": "Verloren",
"stats.performance.select.single.avg": "Spieler FPS Durchschnitt",
"stats.performance.select.single.min": "Spieler FPS Minimum",

View File

@ -36,6 +36,10 @@
"stats.fraction.select.stabilize": "Stabilized",
"stats.fraction.select.flag": "Flag Possession",
"stats.fraction.select.player.count": "Player Count",
"stats.fraction.tooltip.flag.minute": "Minute",
"stats.fraction.tooltip.flag.flag": "Flag",
"stats.fraction.tooltip.flag.safe": "Safe",
"stats.fraction.tooltip.flag.lost": "Lost",
"stats.performance.select.single.avg": "Player FPS Average",
"stats.performance.select.single.min": "Player FPS Minimum",

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="70px" height="70px" version="1.1" viewBox="0 0 70 70" xmlns="http://www.w3.org/2000/svg">
<path d="m0.25 34.88c0-3.06 0.25-6.77 0.94-9.69 2.43-10.28 12.69-20.77 22.75-23.75 3.65-1.09 5.7-0.92 11.12-1.19 3.64 0.02 10.15 0.2 16.63 3.81 2.22 1.24 8 5.32 10.31 7.44 1.69-1.38 6.06-6.12 8-7.5l-0.06 21.75s-22.13 0.37-22.13 0.37 7.13-7.31 7.13-7.31c-5.69-4.69-10.77-8.5-17.94-9.33-3.4-0.4-8.56-1.04-15 2.96-5.63 3.87-7.5 5.87-10.38 10.87-2.75 6.88-2.18 8.94-2.62 11.69l-8.75-0.12zm-0.25 8.12m69.75-7.88c0 3.06-0.25 6.77-0.94 9.69-2.43 10.28-12.69 20.77-22.75 23.75-3.65 1.09-5.7 0.92-11.12 1.19-3.64-0.02-10.15-0.2-16.63-3.81-2.22-1.24-8-5.32-10.31-7.44-1.69 1.38-6.06 6.12-8 7.5l0.06-21.75s22.13-0.37 22.13-0.37-7.13 7.31-7.13 7.31c5.69 4.69 10.77 8.5 17.94 9.33 3.4 0.4 8.56 1.04 15-2.96 5.62-3.87 7.5-5.87 10.38-10.87 2.74-6.88 2.18-8.94 2.62-11.69l8.75 0.12zm0.25-8.12"/>
</svg>

Before

Width:  |  Height:  |  Size: 929 B

View File

@ -0,0 +1 @@
<svg width="2.3in" height="2.2in" version="1.1" viewBox="0 0 168 160" xmlns="http://www.w3.org/2000/svg"><path id="Selection" d="m85 4c5.5 42 15 65 26 104 5-1.7 9.1-2.7 13-7 4.1-5.2 3.1-12 2.1-18-1.8-11-14-34-20-44-3-4.8-6.6-9.5-8.3-15 0 0-0.39-1.6 1-1 6.8 3.5 16 17 21 23 13 18 28 44 28 66-0.13 7.5-1.5 9-3 11-2.5 2.6-3.3 2.6-11 1.7l-20-4.7c0 6.8 0.47 12-2.3 18-7.6 18-28 23-41 8.8-7.8-7.7-10-18-10-29-4.8 2.2-9.8 4.2-15 5.3-8 1.8-21 3.4-24-6.3-0.81-2.3-0.76-5.6-0.71-8 0.48-21 18-50 31-66 4.8-6.2 12-17 19-19-1.7 5.4-5.3 10-8.3 15l-6.5 11c-6.5 11-14 27-15 40-0.56 7.9 3.2 14 11 17 3.3 1.1 5.6 1.2 9 1.2 0-8.2 0.04-13 3.1-21 0.76-2 2.3-5.8 4.3-6.8 4.2-2.1 5 9.4 5.5 12 3 15 7.8 30 16 43l-8.6-31c-6.2-22-11-51-7.2-73 1.7-9.8 3.9-19 9.8-27 0.19-0.31 2.6-2.9 3 0z"/></svg>

After

Width:  |  Height:  |  Size: 771 B