|
|
|
@ -63,33 +63,40 @@ |
|
|
|
<mat-header-cell *matHeaderCellDef class="table-value-column"> |
|
|
|
{{ 'gateway.name' | translate }} |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let mapping" class="table-value-column"> |
|
|
|
{{ mapping['name'] }} |
|
|
|
<mat-cell *matCellDef="let slave" class="table-value-column"> |
|
|
|
{{ slave['name'] }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container [matColumnDef]="'type'"> |
|
|
|
<mat-header-cell *matHeaderCellDef class="table-value-column"> |
|
|
|
{{ 'gateway.client-communication-type' | translate }} |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let mapping" class="table-value-column"> |
|
|
|
{{ ModbusProtocolLabelsMap.get(mapping['type']) }} |
|
|
|
<mat-cell *matCellDef="let slave" class="table-value-column"> |
|
|
|
{{ ModbusProtocolLabelsMap.get(slave['type']) }} |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<ng-container matColumnDef="actions" stickyEnd> |
|
|
|
<mat-header-cell *matHeaderCellDef |
|
|
|
[ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px', textAlign: 'center'}"> |
|
|
|
</mat-header-cell> |
|
|
|
<mat-cell *matCellDef="let mapping; let i = index" |
|
|
|
<mat-cell *matCellDef="let slave; let i = index" |
|
|
|
[ngStyle.gt-md]="{ minWidth: '96px', maxWidth: '96px', width: '96px'}"> |
|
|
|
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end"> |
|
|
|
<ng-template #rowActions> |
|
|
|
<button mat-icon-button |
|
|
|
matTooltip="{{ 'action.edit' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="manageSlave($event, i)"> |
|
|
|
<tb-icon>edit</tb-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button |
|
|
|
(click)="deleteMapping($event, i)"> |
|
|
|
matTooltip="{{ 'action.delete' | translate }}" |
|
|
|
matTooltipPosition="above" |
|
|
|
(click)="deleteSlave($event, i)"> |
|
|
|
<tb-icon>delete</tb-icon> |
|
|
|
</button> |
|
|
|
</ng-template> |
|
|
|
<div fxHide fxShow.gt-md fxFlex fxLayout="row" fxLayoutAlign="end"> |
|
|
|
<ng-container [ngTemplateOutlet]="rowActions"></ng-container> |
|
|
|
</div> |
|
|
|
<div fxHide fxShow.lt-lg fxFlex fxLayout="row" fxLayoutAlign="end"> |
|
|
|
<button mat-icon-button |
|
|
|
@ -98,20 +105,13 @@ |
|
|
|
<mat-icon class="material-icons">more_vert</mat-icon> |
|
|
|
</button> |
|
|
|
<mat-menu #cellActionsMenu="matMenu" xPosition="before"> |
|
|
|
<button mat-icon-button |
|
|
|
(click)="manageSlave($event, i)"> |
|
|
|
<tb-icon>edit</tb-icon> |
|
|
|
</button> |
|
|
|
<button mat-icon-button |
|
|
|
(click)="deleteMapping($event, i)"> |
|
|
|
<tb-icon>delete</tb-icon> |
|
|
|
</button> |
|
|
|
<ng-container [ngTemplateOutlet]="rowActions"></ng-container> |
|
|
|
</mat-menu> |
|
|
|
</div> |
|
|
|
</mat-cell> |
|
|
|
</ng-container> |
|
|
|
<mat-header-row [ngClass]="{'mat-row-select': true}" *matHeaderRowDef="['name', 'type', 'actions']; sticky: true"></mat-header-row> |
|
|
|
<mat-row *matRowDef="let mapping; columns: ['name', 'type', 'actions']"></mat-row> |
|
|
|
<mat-row *matRowDef="let slave; columns: ['name', 'type', 'actions']"></mat-row> |
|
|
|
</table> |
|
|
|
<section [fxShow]="!textSearchMode && (dataSource.isEmpty() | async)" fxLayoutAlign="center center" |
|
|
|
class="mat-headline-5 tb-absolute-fill tb-add-new"> |
|
|
|
|