2019-10-24 19:52:19 +03:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
Copyright © 2016-2019 The Thingsboard Authors
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<div class="mat-padding tb-entity-table tb-absolute-fill">
|
|
|
|
|
<div fxFlex fxLayout="column" class="mat-elevation-z1 tb-entity-table-content">
|
|
|
|
|
<mat-toolbar class="mat-table-toolbar" [fxShow]="!textSearchMode">
|
|
|
|
|
<div class="mat-toolbar-tools">
|
|
|
|
|
<span class="tb-entity-table-title" translate>widget-config.actions</span>
|
|
|
|
|
<span fxFlex></span>
|
|
|
|
|
<button mat-button mat-icon-button [disabled]="isLoading$ | async"
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2019-10-24 19:52:19 +03:00
|
|
|
(click)="addAction($event)"
|
|
|
|
|
matTooltip="{{ 'widget-config.add-action' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>add</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-button mat-icon-button [disabled]="isLoading$ | async" (click)="enterFilterMode()"
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2019-10-24 19:52:19 +03:00
|
|
|
matTooltip="{{ 'action.search' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>search</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-toolbar>
|
|
|
|
|
<mat-toolbar class="mat-table-toolbar" [fxShow]="textSearchMode">
|
|
|
|
|
<div class="mat-toolbar-tools">
|
|
|
|
|
<button mat-button mat-icon-button
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2019-10-24 19:52:19 +03:00
|
|
|
matTooltip="{{ 'widget-config.search-actions' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>search</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label> </mat-label>
|
|
|
|
|
<input #searchInput matInput
|
|
|
|
|
[(ngModel)]="pageLink.textSearch"
|
|
|
|
|
placeholder="{{ 'widget-config.search-actions' | translate }}"/>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<button mat-button mat-icon-button (click)="exitFilterMode()"
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2019-10-24 19:52:19 +03:00
|
|
|
matTooltip="{{ 'action.close' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-toolbar>
|
|
|
|
|
<div fxFlex class="table-container">
|
|
|
|
|
<mat-table [dataSource]="dataSource"
|
|
|
|
|
matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="(pageLink.sortOrder.direction + '').toLowerCase()" matSortDisableClear>
|
|
|
|
|
<ng-container matColumnDef="actionSourceName">
|
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'widget-config.action-source' | translate }} </mat-header-cell>
|
|
|
|
|
<mat-cell *matCellDef="let action">
|
|
|
|
|
{{ action.actionSourceName }}
|
|
|
|
|
</mat-cell>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container matColumnDef="name">
|
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'widget-config.action-name' | translate }} </mat-header-cell>
|
|
|
|
|
<mat-cell *matCellDef="let action">
|
|
|
|
|
{{ action.name }}
|
|
|
|
|
</mat-cell>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container matColumnDef="icon">
|
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'widget-config.action-icon' | translate }} </mat-header-cell>
|
|
|
|
|
<mat-cell *matCellDef="let action">
|
|
|
|
|
<mat-icon>{{ action.icon }}</mat-icon>
|
|
|
|
|
</mat-cell>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container matColumnDef="typeName">
|
|
|
|
|
<mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'widget-config.action-type' | translate }} </mat-header-cell>
|
|
|
|
|
<mat-cell *matCellDef="let action">
|
|
|
|
|
{{ action.typeName }}
|
|
|
|
|
</mat-cell>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container matColumnDef="actions" stickyEnd>
|
|
|
|
|
<mat-header-cell *matHeaderCellDef [ngStyle]="{ minWidth: '80px', maxWidth: '80px' }">
|
|
|
|
|
</mat-header-cell>
|
|
|
|
|
<mat-cell *matCellDef="let action" [ngStyle]="{ minWidth: '80px', maxWidth: '80px' }">
|
|
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="end">
|
|
|
|
|
<button mat-button mat-icon-button [disabled]="isLoading$ | async"
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2019-10-24 19:52:19 +03:00
|
|
|
matTooltip="{{ 'widget-config.edit-action' | translate }}"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
(click)="editAction($event, action)">
|
|
|
|
|
<mat-icon>edit</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-button mat-icon-button [disabled]="isLoading$ | async"
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2019-10-24 19:52:19 +03:00
|
|
|
matTooltip="{{ 'widget-config.delete-action' | translate }}"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
(click)="deleteAction($event, action)">
|
|
|
|
|
<mat-icon>delete</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-cell>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<mat-header-row [ngClass]="{'mat-row-select': true}" *matHeaderRowDef="displayedColumns; sticky: true"></mat-header-row>
|
|
|
|
|
<mat-row [ngClass]="{'mat-row-select': true}"
|
|
|
|
|
*matRowDef="let action; columns: displayedColumns;"></mat-row>
|
|
|
|
|
</mat-table>
|
|
|
|
|
<span [fxShow]="dataSource.isEmpty() | async"
|
|
|
|
|
fxLayoutAlign="center center"
|
|
|
|
|
class="no-data-found" translate>{{ 'widget-config.no-actions-text' }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<mat-divider></mat-divider>
|
|
|
|
|
<mat-paginator [length]="dataSource.total() | async"
|
|
|
|
|
[pageIndex]="pageLink.page"
|
|
|
|
|
[pageSize]="pageLink.pageSize"
|
|
|
|
|
[pageSizeOptions]="[10, 20, 30]"></mat-paginator>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|