2019-10-31 10:06:57 +02:00
|
|
|
<!--
|
|
|
|
|
|
2025-02-25 09:39:16 +02:00
|
|
|
Copyright © 2016-2025 The Thingsboard Authors
|
2019-10-31 10:06:57 +02: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-04 19:08:01 +03:00
|
|
|
<form (ngSubmit)="save()" style="width: 750px;">
|
2020-04-21 11:53:26 +03:00
|
|
|
<mat-toolbar color="primary">
|
2019-10-31 10:06:57 +02:00
|
|
|
<h2 translate>{{settings ? 'dashboard.settings' : 'layout.settings'}}</h2>
|
2024-10-10 15:09:59 +03:00
|
|
|
<span class="flex-1"></span>
|
2023-02-17 19:24:01 +02:00
|
|
|
<button mat-icon-button
|
2019-10-31 10:06:57 +02:00
|
|
|
(click)="cancel()"
|
|
|
|
|
type="button">
|
|
|
|
|
<mat-icon class="material-icons">close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</mat-toolbar>
|
|
|
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
|
|
|
|
|
</mat-progress-bar>
|
2024-06-11 18:44:50 +03:00
|
|
|
<div mat-dialog-content class="tb-form-panel no-border no-padding">
|
|
|
|
|
<div *ngIf="settings" class="tb-form-panel no-border no-padding" [formGroup]="settingsFormGroup">
|
|
|
|
|
<div class="tb-form-row space-between">
|
|
|
|
|
<div>{{ 'dashboard.state-controller' | translate }}</div>
|
|
|
|
|
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic">
|
2020-04-21 11:53:26 +03:00
|
|
|
<mat-select required formControlName="stateControllerId">
|
2019-10-31 10:06:57 +02:00
|
|
|
<mat-option *ngFor="let stateControllerId of stateControllerIds" [value]="stateControllerId">
|
2023-12-19 16:08:05 +02:00
|
|
|
{{ getStatesControllerTranslation(stateControllerId) }}
|
2019-10-31 10:06:57 +02:00
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-panel stroked">
|
|
|
|
|
<div class="tb-form-panel-title" translate>dashboard.title-settings</div>
|
|
|
|
|
<div class="tb-form-row space-between">
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showTitle">
|
|
|
|
|
{{ 'dashboard.title' | translate }}
|
2021-06-04 19:08:01 +03:00
|
|
|
</mat-slide-toggle>
|
2024-06-11 18:44:50 +03:00
|
|
|
<tb-color-input asBoxInput
|
|
|
|
|
colorClearButton
|
2019-10-31 10:06:57 +02:00
|
|
|
formControlName="titleColor">
|
|
|
|
|
</tb-color-input>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-panel stroked">
|
|
|
|
|
<div class="tb-form-panel-title" translate>dashboard.dashboard-logo-settings</div>
|
|
|
|
|
<div class="tb-form-row">
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showDashboardLogo">
|
2021-06-04 19:08:01 +03:00
|
|
|
{{ 'dashboard.display-dashboard-logo' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-10-10 15:09:59 +03:00
|
|
|
<tb-gallery-image-input class="flex-1"
|
2024-06-11 18:44:50 +03:00
|
|
|
label="{{'dashboard.dashboard-logo-image' | translate}}"
|
|
|
|
|
formControlName="dashboardLogoUrl">
|
|
|
|
|
</tb-gallery-image-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-panel stroked">
|
|
|
|
|
<div class="tb-form-panel-title" translate>dashboard.toolbar-settings</div>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="hideToolbar">
|
|
|
|
|
{{ 'dashboard.hide-toolbar' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="toolbarAlwaysOpen">
|
|
|
|
|
{{ 'dashboard.toolbar-always-open' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showDashboardsSelect">
|
|
|
|
|
{{ 'dashboard.display-dashboards-selection' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showEntitiesSelect">
|
|
|
|
|
{{ 'dashboard.display-entities-selection' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showFilters">
|
|
|
|
|
{{ 'dashboard.display-filters' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showDashboardTimewindow">
|
|
|
|
|
{{ 'dashboard.display-dashboard-timewindow' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showDashboardExport">
|
|
|
|
|
{{ 'dashboard.display-dashboard-export' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="showUpdateDashboardImage">
|
|
|
|
|
{{ 'dashboard.display-update-dashboard-image' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
</div>
|
|
|
|
|
<mat-expansion-panel class="tb-settings">
|
|
|
|
|
<mat-expansion-panel-header>
|
2024-10-15 13:23:36 +03:00
|
|
|
<mat-panel-description class="flex items-stretch justify-end" translate>
|
2024-06-11 18:44:50 +03:00
|
|
|
dashboard.advanced-settings
|
|
|
|
|
</mat-panel-description>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<ng-template matExpansionPanelContent>
|
|
|
|
|
<tb-css
|
|
|
|
|
label="{{ 'dashboard.dashboard-css' | translate }}"
|
|
|
|
|
formControlName="dashboardCss"
|
|
|
|
|
></tb-css>
|
|
|
|
|
</ng-template>
|
|
|
|
|
</mat-expansion-panel>
|
|
|
|
|
</div>
|
|
|
|
|
<div *ngIf="gridSettings" class="tb-form-panel no-border no-padding" [formGroup]="gridSettingsFormGroup">
|
|
|
|
|
<div class="tb-form-panel stroked">
|
2024-08-16 13:42:55 +03:00
|
|
|
<div class="tb-form-panel-title" translate [translateParams]="{type: layoutSettingsType}">dashboard.layout-settings-type</div>
|
|
|
|
|
<div *ngIf="isDefaultLayout && !isDefaultBreakpoint" class="tb-form-row space-between">
|
|
|
|
|
<div class="fixed-title-width" translate>dashboard.view-format</div>
|
|
|
|
|
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic">
|
|
|
|
|
<mat-select formControlName="viewFormat">
|
|
|
|
|
<mat-option *ngFor="let type of viewFormatTypes" [value]="type">
|
|
|
|
|
{{ viewFormatTypeTranslationMap.get(type) | translate }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2024-06-11 18:44:50 +03:00
|
|
|
<div class="tb-form-row space-between">
|
|
|
|
|
<div translate>dashboard.columns-count</div>
|
2024-09-06 17:42:46 +03:00
|
|
|
<mat-form-field *ngIf="!isScada()" appearance="outline" class="number medium-width tb-suffix-absolute" subscriptSizing="dynamic"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
matTooltipClass="tb-error-tooltip"
|
|
|
|
|
[matTooltipDisabled]="!(gridSettingsFormGroup.get('columns').invalid && gridSettingsFormGroup.get('columns').touched)"
|
|
|
|
|
[matTooltip]="(gridSettingsFormGroup.get('columns').hasError('required') ? 'dashboard.columns-count-required' :
|
|
|
|
|
(gridSettingsFormGroup.get('columns').hasError('min') ? 'dashboard.min-columns-count-message' : 'dashboard.max-columns-count-message')) | translate">
|
2024-06-14 17:59:28 +03:00
|
|
|
<input matInput formControlName="columns" type="number" min="10" max="1008" step="1"
|
2024-06-11 18:44:50 +03:00
|
|
|
required
|
|
|
|
|
placeholder="{{ 'widget-config.set' | translate }}">
|
2021-06-04 19:08:01 +03:00
|
|
|
</mat-form-field>
|
2024-06-21 12:31:40 +03:00
|
|
|
<mat-form-field *ngIf="isScada()"
|
2024-06-14 17:59:28 +03:00
|
|
|
class="medium-width" appearance="outline" subscriptSizing="dynamic">
|
|
|
|
|
<mat-select required formControlName="columns">
|
|
|
|
|
<mat-option *ngFor="let columns of scadaColumns" [value]="columns">
|
|
|
|
|
{{ columns }}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-row space-between">
|
|
|
|
|
<div translate>dashboard.min-layout-width</div>
|
2024-09-06 17:42:46 +03:00
|
|
|
<mat-form-field appearance="outline" class="number medium-width" subscriptSizing="dynamic"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
matTooltipClass="tb-error-tooltip"
|
|
|
|
|
[matTooltipDisabled]="!(gridSettingsFormGroup.get('minColumns').invalid && gridSettingsFormGroup.get('minColumns').touched)"
|
|
|
|
|
[matTooltip]="(gridSettingsFormGroup.get('minColumns').hasError('required') ? 'dashboard.columns-count-required' :
|
|
|
|
|
(gridSettingsFormGroup.get('minColumns').hasError('min') ? 'dashboard.min-columns-count-message' : 'dashboard.max-columns-count-message')) | translate">
|
2024-06-14 17:59:28 +03:00
|
|
|
<input matInput formControlName="minColumns" type="number" min="10" max="1008" step="1"
|
|
|
|
|
required
|
|
|
|
|
placeholder="{{ 'widget-config.set' | translate }}">
|
|
|
|
|
<span translate matSuffix>dashboard.columns-suffix</span>
|
|
|
|
|
</mat-form-field>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-06-21 12:31:40 +03:00
|
|
|
<div *ngIf="!isScada()" class="tb-form-row space-between">
|
2024-06-11 18:44:50 +03:00
|
|
|
<div translate>dashboard.widgets-margins</div>
|
2024-09-06 17:42:46 +03:00
|
|
|
<mat-form-field appearance="outline" class="number medium-width tb-suffix-absolute" subscriptSizing="dynamic"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
matTooltipClass="tb-error-tooltip"
|
|
|
|
|
[matTooltipDisabled]="!(gridSettingsFormGroup.get('margin').invalid && gridSettingsFormGroup.get('margin').touched)"
|
|
|
|
|
[matTooltip]="(gridSettingsFormGroup.get('margin').hasError('required') ? 'dashboard.margin-required' :
|
|
|
|
|
(gridSettingsFormGroup.get('margin').hasError('min') ? 'dashboard.min-margin-message' : 'dashboard.max-margin-message')) | translate">
|
2024-06-11 18:44:50 +03:00
|
|
|
<input matInput formControlName="margin" type="number" min="0" max="50" step="any"
|
|
|
|
|
required
|
|
|
|
|
placeholder="{{ 'widget-config.set' | translate }}">
|
2021-06-04 19:08:01 +03:00
|
|
|
</mat-form-field>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-06-21 12:31:40 +03:00
|
|
|
<div *ngIf="!isScada()" class="tb-form-row">
|
2024-06-11 18:44:50 +03:00
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="outerMargin">
|
2023-04-13 12:59:01 +03:00
|
|
|
{{ 'dashboard.apply-outer-margin' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-06-21 12:31:40 +03:00
|
|
|
<div *ngIf="!isScada()" class="tb-form-row">
|
2024-06-11 18:44:50 +03:00
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="autoFillHeight">
|
2021-06-04 19:08:01 +03:00
|
|
|
{{ 'dashboard.autofill-height' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-08-16 13:42:55 +03:00
|
|
|
<div *ngIf="isDefaultLayout && !isDefaultBreakpoint" class="tb-form-row space-between">
|
|
|
|
|
<div translate>dashboard.row-height</div>
|
2024-09-06 17:42:46 +03:00
|
|
|
<mat-form-field appearance="outline" class="number medium-width" subscriptSizing="dynamic"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
matTooltipClass="tb-error-tooltip"
|
|
|
|
|
[matTooltipDisabled]="!(gridSettingsFormGroup.get('rowHeight').invalid && gridSettingsFormGroup.get('rowHeight').touched)"
|
|
|
|
|
[matTooltip]="(gridSettingsFormGroup.get('rowHeight').hasError('required') ? 'dashboard.row-height-required' :
|
|
|
|
|
(gridSettingsFormGroup.get('rowHeight').hasError('min') ?
|
|
|
|
|
'dashboard.min-row-height-message' : 'dashboard.max-row-height-message')) | translate">
|
2024-08-16 13:42:55 +03:00
|
|
|
<input matInput formControlName="rowHeight" type="number" min="5" max="200" step="any"
|
|
|
|
|
required
|
|
|
|
|
placeholder="{{ 'widget-config.set' | translate }}">
|
|
|
|
|
<span matSuffix>px</span>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2024-06-11 18:44:50 +03:00
|
|
|
<div class="tb-form-row space-between">
|
|
|
|
|
<div translate>dashboard.background-color</div>
|
|
|
|
|
<tb-color-input asBoxInput
|
|
|
|
|
colorClearButton
|
2021-06-04 19:08:01 +03:00
|
|
|
formControlName="backgroundColor">
|
|
|
|
|
</tb-color-input>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-10-10 15:09:59 +03:00
|
|
|
<tb-gallery-image-input class="flex-1"
|
2024-06-11 18:44:50 +03:00
|
|
|
label="{{'dashboard.background-image' | translate}}"
|
|
|
|
|
formControlName="backgroundImageUrl">
|
|
|
|
|
</tb-gallery-image-input>
|
|
|
|
|
<div class="tb-form-row space-between">
|
|
|
|
|
<div>{{ 'dashboard.background-size-mode' | translate }}</div>
|
|
|
|
|
<mat-form-field class="medium-width" appearance="outline" subscriptSizing="dynamic">
|
2021-06-04 19:08:01 +03:00
|
|
|
<mat-select formControlName="backgroundSizeMode">
|
|
|
|
|
<mat-option value="100%">Fit width</mat-option>
|
|
|
|
|
<mat-option value="auto 100%">Fit height</mat-option>
|
|
|
|
|
<mat-option value="cover">Cover</mat-option>
|
|
|
|
|
<mat-option value="contain">Contain</mat-option>
|
|
|
|
|
<mat-option value="auto">Original size</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-08-16 13:42:55 +03:00
|
|
|
<div *ngIf="!isScada() && isDefaultBreakpoint" class="tb-form-panel stroked">
|
2024-06-11 18:44:50 +03:00
|
|
|
<div class="tb-form-panel-title" translate>dashboard.mobile-layout</div>
|
|
|
|
|
<div *ngIf="isRightLayout" class="tb-form-row">
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="mobileDisplayLayoutFirst">
|
2023-11-13 17:50:13 +02:00
|
|
|
{{ 'dashboard.display-first-in-mobile-view' | translate }}
|
2021-06-04 19:08:01 +03:00
|
|
|
</mat-slide-toggle>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2024-06-21 12:31:40 +03:00
|
|
|
<div *ngIf="!isScada()" class="tb-form-row">
|
2024-06-11 18:44:50 +03:00
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="mobileAutoFillHeight">
|
|
|
|
|
{{ 'dashboard.autofill-height' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
|
|
|
|
</div>
|
2024-06-21 12:31:40 +03:00
|
|
|
<div *ngIf="!isScada()" class="tb-form-row space-between">
|
2024-06-11 18:44:50 +03:00
|
|
|
<div translate>dashboard.mobile-row-height</div>
|
2024-09-06 17:42:46 +03:00
|
|
|
<mat-form-field appearance="outline" class="number medium-width" subscriptSizing="dynamic"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
matTooltipClass="tb-error-tooltip"
|
|
|
|
|
[matTooltipDisabled]="!(gridSettingsFormGroup.get('mobileRowHeight').invalid && gridSettingsFormGroup.get('mobileRowHeight').touched)"
|
|
|
|
|
[matTooltip]="(gridSettingsFormGroup.get('mobileRowHeight').hasError('required') ? 'dashboard.mobile-row-height-required' :
|
|
|
|
|
(gridSettingsFormGroup.get('mobileRowHeight').hasError('min') ?
|
|
|
|
|
'dashboard.min-mobile-row-height-message' : 'dashboard.max-mobile-row-height-message')) | translate">
|
2024-06-11 18:44:50 +03:00
|
|
|
<input matInput formControlName="mobileRowHeight" type="number" min="5" max="200" step="any"
|
|
|
|
|
required
|
|
|
|
|
placeholder="{{ 'widget-config.set' | translate }}">
|
|
|
|
|
<span matSuffix>px</span>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
2024-06-11 18:44:50 +03:00
|
|
|
</div>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
2024-10-15 13:23:36 +03:00
|
|
|
<div mat-dialog-actions class="flex items-center justify-end">
|
2019-10-31 10:06:57 +02:00
|
|
|
<button mat-button color="primary"
|
|
|
|
|
type="button"
|
|
|
|
|
[disabled]="(isLoading$ | async)"
|
|
|
|
|
(click)="cancel()" cdkFocusInitial>
|
|
|
|
|
{{ 'action.cancel' | translate }}
|
|
|
|
|
</button>
|
2020-10-14 12:32:07 +03:00
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
type="submit"
|
|
|
|
|
[disabled]="(isLoading$ | async) || settingsFormGroup.invalid || gridSettingsFormGroup.invalid
|
|
|
|
|
|| (!settingsFormGroup.dirty && !gridSettingsFormGroup.dirty)">
|
|
|
|
|
{{ 'action.save' | translate }}
|
|
|
|
|
</button>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
|
|
|
|
</form>
|