thingsboard/ui-ngx/src/app/modules/home/components/widget/config/timewindow-config-panel.component.html
2024-10-15 13:23:36 +03:00

46 lines
2.1 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 [formGroup]="timewindowConfig" class="tb-form-panel">
<div class="flex flex-row items-center justify-between">
<div class="tb-form-panel-title" translate>timewindow.timewindow</div>
<tb-toggle-select formControlName="useDashboardTimewindow" selectMediaBreakpoint="xs">
<tb-toggle-option [value]="true">{{ 'widget-config.use-dashboard-timewindow' | translate }}</tb-toggle-option>
<tb-toggle-option [value]="false">{{ 'widget-config.use-widget-timewindow' | translate }}</tb-toggle-option>
</tb-toggle-select>
</div>
<div class="tb-form-row column-xs">
<mat-slide-toggle class="mat-slide" formControlName="displayTimewindow">
{{ 'widget-config.display-timewindow' | translate }}
</mat-slide-toggle>
<div class="flex flex-1 flex-row items-center justify-between">
<tb-timewindow asButton="true"
strokedButton
noMargin
isEdit="true"
alwaysDisplayTypePrefix
[historyOnly]="onlyHistoryTimewindow"
quickIntervalOnly="{{ widgetType === widgetTypes.latest }}"
aggregation="{{ widgetType === widgetTypes.timeseries }}"
formControlName="timewindow"></tb-timewindow>
<tb-timewindow-style formControlName="timewindowStyle"
[previewValue]="timewindowConfig.get('timewindow').value">
</tb-timewindow-style>
</div>
</div>
</div>