2019-09-25 19:37:29 +03:00
|
|
|
<!--
|
|
|
|
|
|
2023-01-31 10:43:56 +02:00
|
|
|
Copyright © 2016-2023 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
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[functionsOnly]="widgetEditMode"
|
2022-03-22 17:13:21 +02:00
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[widget]="widget"
|
2019-09-25 19:37:29 +03:00
|
|
|
formControlName="widgetConfig">
|
2023-05-16 20:00:53 +03:00
|
|
|
<div class="tb-widget-config-header-suffix" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="12px">
|
|
|
|
|
<button [disabled]="(isLoading$ | async) || widgetFormGroup.invalid"
|
|
|
|
|
mat-button color="primary"
|
|
|
|
|
(click)="previewMode = true">
|
|
|
|
|
<mat-icon>visibility</mat-icon>
|
|
|
|
|
{{ 'widget-config.preview' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button [disabled]="(isLoading$ | async) || !widgetFormGroup.dirty"
|
|
|
|
|
mat-stroked-button color="primary"
|
|
|
|
|
(click)="onRevertWidgetConfig()">
|
|
|
|
|
<mat-icon>close</mat-icon>
|
|
|
|
|
{{ 'action.decline' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
<button [disabled]="(isLoading$ | async) || widgetFormGroup.invalid || !widgetFormGroup.dirty"
|
|
|
|
|
mat-flat-button color="primary"
|
|
|
|
|
(click)="onApplyWidgetConfig()">
|
|
|
|
|
<mat-icon>done</mat-icon>
|
|
|
|
|
{{ 'action.apply' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2019-09-25 19:37:29 +03:00
|
|
|
</tb-widget-config>
|
2023-05-16 20:00:53 +03:00
|
|
|
<tb-widget-preview *ngIf="previewMode" class="tb-absolute-fill"
|
|
|
|
|
[aliasController]="aliasController"
|
|
|
|
|
[stateController]="stateController"
|
|
|
|
|
[widget]="widget"
|
|
|
|
|
[widgetConfig]="widgetFormGroup.get('widgetConfig').value.config">
|
|
|
|
|
<div class="tb-preview-panel-content">
|
|
|
|
|
<button mat-button color="primary"
|
|
|
|
|
(click)="previewMode = false">
|
|
|
|
|
{{ 'action.back' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</tb-widget-preview>
|
2019-09-25 19:37:29 +03:00
|
|
|
</fieldset>
|
|
|
|
|
</form>
|