This commit is contained in:
Michele Artini 2023-12-07 13:25:38 +01:00
parent 8ddc88074d
commit d0c7ed9000
2 changed files with 19 additions and 2 deletions

View File

@ -12,11 +12,13 @@
<input matInput (keyup)="applyFilter($event)" placeholder="Filter..." #filterParams />
</mat-form-field>
<table mat-table [dataSource]="wfDatasource" class="mat-elevation-z8">
<table mat-table [dataSource]="wfDatasource" class="mat-elevation-z2">
<ng-container matColumnDef="k">
<th mat-header-cell *matHeaderCellDef>k</th>
<td mat-cell *matCellDef="let element" style="width: 30%;">{{element.k}}</td>
<td mat-cell *matCellDef="let element" style="width: 30%;">
<a (click)="selectElement(element)">{{element.k}}</a>
</td>
</ng-container>
<ng-container matColumnDef="v">
@ -34,6 +36,15 @@
</tr>
</table>
<mat-card *ngIf="selectedElement" style="margin-top: 1em; max-height: 300px; overflow-y: scroll;">
<mat-card-header>
<mat-card-title>{{selectedElement.k}}</mat-card-title>
</mat-card-header>
<mat-card-content>
<pre style="font-size: 0.7em;">{{selectedElement.v}}</pre>
</mat-card-content>
</mat-card>
</div>
<div mat-dialog-actions>

View File

@ -154,6 +154,8 @@ export class WfHistoryDetailsDialog {
wfDatasource: MatTableDataSource<KeyValue> = new MatTableDataSource<KeyValue>([]);
colums: string[] = ['k', 'v'];
selectedElement?: KeyValue;
constructor(
public dialogRef: MatDialogRef<WfHistoryDetailsDialog>,
@Inject(MAT_DIALOG_DATA) public data: WfHistoryEntry,
@ -179,6 +181,10 @@ export class WfHistoryDetailsDialog {
this.dialogRef.close();
}
selectElement(elem: KeyValue) {
this.selectedElement = elem;
}
calculateDateDiff(start: number, end: number): string {
if (start <= 0 || end <= 0) {
return '-';