2019-09-25 19:37:29 +03:00
|
|
|
<!--
|
|
|
|
|
|
2024-01-09 10:46:16 +02:00
|
|
|
Copyright © 2016-2024 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.
|
|
|
|
|
|
|
|
|
|
-->
|
2020-04-27 10:39:18 +03:00
|
|
|
<form [formGroup]="widgetFormGroup">
|
2019-09-25 19:37:29 +03:00
|
|
|
<fieldset [disabled]="isLoading$ | async">
|
|
|
|
|
<tb-widget-config
|
2023-08-17 18:50:32 +03:00
|
|
|
#widgetConfigComponent
|
2019-09-25 19:37:29 +03:00
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[functionsOnly]="widgetEditMode"
|
2022-03-22 17:13:21 +02:00
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[widget]="widget"
|
2023-05-25 17:03:52 +03:00
|
|
|
[hideToggleHeader]="previewMode"
|
2019-09-25 19:37:29 +03:00
|
|
|
formControlName="widgetConfig">
|
2023-05-25 17:03:52 +03:00
|
|
|
<div class="tb-widget-config-header-prefix">
|
|
|
|
|
<button mat-button
|
|
|
|
|
*ngIf="previewMode"
|
|
|
|
|
(click)="previewMode = false">
|
|
|
|
|
<mat-icon>chevron_left</mat-icon>
|
|
|
|
|
{{ 'action.back' | translate }}
|
|
|
|
|
</button>
|
2023-08-01 19:58:59 +03:00
|
|
|
<button *ngIf="!previewMode"
|
|
|
|
|
fxHide.gt-sm
|
2023-11-08 17:01:47 +02:00
|
|
|
[disabled]="!widgetFormGroup.valid"
|
2023-08-01 19:58:59 +03:00
|
|
|
mat-button color="primary"
|
|
|
|
|
(click)="previewMode = true">
|
2023-05-16 20:00:53 +03:00
|
|
|
<mat-icon>visibility</mat-icon>
|
|
|
|
|
{{ 'widget-config.preview' | translate }}
|
|
|
|
|
</button>
|
2023-08-01 19:58:59 +03:00
|
|
|
</div>
|
|
|
|
|
<div fxFlex.lt-md class="tb-widget-config-header-suffix" fxLayout="row" fxLayoutAlign="end center" fxLayoutGap="12px">
|
|
|
|
|
<button *ngIf="!previewMode"
|
|
|
|
|
fxHide.lt-md
|
2023-11-08 17:01:47 +02:00
|
|
|
[disabled]="!widgetFormGroup.valid"
|
2023-08-01 19:58:59 +03:00
|
|
|
mat-button color="primary"
|
|
|
|
|
(click)="previewMode = true">
|
|
|
|
|
<mat-icon>visibility</mat-icon>
|
|
|
|
|
{{ 'widget-config.preview' | translate }}
|
2023-05-16 20:00:53 +03:00
|
|
|
</button>
|
2023-08-01 19:58:59 +03:00
|
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="12px">
|
|
|
|
|
<button [disabled]="!widgetFormGroup.dirty"
|
|
|
|
|
mat-stroked-button color="primary"
|
|
|
|
|
(click)="onRevertWidgetConfig()">
|
|
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
|
{{ 'action.decline' | translate }}
|
|
|
|
|
</button>
|
2023-11-08 17:01:47 +02:00
|
|
|
<button [disabled]="!widgetFormGroup.valid || !widgetFormGroup.dirty"
|
2023-08-01 19:58:59 +03:00
|
|
|
mat-flat-button color="primary"
|
|
|
|
|
(click)="onApplyWidgetConfig()">
|
|
|
|
|
<mat-icon>done</mat-icon>
|
|
|
|
|
{{ 'action.apply' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2023-05-16 20:00:53 +03:00
|
|
|
</div>
|
2019-09-25 19:37:29 +03:00
|
|
|
</tb-widget-config>
|
2023-06-30 19:59:13 +03:00
|
|
|
<div *ngIf="previewMode" class="widget-preview-background">
|
|
|
|
|
<tb-widget-preview class="widget-preview-section"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[stateController]="stateController"
|
2023-07-01 14:02:04 +03:00
|
|
|
[dashboardTimewindow]="dashboard.configuration.timewindow"
|
2023-06-30 19:59:13 +03:00
|
|
|
[widget]="widget"
|
2023-07-21 18:26:14 +03:00
|
|
|
[widgetConfig]="widgetFormGroup.get('widgetConfig').value.config"
|
|
|
|
|
[previewWidth]="widgetConfig.typeParameters.previewWidth"
|
|
|
|
|
[previewHeight]="widgetConfig.typeParameters.previewHeight">
|
2023-06-30 19:59:13 +03:00
|
|
|
</tb-widget-preview>
|
|
|
|
|
</div>
|
2019-09-25 19:37:29 +03:00
|
|
|
</fieldset>
|
|
|
|
|
</form>
|