2019-09-19 20:10:52 +03:00
|
|
|
<!--
|
|
|
|
|
|
2024-01-09 10:46:16 +02:00
|
|
|
Copyright © 2016-2024 The Thingsboard Authors
|
2019-09-19 20:10:52 +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.
|
|
|
|
|
|
|
|
|
|
-->
|
2023-11-07 12:34:22 +02:00
|
|
|
<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" tb-toast
|
2022-11-18 17:03:39 +02:00
|
|
|
fxFlex tb-fullscreen [fullscreenElement]="elRef.nativeElement" [fullscreen]="widgetEditMode || iframeMode || forceFullscreen || isFullscreen">
|
2020-01-20 15:14:08 +02:00
|
|
|
<tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet>
|
2019-09-19 20:10:52 +03:00
|
|
|
<section class="tb-dashboard-toolbar"
|
2019-10-10 13:00:29 +03:00
|
|
|
[ngClass]="{ 'tb-dashboard-toolbar-opened': toolbarOpened,
|
|
|
|
|
'tb-dashboard-toolbar-closed': !toolbarOpened }">
|
2021-01-21 18:03:36 +02:00
|
|
|
<tb-dashboard-toolbar [fxShow]="!widgetEditMode && !hideToolbar" [forceFullscreen]="forceFullscreen"
|
2019-09-19 20:10:52 +03:00
|
|
|
[toolbarOpened]="toolbarOpened" (triggerClick)="openToolbar()">
|
2020-04-24 15:49:53 +03:00
|
|
|
<div class="tb-dashboard-action-panels" fxLayout="column" fxLayout.gt-sm="row"
|
2019-09-19 20:10:52 +03:00
|
|
|
fxLayoutAlign="center stretch" fxLayoutAlign.gt-sm="space-between center">
|
2023-08-01 19:58:59 +03:00
|
|
|
<div class="tb-dashboard-action-panel tb-left-panel" [fxHide]="isMobileApp && !isEdit">
|
2020-04-24 15:49:53 +03:00
|
|
|
<tb-user-menu *ngIf="!isPublicUser() && forceFullscreen" fxHide.gt-sm displayUserInfo="true">
|
|
|
|
|
</tb-user-menu>
|
2023-05-15 15:15:55 +03:00
|
|
|
<ng-container *ngIf="isEdit">
|
|
|
|
|
<div fxFlex.lt-md fxLayout="row"
|
|
|
|
|
fxLayoutAlign.gt-sm="start center"
|
|
|
|
|
fxLayoutAlign="end center" fxLayoutGap.lt-lg="6px" fxLayoutGap.gt-md="12px">
|
|
|
|
|
<button fxHide.gt-md mat-icon-button
|
|
|
|
|
matTooltip="{{'dashboard.manage-states' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="manageDashboardStates($event)">
|
|
|
|
|
<mat-icon>layers</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-lg mat-button
|
|
|
|
|
matTooltip="{{'dashboard.manage-states' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="manageDashboardStates($event)">
|
|
|
|
|
<mat-icon>layers</mat-icon>
|
|
|
|
|
{{'dashboard.states-short' | translate}}
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.gt-md mat-icon-button
|
|
|
|
|
matTooltip="{{'layout.manage' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="manageDashboardLayouts($event)">
|
|
|
|
|
<mat-icon>view_compact</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-lg mat-button
|
|
|
|
|
matTooltip="{{'layout.manage' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="manageDashboardLayouts($event)">
|
|
|
|
|
<mat-icon>view_compact</mat-icon>
|
|
|
|
|
{{'layout.layouts' | translate}}
|
|
|
|
|
</button>
|
2024-08-05 00:49:43 +03:00
|
|
|
<tb-select-dashboard-layout
|
|
|
|
|
[dashboardCtrl]="this">
|
|
|
|
|
</tb-select-dashboard-layout>
|
2023-05-15 15:15:55 +03:00
|
|
|
</div>
|
|
|
|
|
</ng-container>
|
2021-04-16 14:59:35 +03:00
|
|
|
<tb-states-component fxFlex.lt-md
|
|
|
|
|
[statesControllerId]="isEdit ? 'default' : dashboardConfiguration.settings.stateControllerId"
|
|
|
|
|
[dashboardCtrl]="this"
|
2021-05-04 19:44:15 +03:00
|
|
|
[dashboardId]="setStateDashboardId ? dashboard.id.id : ''"
|
2021-04-16 14:59:35 +03:00
|
|
|
[isMobile]="isMobile"
|
|
|
|
|
[state]="dashboardCtx.state"
|
|
|
|
|
[currentState]="currentState"
|
|
|
|
|
[syncStateWithQueryParam]="syncStateWithQueryParam"
|
|
|
|
|
[states]="dashboardConfiguration.states">
|
|
|
|
|
</tb-states-component>
|
2023-11-27 18:34:46 +02:00
|
|
|
<img *ngIf="showDashboardLogo()" [src]="dashboardLogo | image | async"
|
2021-04-16 14:59:35 +03:00
|
|
|
aria-label="dashboard_logo" class="dashboard_logo"/>
|
2020-04-24 15:49:53 +03:00
|
|
|
</div>
|
2023-08-01 19:58:59 +03:00
|
|
|
<div class="tb-dashboard-action-panel">
|
2020-04-21 11:53:26 +03:00
|
|
|
<button [fxShow]="showCloseToolbar()" mat-icon-button class="close-action"
|
2019-09-19 20:10:52 +03:00
|
|
|
matTooltip="{{ 'dashboard.close-toolbar' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="closeToolbar()">
|
|
|
|
|
<mat-icon>arrow_forward</mat-icon>
|
|
|
|
|
</button>
|
2020-04-21 11:53:26 +03:00
|
|
|
<tb-user-menu *ngIf="!isPublicUser() && forceFullscreen" fxHide.lt-md displayUserInfo="true">
|
2019-09-19 20:10:52 +03:00
|
|
|
</tb-user-menu>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button [fxShow]="showRightLayoutSwitch()" mat-icon-button
|
2019-09-19 20:10:52 +03:00
|
|
|
matTooltip="{{ (isRightLayoutOpened ? 'dashboard.hide-details' : 'dashboard.show-details') | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="toggleLayouts()">
|
|
|
|
|
<mat-icon>{{isRightLayoutOpened ? 'arrow_back' : 'menu'}}</mat-icon>
|
|
|
|
|
</button>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button [fxShow]="!hideFullscreenButton()" mat-icon-button
|
2019-09-19 20:10:52 +03:00
|
|
|
matTooltip="{{(isFullscreen ? 'fullscreen.exit' : 'fullscreen.expand') | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="isFullscreen = !isFullscreen">
|
|
|
|
|
<mat-icon>{{ isFullscreen ? 'fullscreen_exit' : 'fullscreen' }}</mat-icon>
|
|
|
|
|
</button>
|
2023-05-15 15:15:55 +03:00
|
|
|
<button [fxShow]="currentDashboardId && !isMobileApp && displayExport() && !isEdit" mat-icon-button
|
|
|
|
|
matTooltip="{{'dashboard.export' | translate}}"
|
2022-06-02 14:10:56 +03:00
|
|
|
matTooltipPosition="below"
|
2023-05-15 15:15:55 +03:00
|
|
|
(click)="exportDashboard($event)">
|
|
|
|
|
<mat-icon>file_download</mat-icon>
|
2022-06-02 14:10:56 +03:00
|
|
|
</button>
|
2023-05-15 15:15:55 +03:00
|
|
|
<ng-container *ngIf="!readonly && !isEdit">
|
|
|
|
|
<button fxHide.gt-md mat-icon-button (click)="toggleDashboardEditMode()"
|
|
|
|
|
matTooltip="{{'dashboard.edit-mode' | translate}}"
|
|
|
|
|
matTooltipPosition="below">
|
|
|
|
|
<mat-icon>edit</mat-icon></button>
|
|
|
|
|
<button fxHide.lt-lg mat-stroked-button (click)="toggleDashboardEditMode()">
|
|
|
|
|
<mat-icon>edit</mat-icon>{{'dashboard.edit-mode' | translate}}</button>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container *ngIf="isEdit">
|
|
|
|
|
<button fxHide.gt-md mat-icon-button (click)="saveDashboard()"
|
|
|
|
|
matTooltip="{{'action.save' | translate}}"
|
|
|
|
|
matTooltipPosition="below">
|
|
|
|
|
<mat-icon>done</mat-icon></button>
|
2023-06-24 13:35:02 +03:00
|
|
|
<button fxHide.lt-lg mat-stroked-button (click)="saveDashboard()">
|
2023-05-15 15:15:55 +03:00
|
|
|
<mat-icon>done</mat-icon>{{ 'action.save' | translate }}</button>
|
|
|
|
|
<button fxHide.gt-md mat-icon-button (click)="toggleDashboardEditMode()"
|
|
|
|
|
matTooltip="{{'action.cancel' | translate}}"
|
|
|
|
|
matTooltipPosition="below">
|
|
|
|
|
<mat-icon>close</mat-icon></button>
|
|
|
|
|
<button fxHide.lt-lg mat-button (click)="toggleDashboardEditMode()">
|
|
|
|
|
<mat-icon>close</mat-icon>{{ 'action.cancel' | translate }}</button>
|
|
|
|
|
<mat-divider class="tb-toolbar-divider" vertical></mat-divider>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container *ngIf="currentDashboardId && isEdit && isTenantAdmin()">
|
|
|
|
|
<button fxHide.lt-lg fxHide.gt-lg mat-icon-button
|
|
|
|
|
#versionControlIconButton
|
|
|
|
|
matTooltip="{{'version-control.version-control' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="toggleVersionControl($event, versionControlIconButton)">
|
|
|
|
|
<mat-icon>history</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-xl mat-button
|
|
|
|
|
#versionControlButton
|
|
|
|
|
matTooltip="{{'version-control.version-control' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="toggleVersionControl($event, versionControlButton)">
|
|
|
|
|
<mat-icon>history</mat-icon>
|
|
|
|
|
{{'version-control.versions' | translate}}
|
|
|
|
|
</button>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container *ngIf="isEdit">
|
|
|
|
|
<button fxHide.gt-lg mat-icon-button
|
|
|
|
|
matTooltip="{{ 'filter.filters' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openFilters($event)">
|
|
|
|
|
<mat-icon>filter_list</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-xl mat-button
|
|
|
|
|
matTooltip="{{ 'filter.filters' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openFilters($event)">
|
|
|
|
|
<mat-icon>filter_list</mat-icon>
|
|
|
|
|
{{ 'filter.filters' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container *ngIf="isEdit">
|
|
|
|
|
<button fxHide.gt-lg mat-icon-button
|
|
|
|
|
matTooltip="{{ 'entity.aliases' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openEntityAliases($event)">
|
|
|
|
|
<mat-icon>devices_other</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-xl mat-button
|
|
|
|
|
matTooltip="{{ 'entity.aliases' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openEntityAliases($event)">
|
|
|
|
|
<mat-icon>devices_other</mat-icon>
|
|
|
|
|
{{ 'entity.aliases-short' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-container *ngIf="isEdit">
|
|
|
|
|
<button fxHide.gt-lg mat-icon-button
|
|
|
|
|
matTooltip="{{ 'dashboard.settings' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openDashboardSettings($event)">
|
|
|
|
|
<mat-icon>settings</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-xl mat-button
|
|
|
|
|
matTooltip="{{ 'dashboard.settings' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openDashboardSettings($event)">
|
|
|
|
|
<mat-icon>settings</mat-icon>
|
|
|
|
|
{{ 'dashboard.settings' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</ng-container>
|
2021-05-14 13:38:35 +03:00
|
|
|
<button [fxShow]="currentDashboardId && !isEdit && !isMobileApp && isTenantAdmin() && displayUpdateDashboardImage()" mat-icon-button
|
2021-05-12 17:04:42 +03:00
|
|
|
matTooltip="{{'dashboard.update-image' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="updateDashboardImage($event)">
|
|
|
|
|
<mat-icon>wallpaper</mat-icon>
|
|
|
|
|
</button>
|
2023-05-15 15:15:55 +03:00
|
|
|
<ng-container *ngIf="isEdit; else timewindowTemplate">
|
|
|
|
|
<tb-timewindow fxHide.lt-xl asButton
|
|
|
|
|
flatButton
|
|
|
|
|
[displayTimewindowValue]="false"
|
|
|
|
|
[isEdit]="true"
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
aggregation="true"
|
|
|
|
|
timezone="true"
|
|
|
|
|
[(ngModel)]="dashboardCtx.dashboardTimewindow">
|
|
|
|
|
</tb-timewindow>
|
|
|
|
|
<tb-timewindow fxHide.gt-lg
|
|
|
|
|
hideLabel
|
|
|
|
|
[isEdit]="true"
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
aggregation="true"
|
|
|
|
|
timezone="true"
|
|
|
|
|
[(ngModel)]="dashboardCtx.dashboardTimewindow">
|
|
|
|
|
</tb-timewindow>
|
|
|
|
|
</ng-container>
|
|
|
|
|
<ng-template #timewindowTemplate>
|
|
|
|
|
<ng-container *ngIf="displayDashboardTimewindow()">
|
|
|
|
|
<tb-timewindow fxHide.gt-md
|
|
|
|
|
[isEdit]="false"
|
|
|
|
|
hideLabel
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
aggregation="true"
|
|
|
|
|
timezone="true"
|
|
|
|
|
[(ngModel)]="dashboardCtx.dashboardTimewindow">
|
|
|
|
|
</tb-timewindow>
|
|
|
|
|
<tb-timewindow fxHide.lt-lg
|
|
|
|
|
[isEdit]="false"
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
aggregation="true"
|
|
|
|
|
timezone="true"
|
|
|
|
|
[(ngModel)]="dashboardCtx.dashboardTimewindow">
|
|
|
|
|
</tb-timewindow>
|
|
|
|
|
</ng-container>
|
|
|
|
|
</ng-template>
|
2023-08-01 19:58:59 +03:00
|
|
|
<ng-container *ngIf="isEdit">
|
|
|
|
|
<button fxHide.gt-xs mat-icon-button
|
|
|
|
|
matTooltip="{{ 'dashboard.add-widget-button-text' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="addWidget($event)">
|
|
|
|
|
<mat-icon>add</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxHide.lt-sm mat-stroked-button
|
|
|
|
|
matTooltip="{{ 'dashboard.add-widget-button-text' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="addWidget($event)">
|
|
|
|
|
<mat-icon>add</mat-icon>
|
|
|
|
|
{{ 'dashboard.add-widget-button-text' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</ng-container>
|
2020-07-01 20:09:25 +03:00
|
|
|
<tb-filters-edit [fxShow]="!isEdit && displayFilters()"
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
[aliasController]="dashboardCtx.aliasController">
|
|
|
|
|
</tb-filters-edit>
|
2019-09-19 20:10:52 +03:00
|
|
|
<tb-aliases-entity-select [fxShow]="!isEdit && displayEntitiesSelect()"
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
[aliasController]="dashboardCtx.aliasController">
|
|
|
|
|
</tb-aliases-entity-select>
|
2022-12-27 12:43:07 +02:00
|
|
|
<tb-dashboard-select *ngIf="!isEdit && !widgetEditMode && !embedded && displayDashboardsSelect()"
|
2019-09-19 20:10:52 +03:00
|
|
|
[(ngModel)]="currentDashboardId"
|
|
|
|
|
(ngModelChange)="currentDashboardIdChanged(currentDashboardId)"
|
|
|
|
|
[customerId]="currentCustomerId"
|
|
|
|
|
[dashboardsScope]="currentDashboardScope">
|
|
|
|
|
</tb-dashboard-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</tb-dashboard-toolbar>
|
|
|
|
|
</section>
|
|
|
|
|
<section class="tb-dashboard-container tb-absolute-fill"
|
2021-10-28 15:12:55 +03:00
|
|
|
tb-toast toastTarget="dashboardRoot"
|
2021-05-12 17:04:42 +03:00
|
|
|
#dashboardContainer
|
2019-09-19 20:10:52 +03:00
|
|
|
[ngClass]="{ 'is-fullscreen': forceFullscreen,
|
|
|
|
|
'tb-dashboard-toolbar-opened': toolbarOpened,
|
2019-10-10 13:00:29 +03:00
|
|
|
'tb-dashboard-toolbar-animated': isToolbarOpenedAnimate,
|
2019-09-19 20:10:52 +03:00
|
|
|
'tb-dashboard-toolbar-closed': !toolbarOpened }">
|
2019-10-31 18:33:51 +02:00
|
|
|
<mat-drawer-container hasBackdrop="false" class="tb-absolute-fill tb-dashboard-drawer-container">
|
|
|
|
|
<mat-drawer-content fxLayout="column" fxLayoutAlign="center start">
|
|
|
|
|
<section *ngIf="!widgetEditMode" class="tb-dashboard-title"
|
|
|
|
|
[ngStyle]="{'color': dashboard.configuration.settings.titleColor}">
|
2021-10-21 13:10:31 +03:00
|
|
|
<h3 [fxShow]="!isEdit && displayTitle()">{{ translatedDashboardTitle }}</h3>
|
2023-05-15 15:15:55 +03:00
|
|
|
<mat-form-field [fxShow]="isEdit" class="mat-block tb-appearance-transparent" subscriptSizing="dynamic">
|
2019-10-31 18:33:51 +02:00
|
|
|
<mat-label translate [ngStyle]="{'color': dashboard.configuration.settings.titleColor}">dashboard.title</mat-label>
|
|
|
|
|
<input matInput class="tb-dashboard-title"
|
|
|
|
|
[ngStyle]="{'color': dashboard.configuration.settings.titleColor}"
|
|
|
|
|
required name="title" [(ngModel)]="dashboard.title">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</section>
|
|
|
|
|
<mat-drawer-container class="tb-dashboard-layouts" fxFlex
|
2024-08-05 16:09:41 +03:00
|
|
|
[class]="{'tb-shrinked' : isEditingWidget,
|
|
|
|
|
'diagonal-stripes': !layouts.right.show && layouts.main.layoutCtx.breakpoint !== 'default'}">
|
2019-10-31 18:33:51 +02:00
|
|
|
<mat-drawer *ngIf="layouts.right.show"
|
|
|
|
|
id="tb-right-layout"
|
2022-12-28 12:22:04 +02:00
|
|
|
[ngStyle]="{minWidth: rightLayoutSize.width,
|
|
|
|
|
maxWidth: rightLayoutSize.width,
|
|
|
|
|
height: rightLayoutSize.height,
|
2019-10-31 18:33:51 +02:00
|
|
|
borderLeft: 'none'}"
|
|
|
|
|
disableClose="true"
|
2019-11-04 15:47:36 +02:00
|
|
|
[@.disabled]="!isMobile"
|
2019-10-31 18:33:51 +02:00
|
|
|
position="end"
|
|
|
|
|
[mode]="isMobile ? 'over' : 'side'"
|
|
|
|
|
[(opened)]="rightLayoutOpened">
|
|
|
|
|
<tb-dashboard-layout style="height: 100%;"
|
2020-01-20 15:14:08 +02:00
|
|
|
[dashboardCheatSheet]="cheatSheetComponent"
|
2023-11-13 17:50:13 +02:00
|
|
|
[layoutCtx]="mobileDisplayRightLayoutFirst ? layouts.main.layoutCtx : layouts.right.layoutCtx"
|
2019-10-31 18:33:51 +02:00
|
|
|
[dashboardCtx]="dashboardCtx"
|
|
|
|
|
[isEdit]="isEdit"
|
|
|
|
|
[isEditingWidget]="isEditingWidget"
|
|
|
|
|
[isMobile]="forceDashboardMobileMode"
|
2021-10-06 21:03:29 +03:00
|
|
|
[widgetEditMode]="widgetEditMode"
|
2022-10-07 19:33:18 +03:00
|
|
|
[parentDashboard]="parentDashboard"
|
|
|
|
|
[popoverComponent]="popoverComponent">
|
2019-10-31 18:33:51 +02:00
|
|
|
</tb-dashboard-layout>
|
|
|
|
|
</mat-drawer>
|
|
|
|
|
<mat-drawer-content [fxShow]="layouts.main.show"
|
|
|
|
|
id="tb-main-layout"
|
2024-08-05 16:09:41 +03:00
|
|
|
[style]="{width: mainLayoutSize.width,
|
|
|
|
|
height: mainLayoutSize.height,
|
|
|
|
|
maxWidth: mainLayoutSize.maxWidth}">
|
2019-10-31 18:33:51 +02:00
|
|
|
<tb-dashboard-layout
|
2020-01-20 15:14:08 +02:00
|
|
|
[dashboardCheatSheet]="cheatSheetComponent"
|
2023-11-13 17:50:13 +02:00
|
|
|
[layoutCtx]="mobileDisplayRightLayoutFirst ? layouts.right.layoutCtx : layouts.main.layoutCtx"
|
2019-10-31 18:33:51 +02:00
|
|
|
[dashboardCtx]="dashboardCtx"
|
|
|
|
|
[isEdit]="isEdit"
|
|
|
|
|
[isEditingWidget]="isEditingWidget"
|
|
|
|
|
[isMobile]="forceDashboardMobileMode"
|
2021-10-06 21:03:29 +03:00
|
|
|
[widgetEditMode]="widgetEditMode"
|
2022-10-07 19:33:18 +03:00
|
|
|
[parentDashboard]="parentDashboard"
|
|
|
|
|
[popoverComponent]="popoverComponent">
|
2019-10-31 18:33:51 +02:00
|
|
|
</tb-dashboard-layout>
|
|
|
|
|
</mat-drawer-content>
|
|
|
|
|
</mat-drawer-container>
|
2023-05-15 16:58:28 +03:00
|
|
|
<section data-html2canvas-ignore fxLayout="row" class="layout-wrap tb-header-buttons tb-enter-edit-mode" fxLayoutAlign="start end" *ngIf="!readonly && (hideToolbar || widgetEditMode)">
|
|
|
|
|
<button [fxShow]="!isEdit"
|
|
|
|
|
color="primary"
|
2023-05-15 15:15:55 +03:00
|
|
|
mat-mini-fab
|
2023-05-15 16:58:28 +03:00
|
|
|
class="tb-btn-header tb-btn-edit"
|
2019-10-31 18:33:51 +02:00
|
|
|
(click)="toggleDashboardEditMode()"
|
2023-05-15 15:15:55 +03:00
|
|
|
matTooltip="{{ 'action.enter-edit-mode' | translate }}"
|
2019-10-31 18:33:51 +02:00
|
|
|
matTooltipPosition="above">
|
2023-05-15 15:15:55 +03:00
|
|
|
<mat-icon>edit</mat-icon>
|
2019-10-31 18:33:51 +02:00
|
|
|
</button>
|
2023-05-15 16:58:28 +03:00
|
|
|
<button [fxShow]="isEdit"
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-mini-fab
|
|
|
|
|
class="tb-btn-header tb-btn-edit"
|
|
|
|
|
(click)="saveDashboard()"
|
|
|
|
|
matTooltip="{{'action.save' | translate}}"
|
|
|
|
|
matTooltipPosition="below">
|
|
|
|
|
<mat-icon>done</mat-icon></button>
|
|
|
|
|
<button [fxShow]="isEdit"
|
|
|
|
|
color="primary"
|
|
|
|
|
mat-mini-fab
|
|
|
|
|
class="tb-btn-header tb-btn-edit"
|
|
|
|
|
(click)="toggleDashboardEditMode()"
|
|
|
|
|
matTooltip="{{'action.cancel' | translate}}"
|
|
|
|
|
matTooltipPosition="below">
|
|
|
|
|
<mat-icon>close</mat-icon></button>
|
2019-10-31 18:33:51 +02:00
|
|
|
</section>
|
2021-10-06 21:03:29 +03:00
|
|
|
<section *ngIf="!embedded" data-html2canvas-ignore class="tb-powered-by-footer" [ngStyle]="{'color': dashboard.configuration.settings.titleColor}">
|
2019-10-31 18:33:51 +02:00
|
|
|
<span>Powered by <a href="https://thingsboard.io" target="_blank">Thingsboard v.{{ thingsboardVersion }}</a></span>
|
|
|
|
|
</section>
|
|
|
|
|
</mat-drawer-content>
|
2019-09-25 19:37:29 +03:00
|
|
|
<mat-drawer class="tb-details-drawer"
|
2019-10-31 18:33:51 +02:00
|
|
|
[opened]="isEditingWidget || isAddingWidget"
|
|
|
|
|
(openedStart)="detailsDrawerOpenedStart()"
|
|
|
|
|
(closed)="detailsDrawerClosed()"
|
2022-06-17 17:35:33 +03:00
|
|
|
disableClose
|
2019-09-25 19:37:29 +03:00
|
|
|
mode="over"
|
|
|
|
|
position="end">
|
2019-10-31 18:33:51 +02:00
|
|
|
<tb-details-panel *ngIf="!isEditingWidgetClosed" fxFlex
|
2019-09-25 19:37:29 +03:00
|
|
|
headerTitle="{{editingWidget?.config.title}}"
|
|
|
|
|
headerSubtitle="{{ editingWidgetSubtitle }}"
|
2023-05-16 20:00:53 +03:00
|
|
|
[isReadOnly]="true"
|
|
|
|
|
(closeDetails)="onEditWidgetClosed()">
|
2023-05-25 17:03:52 +03:00
|
|
|
<div class="details-buttons" fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="16px">
|
2023-08-17 18:50:32 +03:00
|
|
|
<tb-toggle-select *ngIf="tbEditWidget.widgetConfig?.hasBasicMode" appearance="fill-invert" selectMediaBreakpoint="xs" [(ngModel)]="tbEditWidget.widgetConfigMode">
|
2023-07-03 17:09:35 +03:00
|
|
|
<tb-toggle-option value="basic">{{ 'widget.basic-mode' | translate }}</tb-toggle-option>
|
|
|
|
|
<tb-toggle-option value="advanced">{{ 'widget.advanced-mode' | translate }}</tb-toggle-option>
|
|
|
|
|
</tb-toggle-select>
|
2019-09-25 19:37:29 +03:00
|
|
|
<div [tb-help]="helpLinkIdForWidgetType()"></div>
|
|
|
|
|
</div>
|
2019-10-21 19:57:18 +03:00
|
|
|
<tb-edit-widget #tbEditWidget
|
2019-10-31 18:33:51 +02:00
|
|
|
[dashboard]="dashboard"
|
|
|
|
|
[aliasController]="dashboardCtx.aliasController"
|
2023-05-16 20:00:53 +03:00
|
|
|
[stateController]="dashboardCtx.stateController"
|
2019-10-31 18:33:51 +02:00
|
|
|
[widgetEditMode]="widgetEditMode"
|
|
|
|
|
[widget]="editingWidget"
|
2023-05-16 20:00:53 +03:00
|
|
|
[widgetLayout]="editingWidgetLayout"
|
|
|
|
|
(revertWidgetConfig)="onRevertWidgetEdit()"
|
|
|
|
|
(applyWidgetConfig)="saveWidget()">
|
2019-10-21 19:57:18 +03:00
|
|
|
</tb-edit-widget>
|
2019-09-25 19:37:29 +03:00
|
|
|
</tb-details-panel>
|
2019-10-31 18:33:51 +02:00
|
|
|
<tb-details-panel *ngIf="!isAddingWidgetClosed && !widgetEditMode" fxFlex
|
2021-03-11 14:54:35 +02:00
|
|
|
headerTitle="{{ isAddingWidget ?
|
2023-09-28 18:16:20 +03:00
|
|
|
((dashboardWidgetSelectComponent?.selectWidgetMode === 'allWidgets' ? ('dashboard.select-widget-value' | translate: { title: ('widget.all-widgets' | translate) }) :
|
2023-09-04 18:04:20 +03:00
|
|
|
(!dashboardWidgetSelectComponent?.widgetsBundle ?
|
|
|
|
|
'widget.select-widgets-bundle' : 'dashboard.select-widget-value') | translate: dashboardWidgetSelectComponent?.widgetsBundle)) : ''
|
2021-03-03 15:41:47 +02:00
|
|
|
}}"
|
2021-03-04 19:38:30 +02:00
|
|
|
headerHeightPx="64"
|
|
|
|
|
[isShowSearch]="true"
|
2019-10-31 10:06:57 +02:00
|
|
|
[isReadOnly]="true"
|
|
|
|
|
[isEdit]="false"
|
2021-03-04 19:38:30 +02:00
|
|
|
backgroundColor="#cfd8dc"
|
|
|
|
|
(closeDetails)="onAddWidgetClosed()"
|
2023-09-28 18:16:20 +03:00
|
|
|
(closeSearch)="dashboardWidgetSelectComponent.search = ''">
|
|
|
|
|
<div class="prefix-title-buttons" [fxShow]="!!(isAddingWidget && (dashboardWidgetSelectComponent?.widgetsBundle || dashboardWidgetSelectComponent?.selectWidgetMode === 'allWidgets'))" style="height: 28px; margin-right: 12px">
|
2021-03-11 14:54:35 +02:00
|
|
|
<button class="tb-mat-28" mat-icon-button type="button" (click)="clearSelectedWidgetBundle()">
|
2021-03-04 17:11:55 +02:00
|
|
|
<mat-icon>arrow_back</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2023-09-28 18:16:20 +03:00
|
|
|
<div class="search-pane" *ngIf="isAddingWidget && dashboardWidgetSelectComponent" fxLayout="row">
|
2021-03-04 19:38:30 +02:00
|
|
|
<tb-widgets-bundle-search fxFlex
|
2023-09-28 18:16:20 +03:00
|
|
|
[(ngModel)]="dashboardWidgetSelectComponent.search"
|
|
|
|
|
placeholder="{{ ((!dashboardWidgetSelectComponent.widgetsBundle && dashboardWidgetSelectComponent.selectWidgetMode === 'bundles')
|
|
|
|
|
? 'widgets-bundle.search' : 'widget.search') | translate }}">
|
2021-03-04 19:38:30 +02:00
|
|
|
</tb-widgets-bundle-search>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
2023-08-28 18:54:12 +03:00
|
|
|
<div class="details-buttons" *ngIf="isAddingWidget" fxLayout="row" fxLayoutAlign="start center">
|
2023-05-15 15:15:55 +03:00
|
|
|
<button mat-button type="button" (click)="importWidget($event)"
|
2023-09-28 18:16:20 +03:00
|
|
|
*ngIf="dashboardWidgetSelectComponent?.selectWidgetMode === 'bundles' && !dashboardWidgetSelectComponent?.widgetsBundle">
|
2023-05-15 15:15:55 +03:00
|
|
|
<mat-icon>file_upload</mat-icon>{{ 'dashboard.import-widget' | translate }}</button>
|
2023-09-28 18:16:20 +03:00
|
|
|
<tb-toggle-select *ngIf="dashboardWidgetSelectComponent?.selectWidgetMode === 'bundles' && !dashboardWidgetSelectComponent?.widgetsBundle"
|
2023-09-04 18:04:20 +03:00
|
|
|
appearance="fill-invert"
|
|
|
|
|
disablePagination
|
|
|
|
|
selectMediaBreakpoint="xs"
|
|
|
|
|
[(ngModel)]="dashboardWidgetSelectComponent.selectWidgetMode">
|
|
|
|
|
<tb-toggle-option value="bundles">{{ 'widgets-bundle.widgets-bundles' | translate }}</tb-toggle-option>
|
|
|
|
|
<tb-toggle-option value="allWidgets">{{ 'widget.all-widgets' | translate }}</tb-toggle-option>
|
|
|
|
|
</tb-toggle-select>
|
2023-09-28 18:16:20 +03:00
|
|
|
<button mat-icon-button type="button"
|
|
|
|
|
*ngIf="dashboardWidgetSelectComponent?.widgetTypes.size > 1"
|
|
|
|
|
(click)="editWidgetsTypesToDisplay($event)"
|
|
|
|
|
matTooltip="{{ 'widget.filter' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>filter_list</mat-icon>
|
|
|
|
|
</button>
|
2023-08-28 18:54:12 +03:00
|
|
|
<tb-toggle-select *ngIf="dashboardWidgetSelectComponent?.hasDeprecated"
|
|
|
|
|
appearance="fill-invert"
|
|
|
|
|
disablePagination
|
|
|
|
|
selectMediaBreakpoint="xs"
|
2023-09-28 18:16:20 +03:00
|
|
|
[(ngModel)]="dashboardWidgetSelectComponent.deprecatedFilter">
|
|
|
|
|
<tb-toggle-option value="ALL">{{ 'widget.all' | translate }}</tb-toggle-option>
|
|
|
|
|
<tb-toggle-option value="ACTUAL">{{ 'widget.actual' | translate }}</tb-toggle-option>
|
|
|
|
|
<tb-toggle-option value="DEPRECATED">{{ 'widget.deprecated' | translate }}</tb-toggle-option>
|
2023-08-28 18:54:12 +03:00
|
|
|
</tb-toggle-select>
|
2021-03-04 17:11:55 +02:00
|
|
|
</div>
|
2021-03-11 14:54:35 +02:00
|
|
|
<tb-dashboard-widget-select #dashboardWidgetSelect
|
|
|
|
|
*ngIf="isAddingWidget"
|
2019-10-31 18:33:51 +02:00
|
|
|
[aliasController]="dashboardCtx.aliasController"
|
2021-03-04 17:11:55 +02:00
|
|
|
[filterWidgetTypes]="filterWidgetTypes"
|
2024-07-08 16:28:40 +03:00
|
|
|
[scadaFirst]="layouts.main.layoutCtx.gridSettings.layoutType === LayoutType.scada"
|
2019-10-31 18:33:51 +02:00
|
|
|
(widgetSelected)="addWidgetFromType($event)">
|
2019-10-31 10:06:57 +02:00
|
|
|
</tb-dashboard-widget-select>
|
|
|
|
|
</tb-details-panel>
|
|
|
|
|
</mat-drawer>
|
|
|
|
|
</mat-drawer-container>
|
2019-09-19 20:10:52 +03:00
|
|
|
</section>
|
2021-04-16 14:59:35 +03:00
|
|
|
</div>
|