diff --git a/api/routes/wars.js b/api/routes/wars.js index 7726b68..3c3fe61 100644 --- a/api/routes/wars.js +++ b/api/routes/wars.js @@ -176,8 +176,15 @@ wars.route('/:id') return next(err); } - // delete players having this war ID as foreign key + // delete linked appearances 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 const warDir = __dirname + '/../resource/logs/' + req.params.id; diff --git a/api/tools/log-parse-tool.js b/api/tools/log-parse-tool.js index ef07199..f780177 100644 --- a/api/tools/log-parse-tool.js +++ b/api/tools/log-parse-tool.js @@ -67,9 +67,10 @@ const parseWarLog = (lineArray, war) => { stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]); stats.war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5]); } else if (line.includes('Startbudget')) { - stats.war.date = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T22:00:00'); stats.war['budgetBlufor'] = transformMoneyString(budg[11]); stats.war['budgetOpfor'] = transformMoneyString(budg[14]); + // this date needs to be assigned in first place !important + stats.war.date = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T22:00:00'); } else { stats.budget.push(getBudgetEntry(budg, war._id, war.date)); } @@ -103,6 +104,7 @@ const parseWarLog = (lineArray, war) => { if (line.includes('Endpunktestand')) { stats.war['ptBlufor'] = parseInt(pt[11]); stats.war['ptOpfor'] = parseInt(pt[14].slice(0, -1)); + // EXIT LOOP return true; } else { stats.points.push(getPointsEntry(pt, line, war._id, war.date)) diff --git a/package.json b/package.json index f4446c7..9d1d374 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opt-cc", - "version": "1.6.1", + "version": "1.6.2", "license": "MIT", "author": "Florian Hartwich ", "private": true, diff --git a/static/src/app/statistic/overview/stats-overview.component.ts b/static/src/app/statistic/overview/stats-overview.component.ts index a5395a1..e39ccdc 100644 --- a/static/src/app/statistic/overview/stats-overview.component.ts +++ b/static/src/app/statistic/overview/stats-overview.component.ts @@ -97,7 +97,6 @@ export class StatisticOverviewComponent { break; } this.activeSlideIndex = index; - } initChart(wars: any[]) { diff --git a/static/src/app/statistic/stats.module.ts b/static/src/app/statistic/stats.module.ts index 8311f4e..5be86ae 100644 --- a/static/src/app/statistic/stats.module.ts +++ b/static/src/app/statistic/stats.module.ts @@ -4,7 +4,7 @@ import {SharedModule} from "../shared.module"; import {statsRouterModule, statsRoutingComponents} from "./stats.routing"; import {WarService} from "../services/logs/war.service"; import {NgxChartsModule} from "@swimlane/ngx-charts"; -import {AccordionModule, TabsModule} from "ngx-bootstrap"; +import {AccordionModule, BsDropdownModule, ButtonsModule, TabsModule} from "ngx-bootstrap"; import {CampaignService} from "../services/logs/campaign.service"; import {NgxDatatableModule} from "@swimlane/ngx-datatable"; import {PlayerService} from "../services/logs/player.service"; @@ -13,7 +13,7 @@ import {LogsService} from "../services/logs/logs.service"; @NgModule({ declarations: statsRoutingComponents, imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, - AccordionModule.forRoot(), TabsModule.forRoot(), NgxDatatableModule], + AccordionModule.forRoot(), BsDropdownModule.forRoot(), ButtonsModule.forRoot(), TabsModule.forRoot(), NgxDatatableModule], providers: [WarService, CampaignService, PlayerService, LogsService] }) export class StatsModule { diff --git a/static/src/app/statistic/war-detail/war-detail.component.css b/static/src/app/statistic/war-detail/war-detail.component.css index 00eaf09..a80d857 100644 --- a/static/src/app/statistic/war-detail/war-detail.component.css +++ b/static/src/app/statistic/war-detail/war-detail.component.css @@ -42,19 +42,10 @@ color: blue; } -.chart-container { - width: 90%; - margin: 2%; - min-width: 900px; - height: 400px; - padding: 15px; - float: left; -} - /* ########### TABS ########### */ :host /deep/ .nav-tabs { - padding-left: 35%!important; + padding-left: 35% !important; } :host /deep/ .nav-link { @@ -63,11 +54,11 @@ } :host /deep/ .nav-link:hover { - background: #286090; + background: #afafaf; color: #000; } -:host /deep/ .nav-tabs>li.active>a{ +:host /deep/ .nav-tabs > li.active > a { background: #222222; color: white; } @@ -107,3 +98,40 @@ background-color: #f7f7f7; } +/* ########### 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 { + width: 95%; + margin: 2%; + min-width: 900px; + height: 600px; + padding: 15px; + float: left; +} + +.chart-select-group { + width: 50%; + margin: auto; + position: inherit; + display: block; + vertical-align: middle; +} + +/*.dropdown-menu > li > a {*/ + /*cursor: pointer;*/ +/*}*/ diff --git a/static/src/app/statistic/war-detail/war-detail.component.html b/static/src/app/statistic/war-detail/war-detail.component.html index 60f28d9..987f2f3 100644 --- a/static/src/app/statistic/war-detail/war-detail.component.html +++ b/static/src/app/statistic/war-detail/war-detail.component.html @@ -25,9 +25,11 @@
- Logfile - anzeigen -
+ + Logfile anzeigen +