2019-09-19 20:10:52 +03:00
|
|
|
<!--
|
|
|
|
|
|
2021-01-11 13:42:16 +02:00
|
|
|
Copyright © 2016-2021 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.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<div class="tb-dashboard-page mat-content" style="padding-top: 150px;"
|
|
|
|
|
fxFlex tb-fullscreen [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">
|
2020-04-24 15:49:53 +03:00
|
|
|
<div class="tb-dashboard-action-panel" fxFlex="auto" fxLayout="row-reverse"
|
|
|
|
|
fxLayoutAlign.gt-sm="end center" fxLayoutAlign="space-between center" fxLayoutGap="12px">
|
|
|
|
|
<tb-user-menu *ngIf="!isPublicUser() && forceFullscreen" fxHide.gt-sm displayUserInfo="true">
|
|
|
|
|
</tb-user-menu>
|
|
|
|
|
<div [fxShow]="isEdit"
|
|
|
|
|
fxFlex.lt-md fxLayout="row"
|
|
|
|
|
fxLayoutAlign.gt-sm="start center"
|
|
|
|
|
fxLayoutAlign="end center" fxLayoutGap="12px">
|
|
|
|
|
<button mat-icon-button
|
|
|
|
|
matTooltip="{{'dashboard.manage-states' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="manageDashboardStates($event)">
|
|
|
|
|
<mat-icon>layers</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button mat-icon-button
|
|
|
|
|
matTooltip="{{'layout.manage' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="manageDashboardLayouts($event)">
|
|
|
|
|
<mat-icon>view_compact</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<tb-states-component fxFlex.lt-md
|
|
|
|
|
[statesControllerId]="isEdit ? 'default' : dashboardConfiguration.settings.stateControllerId"
|
|
|
|
|
[dashboardCtrl]="this"
|
|
|
|
|
[dashboardId]="dashboard.id ? dashboard.id.id : ''"
|
|
|
|
|
[isMobile]="isMobile"
|
|
|
|
|
[state]="dashboardCtx.state"
|
2021-01-21 18:03:36 +02:00
|
|
|
[currentState]="currentState"
|
2020-04-24 15:49:53 +03:00
|
|
|
[states]="dashboardConfiguration.states">
|
|
|
|
|
</tb-states-component>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tb-dashboard-action-panel" fxFlex="1 0 auto" fxLayout="row-reverse"
|
2019-09-19 20:10:52 +03:00
|
|
|
fxLayoutAlign.gt-sm="start center" fxLayoutAlign="space-between center" fxLayoutGap="12px">
|
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>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button [fxShow]="isEdit || displayExport()" mat-icon-button
|
2019-09-19 20:10:52 +03:00
|
|
|
matTooltip="{{'dashboard.export' | translate}}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="exportDashboard($event)">
|
|
|
|
|
<mat-icon>file_download</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<tb-timewindow [fxShow]="isEdit || displayDashboardTimewindow()"
|
|
|
|
|
isToolbar="true"
|
2020-02-25 19:11:25 +02:00
|
|
|
[isEdit]="isEdit"
|
2019-09-19 20:10:52 +03:00
|
|
|
direction="left"
|
|
|
|
|
tooltipPosition="below"
|
|
|
|
|
aggregation="true"
|
|
|
|
|
[(ngModel)]="dashboardCtx.dashboardTimewindow">
|
|
|
|
|
</tb-timewindow>
|
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>
|
2020-06-30 19:37:50 +03:00
|
|
|
<button [fxShow]="isEdit" mat-icon-button
|
|
|
|
|
matTooltip="{{ 'filter.filters' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openFilters($event)">
|
|
|
|
|
<mat-icon>filter_list</mat-icon>
|
|
|
|
|
</button>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button [fxShow]="isEdit" mat-icon-button
|
2019-09-19 20:10:52 +03:00
|
|
|
matTooltip="{{ 'entity.aliases' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openEntityAliases($event)">
|
|
|
|
|
<mat-icon>devices_other</mat-icon>
|
|
|
|
|
</button>
|
2020-04-21 11:53:26 +03:00
|
|
|
<button [fxShow]="isEdit" mat-icon-button
|
2019-09-19 20:10:52 +03:00
|
|
|
matTooltip="{{ 'dashboard.settings' | translate }}"
|
|
|
|
|
matTooltipPosition="below"
|
|
|
|
|
(click)="openDashboardSettings($event)">
|
|
|
|
|
<mat-icon>settings</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<tb-dashboard-select [fxShow]="!isEdit && !widgetEditMode && displayDashboardsSelect()"
|
|
|
|
|
[(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"
|
|
|
|
|
[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}">
|
|
|
|
|
<h3 [fxShow]="!isEdit && displayTitle()">{{ dashboard.title }}</h3>
|
|
|
|
|
<mat-form-field [fxShow]="isEdit" class="mat-block">
|
|
|
|
|
<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
|
|
|
|
|
[ngClass]="{ 'tb-shrinked' : isEditingWidget }">
|
|
|
|
|
<mat-drawer *ngIf="layouts.right.show"
|
|
|
|
|
id="tb-right-layout"
|
|
|
|
|
[ngStyle]="{minWidth: rightLayoutWidth(),
|
|
|
|
|
maxWidth: rightLayoutWidth(),
|
|
|
|
|
height: rightLayoutHeight(),
|
|
|
|
|
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"
|
2019-10-31 18:33:51 +02:00
|
|
|
[layoutCtx]="layouts.right.layoutCtx"
|
|
|
|
|
[dashboardCtx]="dashboardCtx"
|
|
|
|
|
[isEdit]="isEdit"
|
|
|
|
|
[isEditingWidget]="isEditingWidget"
|
|
|
|
|
[isMobile]="forceDashboardMobileMode"
|
|
|
|
|
[widgetEditMode]="widgetEditMode">
|
|
|
|
|
</tb-dashboard-layout>
|
|
|
|
|
</mat-drawer>
|
|
|
|
|
<mat-drawer-content [fxShow]="layouts.main.show"
|
|
|
|
|
id="tb-main-layout"
|
|
|
|
|
[ngStyle]="{width: mainLayoutWidth(),
|
|
|
|
|
height: mainLayoutHeight()}">
|
|
|
|
|
<tb-dashboard-layout
|
2020-01-20 15:14:08 +02:00
|
|
|
[dashboardCheatSheet]="cheatSheetComponent"
|
2019-10-31 18:33:51 +02:00
|
|
|
[layoutCtx]="layouts.main.layoutCtx"
|
|
|
|
|
[dashboardCtx]="dashboardCtx"
|
|
|
|
|
[isEdit]="isEdit"
|
|
|
|
|
[isEditingWidget]="isEditingWidget"
|
|
|
|
|
[isMobile]="forceDashboardMobileMode"
|
|
|
|
|
[widgetEditMode]="widgetEditMode">
|
|
|
|
|
</tb-dashboard-layout>
|
|
|
|
|
</mat-drawer-content>
|
|
|
|
|
</mat-drawer-container>
|
|
|
|
|
<section fxLayout="row" class="layout-wrap tb-footer-buttons" fxLayoutAlign="start end">
|
2021-01-21 18:03:36 +02:00
|
|
|
<tb-footer-fab-buttons *ngIf="!embedded"
|
|
|
|
|
[fxShow]="!isAddingWidget && isEdit && !widgetEditMode"
|
2019-10-31 18:33:51 +02:00
|
|
|
relative
|
|
|
|
|
[footerFabButtons]="addWidgetFabButtons">
|
|
|
|
|
</tb-footer-fab-buttons>
|
2021-01-21 18:03:36 +02:00
|
|
|
<button *ngIf="(isTenantAdmin() || isSystemAdmin()) && !forceFullscreen && !embedded"
|
2019-10-31 18:33:51 +02:00
|
|
|
mat-fab color="accent" class="tb-btn-footer"
|
|
|
|
|
[ngClass]="{'tb-hide': !isEdit || isAddingWidget}"
|
|
|
|
|
[disabled]="isLoading$ | async"
|
|
|
|
|
(click)="saveDashboard()"
|
|
|
|
|
matTooltip="{{ 'action.apply-changes' | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>done</mat-icon>
|
|
|
|
|
</button>
|
2020-11-27 17:35:19 +02:00
|
|
|
<button *ngIf="(isTenantAdmin() || isSystemAdmin()) && !forceFullscreen && !embedded"
|
2019-10-31 18:33:51 +02:00
|
|
|
mat-fab color="accent" class="tb-btn-footer"
|
|
|
|
|
[ngClass]="{'tb-hide': isAddingWidget || (isLoading$ | async)}"
|
|
|
|
|
[disabled]="isLoading$ | async"
|
|
|
|
|
(click)="toggleDashboardEditMode()"
|
|
|
|
|
matTooltip="{{ (isEdit ? 'action.decline-changes': 'action.enter-edit-mode') | translate }}"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
<mat-icon>{{ isEdit ? 'close' : 'edit' }}</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</section>
|
|
|
|
|
<section class="tb-powered-by-footer" [ngStyle]="{'color': dashboard.configuration.settings.titleColor}">
|
|
|
|
|
<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()"
|
|
|
|
|
(opened)="detailsDrawerOpened()"
|
|
|
|
|
(closedStart)="detailsDrawerClosedStart()"
|
|
|
|
|
(closed)="detailsDrawerClosed()"
|
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 }}"
|
|
|
|
|
[isReadOnly]="false"
|
|
|
|
|
[isAlwaysEdit]="true"
|
|
|
|
|
(closeDetails)="onEditWidgetClosed()"
|
|
|
|
|
(toggleDetailsEditMode)="onRevertWidgetEdit()"
|
|
|
|
|
(applyDetails)="saveWidget()"
|
2020-04-27 10:39:18 +03:00
|
|
|
[theForm]="tbEditWidget.widgetFormGroup">
|
2019-09-25 19:37:29 +03:00
|
|
|
<div class="details-buttons">
|
|
|
|
|
<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"
|
|
|
|
|
[widgetEditMode]="widgetEditMode"
|
|
|
|
|
[widget]="editingWidget"
|
|
|
|
|
[widgetLayout]="editingWidgetLayout">
|
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
|
2019-10-31 10:06:57 +02:00
|
|
|
headerTitle="{{'dashboard.select-widget-title' | translate}}"
|
|
|
|
|
headerHeightPx="120"
|
|
|
|
|
[isReadOnly]="true"
|
|
|
|
|
[isEdit]="false"
|
|
|
|
|
(closeDetails)="onAddWidgetClosed()">
|
|
|
|
|
<div class="header-pane" *ngIf="isAddingWidget">
|
|
|
|
|
<div fxLayout="row">
|
|
|
|
|
<span class="tb-details-subtitle">{{ 'widgets-bundle.current' | translate }}</span>
|
|
|
|
|
<tb-widgets-bundle-select fxFlexOffset="5"
|
|
|
|
|
fxFlex
|
|
|
|
|
required
|
|
|
|
|
[selectFirstBundle]="false"
|
|
|
|
|
[ngModel]="widgetsBundle"
|
|
|
|
|
(ngModelChange)="widgetsBundle = $event">
|
|
|
|
|
</tb-widgets-bundle-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<tb-dashboard-widget-select *ngIf="isAddingWidget"
|
2019-10-31 18:33:51 +02:00
|
|
|
[aliasController]="dashboardCtx.aliasController"
|
|
|
|
|
[widgetsBundle]="widgetsBundle"
|
|
|
|
|
(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>
|
|
|
|
|
</div>
|