User and Client lists show the last logins.

This commit is contained in:
tanshu committed 2020-12-05 09:03:11 +05:30
1 parent c2e8c0382a
commit 9aeb71d566
13 files changed
+102 -61

No files matched your search

@@ -33,13 +33,15 @@
<!-- Created Column -->
<ng-container matColumnDef="created">
<mat-header-cell *matHeaderCellDef mat-sort-header>Created</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.created | localTime }}</mat-cell>
<mat-cell *matCellDef="let row">{{ row.creationDate | localTime }}</mat-cell>
</ng-container>
<!-- Last Login Column -->
<ng-container matColumnDef="lastLogin">
<ng-container matColumnDef="last">
<mat-header-cell *matHeaderCellDef mat-sort-header>Last Login</mat-header-cell>
<mat-cell *matCellDef="let row">{{ row.lastLogin | localTime }}</mat-cell>
<mat-cell *matCellDef="let row"
>{{ row.lastUser }} @ {{ row.lastDate ? (row.lastDate | localTime) : 'Never' }}</mat-cell
>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
@@ -18,7 +18,7 @@ export class ClientListComponent implements OnInit {
list: Client[] = [];
dataSource: ClientListDataSource = new ClientListDataSource(this.list);
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['code', 'name', 'enabled', 'otp', 'created', 'lastLogin'];
displayedColumns = ['code', 'name', 'enabled', 'otp', 'created', 'last'];
constructor(private route: ActivatedRoute) {}
+4 -4
View File
@@ -3,18 +3,18 @@ export class Client {
name: string;
code: number;
enabled: boolean;
otp: number;
otp?: number;
creationDate: string;
lastLogin: string;
lastUser: string;
lastDate?: string;
public constructor(init?: Partial<Client>) {
this.id = '';
this.name = '';
this.code = 0;
this.enabled = true;
this.otp = 0;
this.creationDate = '';
this.lastLogin = '';
this.lastUser = '';
Object.assign(this, init);
}
}