2019-09-25 19:37:29 +03:00
|
|
|
<!--
|
|
|
|
|
|
2022-01-17 14:07:46 +02:00
|
|
|
Copyright © 2016-2022 The Thingsboard Authors
|
2019-09-25 19:37: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.
|
|
|
|
|
|
|
|
|
|
-->
|
2021-06-25 18:41:25 +03:00
|
|
|
<mat-tab-group class="tb-widget-config tb-absolute-fill" [(selectedIndex)]="selectedTab">
|
|
|
|
|
<mat-tab label="{{ 'widget-config.data' | translate }}" *ngIf="widgetType !== widgetTypes.static">
|
2019-10-10 13:00:29 +03:00
|
|
|
<div [formGroup]="dataSettings" class="mat-content mat-padding" fxLayout="column" fxLayoutGap="8px">
|
2022-09-08 18:51:13 +03:00
|
|
|
<div *ngIf="displayTimewindowConfig()" fxFlex="100"
|
2020-04-21 11:53:26 +03:00
|
|
|
fxLayout.xs="column" fxLayoutGap="8px" fxLayoutAlign.xs="center" fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<div fxLayout="column" fxLayoutGap="8px" fxFlex.gt-xs>
|
2019-10-31 18:33:51 +02:00
|
|
|
<mat-checkbox formControlName="useDashboardTimewindow">
|
2019-09-25 19:37:29 +03:00
|
|
|
{{ 'widget-config.use-dashboard-timewindow' | translate }}
|
|
|
|
|
</mat-checkbox>
|
2019-10-31 18:33:51 +02:00
|
|
|
<mat-checkbox formControlName="displayTimewindow">
|
2019-09-25 19:37:29 +03:00
|
|
|
{{ 'widget-config.display-timewindow' | translate }}
|
|
|
|
|
</mat-checkbox>
|
|
|
|
|
</div>
|
2020-04-21 11:53:26 +03:00
|
|
|
<section fxLayout="row" fxLayoutAlign="start center" fxLayout.lt-lg="column" fxLayoutAlign.lt-lg="center start"
|
|
|
|
|
fxFlex.gt-xs style="margin-bottom: 16px;">
|
|
|
|
|
<span [ngClass]="{'tb-disabled-label': dataSettings.get('useDashboardTimewindow').value}" translate
|
|
|
|
|
style="padding-right: 8px;">widget-config.timewindow</span>
|
2019-10-10 13:00:29 +03:00
|
|
|
<tb-timewindow asButton="true"
|
2020-02-25 19:11:25 +02:00
|
|
|
isEdit="true"
|
2022-09-13 14:07:56 +03:00
|
|
|
quickIntervalOnly="{{ widgetType === widgetTypes.latest }}"
|
2019-09-25 19:37:29 +03:00
|
|
|
aggregation="{{ widgetType === widgetTypes.timeseries }}"
|
2019-10-10 13:00:29 +03:00
|
|
|
fxFlex formControlName="timewindow"></tb-timewindow>
|
2019-09-25 19:37:29 +03:00
|
|
|
</section>
|
|
|
|
|
</div>
|
2020-02-21 16:31:03 +02:00
|
|
|
<div *ngIf="widgetType === widgetTypes.alarm" fxLayout="column" fxLayoutAlign="center">
|
2020-04-21 11:53:26 +03:00
|
|
|
<div fxLayout="column" fxLayoutAlign="center" fxLayout.gt-xs="row" fxLayoutAlign.gt-xs="start center"
|
|
|
|
|
fxLayoutGap="8px">
|
2020-07-06 14:42:36 +03:00
|
|
|
<mat-form-field fxFlex class="mat-block" floatLabel="always">
|
|
|
|
|
<mat-label translate>alarm.alarm-status-list</mat-label>
|
|
|
|
|
<mat-select formControlName="alarmStatusList" multiple
|
|
|
|
|
placeholder="{{ !dataSettings.get('alarmStatusList').value?.length ? ('alarm.any-status' | translate) : '' }}">
|
2020-02-21 16:31:03 +02:00
|
|
|
<mat-option *ngFor="let searchStatus of alarmSearchStatuses" [value]="searchStatus">
|
2020-07-06 14:42:36 +03:00
|
|
|
{{ alarmSearchStatusTranslationMap.get(searchStatus) | translate }}
|
2020-02-21 16:31:03 +02:00
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
2020-07-06 14:42:36 +03:00
|
|
|
<mat-form-field fxFlex class="mat-block" floatLabel="always">
|
|
|
|
|
<mat-label translate>alarm.alarm-severity-list</mat-label>
|
|
|
|
|
<mat-select formControlName="alarmSeverityList" multiple
|
|
|
|
|
placeholder="{{ !dataSettings.get('alarmSeverityList').value?.length ? ('alarm.any-severity' | translate) : '' }}">
|
|
|
|
|
<mat-option *ngFor="let alarmSeverity of alarmSeverities" [value]="alarmSeverity">
|
|
|
|
|
{{ alarmSeverityTranslationMap.get(alarmSeverityEnum[alarmSeverity]) | translate }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
2020-02-21 16:31:03 +02:00
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2020-04-21 11:53:26 +03:00
|
|
|
<div fxLayout="column" fxLayoutAlign="center" fxLayout.gt-xs="row" fxLayoutAlign.gt-xs="start center"
|
|
|
|
|
fxLayoutGap="8px">
|
2020-07-06 14:42:36 +03:00
|
|
|
<mat-form-field fxFlex class="mat-block" floatLabel="always">
|
|
|
|
|
<mat-label translate>alarm.alarm-type-list</mat-label>
|
|
|
|
|
<mat-chip-list #alarmTypeChipList formControlName="alarmTypeList">
|
|
|
|
|
<mat-chip *ngFor="let type of alarmTypeList()" [selectable]="true"
|
|
|
|
|
[removable]="true" (removed)="removeAlarmType(type)">
|
|
|
|
|
{{type}}
|
|
|
|
|
<mat-icon matChipRemove>cancel</mat-icon>
|
|
|
|
|
</mat-chip>
|
|
|
|
|
<input placeholder="{{ !dataSettings.get('alarmTypeList').value?.length ? ('alarm.any-type' | translate) : '' }}"
|
|
|
|
|
[matChipInputFor]="alarmTypeChipList"
|
|
|
|
|
[matChipInputSeparatorKeyCodes]="separatorKeysCodes"
|
2021-07-07 17:38:51 +03:00
|
|
|
matChipInputAddOnBlur
|
2020-07-06 14:42:36 +03:00
|
|
|
(matChipInputTokenEnd)="addAlarmType($event)">
|
|
|
|
|
</mat-chip-list>
|
2020-02-21 16:31:03 +02:00
|
|
|
</mat-form-field>
|
2020-07-06 14:42:36 +03:00
|
|
|
<mat-checkbox fxFlex formControlName="searchPropagatedAlarms">
|
|
|
|
|
{{ 'alarm.search-propagated-alarms' | translate }}
|
|
|
|
|
</mat-checkbox>
|
2020-02-21 16:31:03 +02:00
|
|
|
</div>
|
2019-10-10 13:00:29 +03:00
|
|
|
</div>
|
2021-10-28 13:41:37 +03:00
|
|
|
<mat-accordion multi>
|
|
|
|
|
<mat-expansion-panel class="tb-datasources" *ngIf="widgetType !== widgetTypes.rpc &&
|
|
|
|
|
widgetType !== widgetTypes.alarm &&
|
|
|
|
|
modelValue?.isDataEnabled" [expanded]="true">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title fxLayout="column">
|
|
|
|
|
<div class="tb-panel-title" translate>widget-config.datasources</div>
|
|
|
|
|
<div *ngIf="modelValue?.typeParameters && modelValue?.typeParameters.maxDatasources > -1"
|
|
|
|
|
class="tb-panel-hint">{{ 'widget-config.maximum-datasources' | translate:{count: modelValue?.typeParameters.maxDatasources} }}</div>
|
2022-03-28 13:39:26 +03:00
|
|
|
<tb-error [error]="dataError"></tb-error>
|
2021-10-28 13:41:37 +03:00
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<div *ngIf="datasourcesFormArray().length === 0; else datasourcesTemplate">
|
|
|
|
|
<span translate fxLayoutAlign="center center"
|
|
|
|
|
class="tb-prompt">datasource.add-datasource-prompt</span>
|
2019-10-10 13:00:29 +03:00
|
|
|
</div>
|
2021-10-28 13:41:37 +03:00
|
|
|
<ng-template #datasourcesTemplate>
|
|
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<span style="width: 60px;"></span>
|
|
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="start center"
|
|
|
|
|
style="padding: 0 0 0 10px; margin: 5px;">
|
|
|
|
|
<span translate style="min-width: 120px;">widget-config.datasource-type</span>
|
|
|
|
|
<span fxHide fxShow.gt-sm translate fxFlex
|
|
|
|
|
style="padding-left: 10px;">widget-config.datasource-parameters</span>
|
|
|
|
|
<span style="min-width: 40px;"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="overflow: auto; padding-bottom: 15px;">
|
2022-04-06 16:07:42 +03:00
|
|
|
<mat-list class="tb-drop-list"
|
|
|
|
|
cdkDropList
|
|
|
|
|
cdkDropListOrientation="vertical"
|
|
|
|
|
(cdkDropListDropped)="onDatasourceDrop($event)"
|
|
|
|
|
[cdkDropListDisabled]="disabled"
|
|
|
|
|
formArrayName="datasources">
|
2021-10-28 13:41:37 +03:00
|
|
|
<mat-list-item *ngFor="let datasourceControl of datasourcesFormArray().controls; let $index = index;"
|
2022-04-06 16:07:42 +03:00
|
|
|
class="tb-datasource-list-item tb-draggable" cdkDrag
|
|
|
|
|
[cdkDragDisabled]="disabled">
|
2021-10-28 13:41:37 +03:00
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<div style="width: 60px;">
|
|
|
|
|
<button *ngIf="!disabled" mat-icon-button color="primary"
|
|
|
|
|
class="handle"
|
|
|
|
|
style="min-width: 40px; margin: 0"
|
2022-04-06 16:07:42 +03:00
|
|
|
cdkDragHandle
|
2021-10-28 13:41:37 +03:00
|
|
|
matTooltip="{{ 'action.drag' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>drag_handle</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<span>{{$index + 1}}.</span>
|
|
|
|
|
</div>
|
2022-03-28 13:39:26 +03:00
|
|
|
<div class="mat-elevation-z4 tb-datasource-params" fxFlex>
|
|
|
|
|
<div fxFlex
|
|
|
|
|
fxLayout="row"
|
|
|
|
|
fxLayoutAlign="start center">
|
|
|
|
|
<section fxFlex
|
|
|
|
|
fxLayout="column"
|
|
|
|
|
fxLayoutAlign="center"
|
|
|
|
|
fxLayout.gt-sm="row"
|
|
|
|
|
fxLayoutAlign.gt-sm="start center">
|
|
|
|
|
<mat-form-field class="tb-datasource-type">
|
|
|
|
|
<mat-select [formControl]="datasourceControl.get('type')">
|
|
|
|
|
<mat-option *ngFor="let datasourceType of datasourceTypes" [value]="datasourceType">
|
|
|
|
|
{{ datasourceTypesTranslations.get(datasourceType) | translate }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<section fxLayout="column" class="tb-datasource" [ngSwitch]="datasourceControl.get('type').value">
|
|
|
|
|
<ng-template [ngSwitchCase]="datasourceType.function">
|
|
|
|
|
<mat-form-field class="tb-datasource-name" style="min-width: 200px;">
|
|
|
|
|
<mat-label translate>datasource.label</mat-label>
|
|
|
|
|
<input matInput
|
|
|
|
|
[formControl]="datasourceControl.get('name')">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</ng-template>
|
|
|
|
|
<ng-template [ngSwitchCase]="datasourceControl.get('type').value === datasourceType.entity ||
|
2021-10-28 13:41:37 +03:00
|
|
|
datasourceControl.get('type').value === datasourceType.entityCount ? datasourceControl.get('type').value : ''">
|
2022-03-28 13:39:26 +03:00
|
|
|
<tb-entity-alias-select
|
|
|
|
|
[showLabel]="true"
|
|
|
|
|
[tbRequired]="true"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[formControl]="datasourceControl.get('entityAliasId')"
|
|
|
|
|
[callbacks]="widgetConfigCallbacks">
|
|
|
|
|
</tb-entity-alias-select>
|
|
|
|
|
<tb-filter-select
|
|
|
|
|
[showLabel]="true"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[formControl]="datasourceControl.get('filterId')"
|
|
|
|
|
[callbacks]="widgetConfigCallbacks">
|
|
|
|
|
</tb-filter-select>
|
|
|
|
|
<mat-form-field *ngIf="datasourceControl.get('type').value === datasourceType.entityCount"
|
|
|
|
|
floatLabel="always"
|
|
|
|
|
class="tb-datasource-name no-border-top" style="min-width: 200px;">
|
|
|
|
|
<mat-label></mat-label>
|
|
|
|
|
<input matInput
|
|
|
|
|
placeholder="{{ 'datasource.label' | translate }}"
|
|
|
|
|
[formControl]="datasourceControl.get('name')">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</section>
|
|
|
|
|
<section fxLayout="column" fxLayoutAlign="stretch" fxFlex>
|
|
|
|
|
<tb-data-keys class="tb-data-keys" fxFlex
|
|
|
|
|
[widgetType]="widgetType"
|
|
|
|
|
[datasourceType]="datasourceControl.get('type').value"
|
|
|
|
|
[maxDataKeys]="modelValue?.typeParameters?.maxDataKeys"
|
|
|
|
|
[optDataKeys]="dataKeysOptional(datasourceControl.value)"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[datakeySettingsSchema]="modelValue?.dataKeySettingsSchema"
|
2022-03-30 11:14:54 +03:00
|
|
|
[dataKeySettingsDirective]="modelValue?.dataKeySettingsDirective"
|
|
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[widget]="widget"
|
2022-03-28 13:39:26 +03:00
|
|
|
[callbacks]="widgetConfigCallbacks"
|
|
|
|
|
[entityAliasId]="datasourceControl.get('entityAliasId').value"
|
|
|
|
|
[formControl]="datasourceControl.get('dataKeys')">
|
|
|
|
|
</tb-data-keys>
|
|
|
|
|
<tb-data-keys *ngIf="widgetType === widgetTypes.timeseries &&
|
|
|
|
|
modelValue?.typeParameters?.hasAdditionalLatestDataKeys" class="tb-data-keys" fxFlex
|
|
|
|
|
[widgetType]="widgetTypes.latest"
|
|
|
|
|
[datasourceType]="datasourceControl.get('type').value"
|
|
|
|
|
[optDataKeys]="true"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[datakeySettingsSchema]="modelValue?.latestDataKeySettingsSchema"
|
2022-03-30 11:14:54 +03:00
|
|
|
[dataKeySettingsDirective]="modelValue?.latestDataKeySettingsDirective"
|
|
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[widget]="widget"
|
2022-03-28 13:39:26 +03:00
|
|
|
[callbacks]="widgetConfigCallbacks"
|
|
|
|
|
[entityAliasId]="datasourceControl.get('entityAliasId').value"
|
|
|
|
|
[formControl]="datasourceControl.get('latestDataKeys')">
|
|
|
|
|
</tb-data-keys>
|
|
|
|
|
</section>
|
2021-10-28 13:41:37 +03:00
|
|
|
</section>
|
2022-03-28 13:39:26 +03:00
|
|
|
<button [disabled]="isLoading$ | async"
|
|
|
|
|
type="button"
|
|
|
|
|
mat-icon-button color="primary"
|
|
|
|
|
style="min-width: 40px;"
|
|
|
|
|
(click)="removeDatasource($index)"
|
|
|
|
|
matTooltip="{{ 'widget-config.remove-datasource' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<tb-error class="tb-datasource-error" [error]="datasourceError[$index] ? datasourceError[$index] : ''"></tb-error>
|
2021-10-28 13:41:37 +03:00
|
|
|
</div>
|
2021-03-02 12:04:45 +02:00
|
|
|
</div>
|
2021-10-28 13:41:37 +03:00
|
|
|
</mat-list-item>
|
|
|
|
|
</mat-list>
|
2022-03-28 13:39:26 +03:00
|
|
|
|
2021-10-28 13:41:37 +03:00
|
|
|
</div>
|
|
|
|
|
</ng-template>
|
|
|
|
|
<div fxFlex fxLayout="row" fxLayoutAlign="start center">
|
|
|
|
|
<button [disabled]="isLoading$ | async"
|
|
|
|
|
type="button"
|
|
|
|
|
mat-raised-button color="primary"
|
|
|
|
|
[fxShow]="modelValue?.typeParameters &&
|
|
|
|
|
(modelValue?.typeParameters.maxDatasources == -1 || datasourcesFormArray().controls.length < modelValue?.typeParameters.maxDatasources)"
|
|
|
|
|
(click)="addDatasource()"
|
|
|
|
|
matTooltip="{{ 'widget-config.add-datasource' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>add</mat-icon>
|
|
|
|
|
<span translate>action.add</span>
|
|
|
|
|
</button>
|
2019-10-10 13:00:29 +03:00
|
|
|
</div>
|
2021-10-28 13:41:37 +03:00
|
|
|
</mat-expansion-panel>
|
|
|
|
|
<mat-expansion-panel class="tb-datasources" *ngIf="widgetType === widgetTypes.rpc &&
|
|
|
|
|
modelValue?.isDataEnabled" [expanded]="true">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
{{ 'widget-config.target-device' | translate }}
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<div [formGroup]="targetDeviceSettings" style="padding: 0 5px;">
|
|
|
|
|
<tb-entity-alias-select fxFlex
|
|
|
|
|
[tbRequired]="!widgetEditMode"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[allowedEntityTypes]="[entityTypes.DEVICE]"
|
|
|
|
|
[callbacks]="widgetConfigCallbacks"
|
|
|
|
|
formControlName="targetDeviceAliasId">
|
|
|
|
|
</tb-entity-alias-select>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-expansion-panel>
|
|
|
|
|
<mat-expansion-panel class="tb-datasources" *ngIf="widgetType === widgetTypes.alarm &&
|
|
|
|
|
modelValue?.isDataEnabled" [expanded]="true">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
{{ 'widget-config.alarm-source' | translate }}
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<div [formGroup]="alarmSourceSettings" style="padding: 0 5px;">
|
|
|
|
|
<section fxFlex
|
|
|
|
|
fxLayout="column"
|
|
|
|
|
fxLayoutAlign="center"
|
|
|
|
|
fxLayout.gt-sm="row"
|
|
|
|
|
fxLayoutAlign.gt-sm="start center">
|
|
|
|
|
<mat-form-field class="tb-datasource-type">
|
|
|
|
|
<mat-select formControlName="type">
|
|
|
|
|
<mat-option *ngFor="let datasourceType of datasourceTypes" [value]="datasourceType">
|
|
|
|
|
{{ datasourceTypesTranslations.get(datasourceType) | translate }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<section class="tb-datasource" [ngSwitch]="alarmSourceSettings.get('type').value">
|
|
|
|
|
<ng-template [ngSwitchCase]="datasourceType.entity">
|
|
|
|
|
<tb-entity-alias-select
|
|
|
|
|
[showLabel]="true"
|
|
|
|
|
[tbRequired]="alarmSourceSettings.get('type').value === datasourceType.entity"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
formControlName="entityAliasId"
|
|
|
|
|
[callbacks]="widgetConfigCallbacks">
|
|
|
|
|
</tb-entity-alias-select>
|
|
|
|
|
<tb-filter-select
|
|
|
|
|
[showLabel]="true"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
formControlName="filterId"
|
|
|
|
|
[callbacks]="widgetConfigCallbacks">
|
|
|
|
|
</tb-filter-select>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</section>
|
|
|
|
|
<tb-data-keys class="tb-data-keys" fxFlex
|
|
|
|
|
[widgetType]="widgetType"
|
|
|
|
|
[datasourceType]="alarmSourceSettings.get('type').value"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[datakeySettingsSchema]="modelValue?.dataKeySettingsSchema"
|
2022-03-19 10:08:53 +02:00
|
|
|
[dataKeySettingsDirective]="modelValue?.dataKeySettingsDirective"
|
2022-03-22 17:13:21 +02:00
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[widget]="widget"
|
2021-10-28 13:41:37 +03:00
|
|
|
[callbacks]="widgetConfigCallbacks"
|
|
|
|
|
[entityAliasId]="alarmSourceSettings.get('entityAliasId').value"
|
|
|
|
|
formControlName="dataKeys">
|
|
|
|
|
</tb-data-keys>
|
2019-10-24 19:52:19 +03:00
|
|
|
</section>
|
2021-10-28 11:21:03 +03:00
|
|
|
</div>
|
2021-10-28 13:41:37 +03:00
|
|
|
</mat-expansion-panel>
|
|
|
|
|
<mat-expansion-panel [formGroup]="widgetSettings">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title translate>widget-config.data-settings</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<ng-template matExpansionPanelContent>
|
2022-05-16 16:35:07 +03:00
|
|
|
<div fxLayout="row" *ngIf="widgetType !== widgetTypes.rpc &&
|
|
|
|
|
widgetType !== widgetTypes.alarm &&
|
|
|
|
|
modelValue?.isDataEnabled && !modelValue?.typeParameters?.singleEntity">
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.data-page-size</mat-label>
|
|
|
|
|
<input matInput formControlName="pageSize" type="number" min="1" step="1">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2021-11-22 17:02:16 +02:00
|
|
|
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px">
|
2021-10-28 13:41:37 +03:00
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.units</mat-label>
|
|
|
|
|
<input matInput formControlName="units">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.decimals</mat-label>
|
|
|
|
|
<input matInput formControlName="decimals" type="number" min="0" max="15" step="1">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2021-10-13 12:14:18 +03:00
|
|
|
<div fxLayout="row">
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.no-data-display-message</mat-label>
|
|
|
|
|
<input matInput formControlName="noDataDisplayMessage">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2021-10-28 13:41:37 +03:00
|
|
|
</ng-template>
|
|
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</mat-accordion>
|
2021-10-28 11:21:03 +03:00
|
|
|
</div>
|
2019-10-24 19:52:19 +03:00
|
|
|
</mat-tab>
|
|
|
|
|
<mat-tab label="{{ 'widget-config.settings' | translate }}">
|
2021-10-27 13:33:51 +03:00
|
|
|
<div class="mat-content mat-padding" fxLayout="column">
|
|
|
|
|
<div [formGroup]="widgetSettings" fxLayout="column">
|
2021-11-22 17:02:16 +02:00
|
|
|
<fieldset class="fields-group">
|
2021-10-27 13:33:51 +03:00
|
|
|
<legend class="group-title" translate>widget-config.title</legend>
|
2021-11-22 17:02:16 +02:00
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showTitle">
|
2021-10-27 13:33:51 +03:00
|
|
|
{{ 'widget-config.display-title' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
2021-11-22 17:02:16 +02:00
|
|
|
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px">
|
2021-10-27 13:33:51 +03:00
|
|
|
<mat-form-field fxFlex>
|
2020-04-21 11:53:26 +03:00
|
|
|
<mat-label translate>widget-config.title</mat-label>
|
|
|
|
|
<input matInput formControlName="title">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.title-tooltip</mat-label>
|
|
|
|
|
<input matInput formControlName="titleTooltip">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2021-11-22 17:02:16 +02:00
|
|
|
<fieldset class="fields-group" fxLayoutGap="8px" style="margin: 0">
|
2021-10-27 13:33:51 +03:00
|
|
|
<legend class="group-title" translate>widget-config.title-icon</legend>
|
2021-11-22 17:02:16 +02:00
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showTitleIcon">
|
2019-10-24 19:52:19 +03:00
|
|
|
{{ 'widget-config.display-icon' | translate }}
|
2021-10-27 13:33:51 +03:00
|
|
|
</mat-slide-toggle>
|
2021-11-22 17:02:16 +02:00
|
|
|
<div fxLayout.xs="column" fxLayout="row wrap" fxLayoutGap="8px">
|
2021-10-27 13:33:51 +03:00
|
|
|
<tb-material-icon-select fxFlex
|
|
|
|
|
formControlName="titleIcon">
|
|
|
|
|
</tb-material-icon-select>
|
|
|
|
|
<tb-color-input fxFlex
|
|
|
|
|
label="{{'widget-config.icon-color' | translate}}"
|
|
|
|
|
icon="format_color_fill"
|
|
|
|
|
openOnInput
|
|
|
|
|
formControlName="iconColor">
|
|
|
|
|
</tb-color-input>
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.icon-size</mat-label>
|
|
|
|
|
<input matInput formControlName="iconSize">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
2021-10-27 19:12:23 +03:00
|
|
|
<mat-expansion-panel class="tb-settings">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-description fxLayoutAlign="end" translate>
|
|
|
|
|
widget-config.advanced-settings
|
|
|
|
|
</mat-panel-description>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<ng-template matExpansionPanelContent>
|
|
|
|
|
<tb-json-object-edit
|
|
|
|
|
[editorStyle]="{minHeight: '100px'}"
|
|
|
|
|
required
|
|
|
|
|
label="{{ 'widget-config.title-style' | translate }}"
|
|
|
|
|
formControlName="titleStyle"
|
|
|
|
|
></tb-json-object-edit>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</mat-expansion-panel>
|
2021-10-27 13:33:51 +03:00
|
|
|
</fieldset>
|
2021-11-22 17:02:16 +02:00
|
|
|
<fieldset class="fields-group">
|
2021-10-27 13:33:51 +03:00
|
|
|
<legend class="group-title" translate>widget-config.widget-style</legend>
|
2021-11-22 17:02:16 +02:00
|
|
|
<div fxLayout="column" fxLayout.gt-md="row wrap" fxFlex fxLayoutGap="8px" class="tb-widget-style">
|
|
|
|
|
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px" fxFlex>
|
2021-10-27 13:33:51 +03:00
|
|
|
<tb-color-input fxFlex
|
|
|
|
|
label="{{'widget-config.background-color' | translate}}"
|
|
|
|
|
icon="format_color_fill"
|
|
|
|
|
openOnInput
|
|
|
|
|
formControlName="backgroundColor">
|
|
|
|
|
</tb-color-input>
|
|
|
|
|
<tb-color-input fxFlex
|
|
|
|
|
label="{{'widget-config.text-color' | translate}}"
|
|
|
|
|
icon="format_color_fill"
|
|
|
|
|
openOnInput
|
|
|
|
|
formControlName="color">
|
|
|
|
|
</tb-color-input>
|
|
|
|
|
</div>
|
2021-11-22 17:02:16 +02:00
|
|
|
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px" fxFlex>
|
2021-10-27 13:33:51 +03:00
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.padding</mat-label>
|
|
|
|
|
<input matInput formControlName="padding">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.margin</mat-label>
|
|
|
|
|
<input matInput formControlName="margin">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2020-04-21 11:53:26 +03:00
|
|
|
</div>
|
2021-11-22 17:02:16 +02:00
|
|
|
<mat-slide-toggle class="slide-block" formControlName="dropShadow">
|
2021-10-27 13:33:51 +03:00
|
|
|
{{ 'widget-config.drop-shadow' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
2021-11-22 17:02:16 +02:00
|
|
|
<mat-slide-toggle class="slide-block" formControlName="enableFullscreen">
|
2021-10-27 13:33:51 +03:00
|
|
|
{{ 'widget-config.enable-fullscreen' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-expansion-panel class="tb-settings">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-description fxLayoutAlign="end" translate>
|
|
|
|
|
widget-config.advanced-settings
|
|
|
|
|
</mat-panel-description>
|
|
|
|
|
</mat-expansion-panel-header>
|
2021-10-27 19:12:23 +03:00
|
|
|
<ng-template matExpansionPanelContent>
|
2021-10-27 13:33:51 +03:00
|
|
|
<tb-json-object-edit
|
|
|
|
|
[editorStyle]="{minHeight: '100px'}"
|
|
|
|
|
required
|
|
|
|
|
label="{{ 'widget-config.widget-style' | translate }}"
|
|
|
|
|
formControlName="widgetStyle"
|
|
|
|
|
></tb-json-object-edit>
|
2021-12-22 17:15:10 +02:00
|
|
|
<tb-css
|
|
|
|
|
label="{{ 'widget-config.widget-css' | translate }}"
|
|
|
|
|
formControlName="widgetCss"
|
|
|
|
|
></tb-css>
|
2021-10-27 19:12:23 +03:00
|
|
|
</ng-template>
|
2021-10-27 13:33:51 +03:00
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</fieldset>
|
2021-12-23 14:16:22 +02:00
|
|
|
<fieldset class="fields-group fields-group-slider" *ngIf="showLegendFieldset">
|
2021-10-27 13:33:51 +03:00
|
|
|
<legend class="group-title" translate>widget-config.legend</legend>
|
|
|
|
|
<mat-expansion-panel class="tb-settings">
|
|
|
|
|
<mat-expansion-panel-header fxLayout="row wrap">
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
<mat-slide-toggle formControlName="showLegend" (click)="$event.stopPropagation()" fxLayoutAlign="center">
|
|
|
|
|
{{ 'widget-config.display-legend' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
<mat-panel-description fxLayoutAlign="end center" fxHide.xs translate>
|
|
|
|
|
widget-config.advanced-settings
|
|
|
|
|
</mat-panel-description>
|
|
|
|
|
</mat-expansion-panel-header>
|
2021-10-27 19:12:23 +03:00
|
|
|
<ng-template matExpansionPanelContent>
|
|
|
|
|
<tb-legend-config formControlName="legendConfig"></tb-legend-config>
|
|
|
|
|
</ng-template>
|
2021-10-27 13:33:51 +03:00
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</fieldset>
|
2021-11-22 17:02:16 +02:00
|
|
|
<fieldset [formGroup]="layoutSettings" class="fields-group fields-group-slider">
|
2021-10-27 13:33:51 +03:00
|
|
|
<legend class="group-title" translate>widget-config.mobile-mode-settings</legend>
|
|
|
|
|
<mat-expansion-panel class="tb-settings">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
<mat-slide-toggle formControlName="mobileHide" (click)="$event.stopPropagation()" fxLayoutAlign="center">
|
|
|
|
|
{{ 'widget-config.mobile-hide' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
<mat-panel-description fxLayoutAlign="end center" fxHide.xs translate>
|
|
|
|
|
widget-config.advanced-settings
|
|
|
|
|
</mat-panel-description>
|
|
|
|
|
</mat-expansion-panel-header>
|
2021-10-27 19:12:23 +03:00
|
|
|
<ng-template matExpansionPanelContent>
|
2021-11-22 17:02:16 +02:00
|
|
|
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px" fxFlex>
|
2021-10-27 19:12:23 +03:00
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.order</mat-label>
|
|
|
|
|
<input matInput formControlName="mobileOrder" type="number" step="1">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field fxFlex>
|
|
|
|
|
<mat-label translate>widget-config.height</mat-label>
|
|
|
|
|
<input matInput formControlName="mobileHeight" type="number" min="1" max="10" step="1">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
</ng-template>
|
2021-10-27 13:33:51 +03:00
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</fieldset>
|
2019-10-24 19:52:19 +03:00
|
|
|
</div>
|
2019-09-25 19:37:29 +03:00
|
|
|
</div>
|
|
|
|
|
</mat-tab>
|
2019-10-21 19:57:18 +03:00
|
|
|
<mat-tab *ngIf="displayAdvanced()" label="{{ 'widget-config.advanced' | translate }}">
|
|
|
|
|
<div [formGroup]="advancedSettings" class="mat-content mat-padding tb-advanced-widget-config"
|
|
|
|
|
fxLayout="column">
|
2022-03-19 10:08:53 +02:00
|
|
|
<tb-widget-settings
|
2022-04-09 15:13:47 +03:00
|
|
|
[aliasController]="aliasController"
|
2022-03-22 17:13:21 +02:00
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[widget]="widget"
|
2019-10-21 19:57:18 +03:00
|
|
|
formControlName="settings">
|
2022-03-19 10:08:53 +02:00
|
|
|
</tb-widget-settings>
|
2019-10-21 19:57:18 +03:00
|
|
|
</div>
|
|
|
|
|
</mat-tab>
|
2019-10-24 19:52:19 +03:00
|
|
|
<mat-tab label="{{ 'widget-config.actions' | translate }}" [formGroup]="actionsSettings">
|
|
|
|
|
<tb-manage-widget-actions
|
|
|
|
|
[callbacks]="widgetConfigCallbacks"
|
2021-05-20 13:25:34 +03:00
|
|
|
[widgetType] = "modelValue.widgetType"
|
2019-10-24 19:52:19 +03:00
|
|
|
formControlName="actionsData">
|
|
|
|
|
</tb-manage-widget-actions>
|
2019-09-25 19:37:29 +03:00
|
|
|
</mat-tab>
|
|
|
|
|
</mat-tab-group>
|