2019-10-10 13:00:29 +03:00
|
|
|
<!--
|
|
|
|
|
|
2020-02-20 10:26:43 +02:00
|
|
|
Copyright © 2016-2020 The Thingsboard Authors
|
2019-10-10 13:00:29 +03:00
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<form #entityAliasesForm="ngForm" [formGroup]="entityAliasesFormGroup" (ngSubmit)="save()" style="width: 700px;">
|
2020-04-21 11:53:26 +03:00
|
|
|
<mat-toolbar color="primary">
|
2019-10-10 13:00:29 +03:00
|
|
|
<h2>{{ title | translate }}</h2>
|
|
|
|
|
<span fxFlex></span>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button mat-icon-button
|
2019-10-10 13:00:29 +03:00
|
|
|
(click)="cancel()"
|
|
|
|
|
type="button">
|
|
|
|
|
<mat-icon class="material-icons">close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</mat-toolbar>
|
|
|
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
|
|
|
|
|
</mat-progress-bar>
|
|
|
|
|
<div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div>
|
|
|
|
|
<div mat-dialog-content>
|
2020-04-21 11:53:26 +03:00
|
|
|
<div class="tb-aliases-header" fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<span fxFlex="5"></span>
|
|
|
|
|
<div fxFlex="95" fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<span class="tb-header-label" translate fxFlex="150px">alias.name</span>
|
|
|
|
|
<span class="tb-header-label" translate fxFlex style="padding-left: 10px;">alias.entity-filter</span>
|
|
|
|
|
<span class="tb-header-label" translate fxFlex="120px" style="padding-left: 10px;">alias.resolve-multiple</span>
|
|
|
|
|
<span style="min-width: 80px;"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-10-10 13:00:29 +03:00
|
|
|
<fieldset [disabled]="isLoading$ | async">
|
2020-04-21 11:53:26 +03:00
|
|
|
<mat-divider></mat-divider>
|
2019-10-10 13:00:29 +03:00
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="start center"
|
|
|
|
|
formArrayName="entityAliases"
|
2019-12-23 14:36:44 +02:00
|
|
|
*ngFor="let entityAliasControl of entityAliasesFormArray().controls; let $index = index">
|
2019-10-10 13:00:29 +03:00
|
|
|
<span fxFlex="5">{{$index + 1}}.</span>
|
|
|
|
|
<div class="mat-elevation-z4 tb-alias" fxFlex="95" fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<mat-form-field floatLabel="always" hideRequiredMarker class="mat-block" fxFlex="150px">
|
|
|
|
|
<mat-label></mat-label>
|
|
|
|
|
<input matInput [formControl]="entityAliasControl.get('alias')" required placeholder="{{ 'entity.alias' | translate }}">
|
|
|
|
|
<mat-error *ngIf="entityAliasControl.get('alias').hasError('required')">
|
|
|
|
|
{{ 'entity.alias-required' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<tb-entity-filter-view fxFlex style="padding-left: 10px;" [formControl]="entityAliasControl.get('filter')">
|
|
|
|
|
</tb-entity-filter-view>
|
|
|
|
|
<section fxFlex="120px" style="padding-left: 10px;"
|
|
|
|
|
class="tb-resolve-multiple-switch"
|
|
|
|
|
fxLayout="column"
|
|
|
|
|
fxLayoutAlign="center center">
|
|
|
|
|
<mat-slide-toggle class="resolve-multiple-switch"
|
|
|
|
|
[formControl]="entityAliasControl.get('resolveMultiple')">
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
</section>
|
|
|
|
|
<button [disabled]="isLoading$ | async"
|
2020-04-21 11:53:26 +03:00
|
|
|
mat-icon-button color="primary"
|
2019-10-10 13:00:29 +03:00
|
|
|
style="min-width: 40px;"
|
|
|
|
|
type="button"
|
|
|
|
|
(click)="editAlias($index)"
|
|
|
|
|
matTooltip="{{ 'alias.edit' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>edit</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button [disabled]="isLoading$ | async"
|
2020-04-21 11:53:26 +03:00
|
|
|
mat-icon-button color="primary"
|
2019-10-10 13:00:29 +03:00
|
|
|
style="min-width: 40px;"
|
|
|
|
|
type="button"
|
|
|
|
|
(click)="removeAlias($index)"
|
|
|
|
|
matTooltip="{{ 'entity.remove-alias' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</div>
|
2020-04-21 11:53:26 +03:00
|
|
|
<div mat-dialog-actions>
|
|
|
|
|
<button mat-raised-button color="primary"
|
2019-10-10 13:00:29 +03:00
|
|
|
type="button"
|
|
|
|
|
(click)="addAlias()"
|
|
|
|
|
[fxShow]="!disableAdd"
|
|
|
|
|
[disabled]="isLoading$ | async"
|
|
|
|
|
matTooltip="{{ 'alias.add' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
{{ 'alias.add' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<span fxFlex></span>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button mat-raised-button color="primary"
|
2019-10-10 13:00:29 +03:00
|
|
|
type="submit"
|
|
|
|
|
[disabled]="(isLoading$ | async) || entityAliasesFormGroup.invalid || !entityAliasesFormGroup.dirty">
|
|
|
|
|
{{ 'action.save' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-button color="primary"
|
|
|
|
|
type="button"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
2020-04-21 11:53:26 +03:00
|
|
|
(click)="cancel()"
|
|
|
|
|
cdkFocusInitial>
|
2019-10-10 13:00:29 +03:00
|
|
|
{{ 'action.cancel' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|