Various improvements to game management interface

This commit is contained in:
grimsi
2022-08-05 18:34:24 +02:00
parent 22c8e99f38
commit 98197fc4a6
23 changed files with 446 additions and 170 deletions
@@ -1,70 +1,10 @@
<div *ngIf="loggedIn && (this.unmappedFiles.length > 0 || this.mappedGames.length > 0)" fxFlexFill fxLayoutAlign="center start">
<mat-tab-group>
<mat-tab label="Game mappings">
<table mat-table [dataSource]="mappedGames" class="mat-elevation-z8">
<ng-container matColumnDef="path">
<th mat-header-cell *matHeaderCellDef> Path</th>
<td mat-cell *matCellDef="let element"> {{element.path}} </td>
</ng-container>
<ng-container matColumnDef="game">
<th mat-header-cell *matHeaderCellDef> Game</th>
<td mat-cell *matCellDef="let element"> {{element.title}} ({{getFullYearFromTimestamp(element.releaseDate)}}
)
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>
<button mat-icon-button (click)="refreshMappedGamesList()">
<mat-icon>refresh</mat-icon>
</button>
</th>
<td mat-cell *matCellDef="let element">
<button mat-icon-button (click)="confirmGameMapping(element)" [disabled]="element.confirmedMatch">
<mat-icon>check</mat-icon>
</button>
<button mat-icon-button (click)="openCorrectMappingDialog(element)">
<mat-icon>edit</mat-icon>
</button>
<button mat-icon-button (click)="deleteGameMapping(element)">
<mat-icon>delete</mat-icon>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="gameMappingTableColumns"></tr>
<tr mat-row *matRowDef="let row; columns: gameMappingTableColumns;"></tr>
</table>
<mapped-games-table [mappedGames]="mappedGames"></mapped-games-table>
</mat-tab>
<mat-tab label="Unmapped files">
<table mat-table [dataSource]="unmappedFiles" class="mat-elevation-z8">
<ng-container matColumnDef="path">
<th mat-header-cell *matHeaderCellDef> Path</th>
<td mat-cell *matCellDef="let element"> {{element.path}} </td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>
<button mat-icon-button (click)="refreshUnmappedFilesList()">
<mat-icon>refresh</mat-icon>
</button>
</th>
<td mat-cell *matCellDef="let element">
<button mat-icon-button (click)="openMapUnmappedFileDialog(element)">
<mat-icon>edit</mat-icon>
</button>
<button mat-icon-button (click)="deleteUnmappedFile(element)">
<mat-icon>delete</mat-icon>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="unmappedGameTableColumns"></tr>
<tr mat-row *matRowDef="let row; columns: unmappedGameTableColumns;"></tr>
</table>
<unmapped-files-table [unmappedFiles]="unmappedFiles"></unmapped-files-table>
</mat-tab>
</mat-tab-group>
</div>