diff --git a/static/src/app/statistic/stats.module.ts b/static/src/app/statistic/stats.module.ts index f3a40fc..8a10d57 100644 --- a/static/src/app/statistic/stats.module.ts +++ b/static/src/app/statistic/stats.module.ts @@ -8,12 +8,13 @@ import {CampaignService} from '../services/logs/campaign.service'; import {NgxDatatableModule} from '@swimlane/ngx-datatable'; import {PlayerService} from '../services/logs/player.service'; import {LogsService} from '../services/logs/logs.service'; -import {MatButtonModule, MatButtonToggleModule, MatExpansionModule} from '@angular/material'; +import {MatButtonModule, MatButtonToggleModule, MatExpansionModule, MatTableModule} from '@angular/material'; + @NgModule({ declarations: statsRoutingComponents, imports: [CommonModule, SharedModule, statsRouterModule, NgxChartsModule, NgxDatatableModule, - MatButtonModule, MatExpansionModule, MatButtonToggleModule], + MatButtonModule, MatExpansionModule, MatButtonToggleModule, MatTableModule], providers: [WarService, CampaignService, PlayerService, LogsService] }) export class StatsModule { diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.css b/static/src/app/statistic/war/scoreboard/scoreboard.component.css index c06a7a6..b2acb6d 100644 --- a/static/src/app/statistic/war/scoreboard/scoreboard.component.css +++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.css @@ -69,3 +69,21 @@ ngx-datatable { position: absolute; margin-top: -5px; } + +/* MATERIAL TABLE */ +table.mat-table { + margin: auto; +} + +.mat-column-name { + width: 200px; +} +.mat-column-fraction { + width: 90px; +} + +.mat-column-kill, .mat-column-friendlyFire, .mat-column-revive, .mat-column-flagTouch, +.mat-column-vehicleLight, .mat-column-vehicleHeavy, .mat-column-vehicleAir, .mat-column-death, .mat-column-respawn { + width: 62px; + text-align: center; +} diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.html b/static/src/app/statistic/war/scoreboard/scoreboard.component.html index e2559ea..0f9e603 100644 --- a/static/src/app/statistic/war/scoreboard/scoreboard.component.html +++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.html @@ -1,47 +1,73 @@ -
- - - - - {{value}} - - - - - - {{value === 'BLUFOR' ? fraction.BLUFOR : fraction.OPFOR}} - - +
-
- - - - - {{column.head}} - - - - -
- - - - Gesamt - - - - + + + + + + + + + + + + + + + + + + + +
{{tableHead[0].head}} + {{element.name}} + {{tableHead[1].head}} {{element.fraction}} {{column.head}} {{element[column.prop]}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/static/src/app/statistic/war/scoreboard/scoreboard.component.ts b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts index aa05ffd..a24d698 100644 --- a/static/src/app/statistic/war/scoreboard/scoreboard.component.ts +++ b/static/src/app/statistic/war/scoreboard/scoreboard.component.ts @@ -29,6 +29,9 @@ export class ScoreboardComponent implements OnChanges { rows = []; + displayedColumns = //['name', 'fraction', 'kill', 'friendlyFire', 'revive', 'flagTouch', 'vehicleLight', 'vehicleHeavy', 'vehicleAir']; + this.tableHead.map(head => head.prop); + reorderable = false; customClasses = { @@ -37,6 +40,7 @@ export class ScoreboardComponent implements OnChanges { }; constructor(private elRef: ElementRef) { + console.log(this.displayedColumns) } selectPlayerDetail(view: number, player) { @@ -49,9 +53,9 @@ export class ScoreboardComponent implements OnChanges { ngOnChanges(changes: SimpleChanges) { if (changes.war) { this.rows = changes.war.currentValue.players; - this.elRef.nativeElement - .querySelector('.datatable-body') - .scrollTo(0, 0); +// this.elRef.nativeElement +// .querySelector('.datatable-body') +// .scrollTo(0, 0); } if (changes.fractionFilterSelected) { this.filterPlayersByFraction(this.fractionFilterSelected);