diff --git a/README.md b/README.md index c9778a0..49b76af 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,30 @@ _MEAN Application_ ### Setup mongoDB +https://docs.mongodb.com/manual/administration/install-community/ + ### Setup node and npm + sudo apt-get install npm nodejs-legacy + +update to latest npm version + + sudo npm install -g npm@latest + +update node to latest version + + sudo npm install -g n@latest + n latest + +check versions + + npm -v + node -v + ## Development and Execution ### First run in dev mode -### Run in Prodction +### Run in Production ## License Information diff --git a/api/models/war.js b/api/models/war.js index d059d44..7d4cf9c 100644 --- a/api/models/war.js +++ b/api/models/war.js @@ -11,6 +11,10 @@ const WarSchema = new Schema({ date: { type: Date, }, + endDate : { + type: Date, + required: true + }, ptBlufor: { type: Number, get: v => Math.round(v), @@ -61,7 +65,7 @@ const WarSchema = new Schema({ get: v => Math.round(v), set: v => Math.round(v), default: 0 - }, + } }, { collection: 'war', timestamps: {createdAt: 'timestamp'} diff --git a/api/tools/log-parse-tool.js b/api/tools/log-parse-tool.js index e363b90..06fa9ec 100644 --- a/api/tools/log-parse-tool.js +++ b/api/tools/log-parse-tool.js @@ -65,6 +65,9 @@ const parseWarLog = (lineArray, war) => { if (line.includes('Endbudget')) { stats.war['endBudgetBlufor'] = transformMoneyString(budg[11]); stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]); + console.log(budg) + console.log(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T' + budg[5] +'.000+02:00') + war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5] +'.000+02:00'); } else if (line.includes('Startbudget')) { stats.war.date = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T22:00:00.000+02:00'); stats.war['budgetBlufor'] = transformMoneyString(budg[11]); diff --git a/static/src/app/models/model-interfaces.ts b/static/src/app/models/model-interfaces.ts index 968b672..4830267 100644 --- a/static/src/app/models/model-interfaces.ts +++ b/static/src/app/models/model-interfaces.ts @@ -46,6 +46,7 @@ export interface War { _id?: string; title?: string; date?: string; + endDate?: string; ptBlufor?: number; ptOpfor?: number; playersBlufor?: number; 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 a249eb6..00eaf09 100644 --- a/static/src/app/statistic/war-detail/war-detail.component.css +++ b/static/src/app/statistic/war-detail/war-detail.component.css @@ -43,11 +43,11 @@ } .chart-container { - width: 95%; - min-width: 500px; + width: 90%; + margin: 2%; + min-width: 900px; height: 400px; padding: 15px; - margin: 2%; float: left; } 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 4d5e279..64ab7dd 100644 --- a/static/src/app/statistic/war-detail/war-detail.component.html +++ b/static/src/app/statistic/war-detail/war-detail.component.html @@ -221,7 +221,7 @@