update for template dialog

This commit is contained in:
piotrpekala7 2020-06-15 14:29:07 +02:00
parent 66bbe2cd11
commit 15505b9b8c
2 changed files with 19 additions and 11 deletions

View File

@ -39,33 +39,33 @@
(matSortChange)= "sortData($event)"
[dataSource]="dataSource | datasourcefilter: searchText">
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="emulator">
<mat-header-cell *matHeaderCellDef mat-sort-header> Emulator </mat-header-cell>
<mat-header-cell *matHeaderCellDef> Emulator </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.emulator}} </mat-cell>
</ng-container>
<ng-container matColumnDef="vendor">
<mat-header-cell *matHeaderCellDef mat-sort-header> Vendor </mat-header-cell>
<mat-header-cell *matHeaderCellDef> Vendor </mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.vendor_name}} </mat-cell>
</ng-container>
<!-- <ng-container matColumnDef="actions">
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
<mat-cell *matCellDef="let row" style="text-align: right">
<button mat-icon-button matTooltip="Restore snapshot" (click)="restoreSnapshot(row)">
<mat-icon aria-label="Restore snapshot">restore</mat-icon>
<button mat-icon-button matTooltip="Install" (click)="install(row)">
<mat-icon aria-label="Install">archive</mat-icon>
</button>
<button mat-icon-button matTooltip="Delete snapshot" (click)="deleteSnapshot(row)">
<mat-icon aria-label="Delete snapshot">delete</mat-icon>
<button mat-icon-button matTooltip="Show info" (click)="showInfo(row)">
<mat-icon aria-label="Show info">info</mat-icon>
</button>
</mat-cell>
</ng-container> -->
</ng-container>
<!-- <ng-container matColumnDef="expandedDetail">
<mat-cell *matCellDef="let detail">
The symbol for {{detail.element}}

View File

@ -36,7 +36,7 @@ export class NewTemplateDialogComponent implements OnInit {
public categories: string[] = ['all categories', 'router', 'multilayer_switch', 'guest', 'firewall'];
public category: string = 'all categories';
public displayedColumns: string[] = ['name', 'emulator', 'vendor'];
public displayedColumns: string[] = ['name', 'emulator', 'vendor', 'actions'];
public dataSource: MatTableDataSource<Appliance>;
@ -147,6 +147,14 @@ export class NewTemplateDialogComponent implements OnInit {
onCloseClick() {
this.dialogRef.close();
}
install(object: any) {
console.log(object);
}
showInfo(object: any) {
console.log(object);
}
}
function compareNames(a: string, b: string, isAsc: boolean) {