65 lines
3.0 KiB
HTML
65 lines
3.0 KiB
HTML
<!--
|
|
|
|
Copyright © 2016-2024 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="tb-form-panel tb-scada-symbol-properties">
|
|
<div class="tb-form-table">
|
|
<div class="tb-form-table-header" [class.no-padding-right]="!disabled">
|
|
<div class="tb-form-table-header-cell tb-id-header" translate>scada.property.id</div>
|
|
<div class="tb-form-table-header-cell tb-name-header" translate>scada.property.name</div>
|
|
<div class="tb-form-table-header-cell tb-type-header" translate>scada.property.type</div>
|
|
<div class="tb-form-table-header-cell tb-actions-header" [class.disabled]="disabled"></div>
|
|
</div>
|
|
<div *ngIf="propertiesFormArray().controls.length; else noProperties" class="tb-form-table-body tb-drop-list"
|
|
cdkDropList cdkDropListOrientation="vertical"
|
|
[cdkDropListDisabled]="!dragEnabled"
|
|
(cdkDropListDropped)="propertyDrop($event)">
|
|
<div cdkDrag [cdkDragDisabled]="!dragEnabled"
|
|
[class.tb-draggable-form-table-row]="!disabled"
|
|
*ngFor="let propertyControl of propertiesFormArray().controls; trackBy: trackByProperty; let $index = index;">
|
|
<tb-scada-symbol-metadata-property-row fxFlex
|
|
[index]="$index"
|
|
[booleanPropertyIds]="booleanPropertyIds"
|
|
[formControl]="propertyControl"
|
|
(propertyRemoved)="removeProperty($index)">
|
|
</tb-scada-symbol-metadata-property-row>
|
|
<div class="tb-form-table-row-cell-buttons">
|
|
<button mat-icon-button
|
|
*ngIf="!disabled"
|
|
type="button"
|
|
cdkDragHandle
|
|
[ngClass]="{'tb-hidden': !dragEnabled}"
|
|
matTooltip="{{ 'action.drag' | translate }}"
|
|
matTooltipPosition="above">
|
|
<mat-icon>drag_indicator</mat-icon>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<tb-error *ngIf="errorText" noMargin [error]="errorText" style="padding-left: 12px;"></tb-error>
|
|
</div>
|
|
<div *ngIf="!disabled">
|
|
<button type="button" mat-stroked-button color="primary" (click)="addProperty()">
|
|
{{ 'scada.property.add-property' | translate }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<ng-template #noProperties>
|
|
<span fxLayoutAlign="center center"
|
|
class="tb-prompt">{{ 'scada.property.no-properties' | translate }}</span>
|
|
</ng-template>
|