2019-10-31 10:06:57 +02:00
|
|
|
<!--
|
|
|
|
|
|
2022-01-17 14:07:46 +02:00
|
|
|
Copyright © 2016-2022 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.
|
|
|
|
|
|
|
|
|
|
-->
|
2020-04-27 10:39:18 +03:00
|
|
|
<form [formGroup]="layoutsFormGroup" (ngSubmit)="save()">
|
2020-04-21 11:53:26 +03:00
|
|
|
<mat-toolbar color="primary">
|
2019-10-31 10:06:57 +02:00
|
|
|
<h2 translate>layout.manage</h2>
|
|
|
|
|
<span fxFlex></span>
|
|
|
|
|
<button mat-button mat-icon-button
|
|
|
|
|
(click)="cancel()"
|
|
|
|
|
type="button">
|
|
|
|
|
<mat-icon class="material-icons">close</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
</mat-toolbar>
|
2022-08-15 12:07:24 +03:00
|
|
|
<div mat-dialog-content fxLayout="column" fxLayoutGap="20px" style="min-width: 300px; overflow: hidden;">
|
|
|
|
|
<div fxLayout="row" fxLayoutAlign="start center">
|
2022-08-22 13:28:38 +03:00
|
|
|
<mat-slide-toggle formControlName="right" color="accent">
|
2022-08-03 15:52:05 +03:00
|
|
|
{{ 'layout.divider' | translate }}
|
|
|
|
|
</mat-slide-toggle>
|
2022-07-27 13:56:11 +03:00
|
|
|
</div>
|
2022-08-15 12:07:24 +03:00
|
|
|
<div fxLayout="column" fxLayoutAlign="start center" fxLayoutGap="20px">
|
|
|
|
|
<mat-button-toggle-group aria-label="Select width value type"
|
|
|
|
|
formControlName="type"
|
|
|
|
|
[fxShow]="layoutsFormGroup.get('right').value">
|
|
|
|
|
<mat-button-toggle fxFlex value="percentage">
|
|
|
|
|
{{ 'layout.percentage-width' | translate }}
|
|
|
|
|
</mat-button-toggle>
|
|
|
|
|
<mat-button-toggle fxFlex value="fixed">
|
|
|
|
|
{{ 'layout.fixed-width' | translate }}
|
|
|
|
|
</mat-button-toggle>
|
|
|
|
|
</mat-button-toggle-group>
|
|
|
|
|
<div fxLayout="row" fxLayoutAlign="center center" class="tb-layout-preview">
|
|
|
|
|
<div fxLayout="row"
|
|
|
|
|
fxLayoutAlign="start center"
|
|
|
|
|
class="tb-layout-preview-container"
|
|
|
|
|
#tooltip="matTooltip"
|
|
|
|
|
matTooltip=""
|
|
|
|
|
matTooltipPosition="below">
|
2022-09-20 18:09:25 +03:00
|
|
|
<div fxLayout="column" fxLayoutAlign="start center" fxFlex="{{ buttonFlexValue() }}" class="tb-layout-preview-container-main">
|
2022-08-15 12:07:24 +03:00
|
|
|
<button mat-icon-button
|
|
|
|
|
type="button"
|
|
|
|
|
matTooltip="{{ 'dashboard.layout-settings' | translate }}"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
(click)="openLayoutSettings('main')"
|
|
|
|
|
class="tb-layout-preview-element"
|
2022-08-19 13:57:49 +03:00
|
|
|
aria-label="Layout settings"
|
2022-09-20 18:09:25 +03:00
|
|
|
[ngClass]="layoutButtonClass('main')">
|
2022-08-15 12:07:24 +03:00
|
|
|
<mat-icon>settings</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxFlex
|
|
|
|
|
type="button"
|
|
|
|
|
mat-raised-button
|
|
|
|
|
color="primary"
|
|
|
|
|
class="tb-layout-button"
|
2022-11-09 17:56:38 +02:00
|
|
|
(mouseover)="mainLayoutTooltip.show()"
|
|
|
|
|
(mouseleave)="mainLayoutTooltip.hide()"
|
2022-08-15 12:07:24 +03:00
|
|
|
(click)="setFixedLayout('main')"
|
2022-09-20 18:09:25 +03:00
|
|
|
[ngClass]="layoutButtonClass('main', true)">
|
2022-11-09 17:56:38 +02:00
|
|
|
<span [matTooltip]="layoutButtonText('main')"
|
|
|
|
|
#mainLayoutTooltip="matTooltip"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
{{ (layoutsFormGroup.value.right ? 'layout.left' : 'layout.main') | translate }}
|
|
|
|
|
</span>
|
2022-08-15 12:07:24 +03:00
|
|
|
</button>
|
2022-09-20 18:09:25 +03:00
|
|
|
<div fxFlex class="tb-layout-preview-element tb-layout-preview-input" *ngIf="showPreviewInputs('main')">
|
|
|
|
|
<input *ngIf="layoutsFormGroup.get('type').value !== layoutWidthType.FIXED"
|
2022-07-27 13:56:11 +03:00
|
|
|
formControlName="leftWidthPercentage"
|
|
|
|
|
type="number"
|
|
|
|
|
step="1"
|
2022-09-20 18:09:25 +03:00
|
|
|
min="{{ layoutPercentageSize.MIN }}"
|
|
|
|
|
max="{{ layoutPercentageSize.MAX }}"
|
2022-08-15 12:07:24 +03:00
|
|
|
required>
|
2022-09-20 18:09:25 +03:00
|
|
|
<input *ngIf="layoutsFormGroup.get('type').value === layoutWidthType.FIXED &&
|
|
|
|
|
layoutsFormGroup.get('fixedLayout').value === 'main'"
|
2022-08-15 12:07:24 +03:00
|
|
|
formControlName="fixedWidth"
|
|
|
|
|
type="number"
|
|
|
|
|
step="1"
|
2022-09-20 18:09:25 +03:00
|
|
|
min="{{ layoutFixedSize.MIN }}"
|
|
|
|
|
max="{{ layoutFixedSize.MAX }}"
|
2022-08-15 12:07:24 +03:00
|
|
|
required>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-09-20 18:09:25 +03:00
|
|
|
<div fxLayout="column" fxLayoutAlign="start center" fxFlex *ngIf="layoutsFormGroup.get('right').value" matTooltip="">
|
2022-08-15 12:07:24 +03:00
|
|
|
<button mat-icon-button
|
|
|
|
|
type="button"
|
|
|
|
|
matTooltip="{{ 'dashboard.layout-settings' | translate }}"
|
|
|
|
|
matTooltipPosition="above"
|
|
|
|
|
(click)="openLayoutSettings('right')"
|
|
|
|
|
class="tb-layout-preview-element"
|
2022-08-19 13:57:49 +03:00
|
|
|
aria-label="Layout settings"
|
2022-09-20 18:09:25 +03:00
|
|
|
[ngClass]="layoutButtonClass('right')">
|
2022-08-15 12:07:24 +03:00
|
|
|
<mat-icon>settings</mat-icon>
|
|
|
|
|
</button>
|
|
|
|
|
<button fxFlex
|
|
|
|
|
type="button"
|
|
|
|
|
mat-raised-button
|
|
|
|
|
color="primary"
|
2022-09-20 18:09:25 +03:00
|
|
|
class="tb-layout-button tb-layout-button-right"
|
2022-11-09 17:56:38 +02:00
|
|
|
(mouseover)="rightLayoutTooltip.show()"
|
|
|
|
|
(mouseleave)="rightLayoutTooltip.hide()"
|
2022-08-15 12:07:24 +03:00
|
|
|
(click)="setFixedLayout('right')"
|
2022-09-20 18:09:25 +03:00
|
|
|
[ngClass]="layoutButtonClass('right')">
|
2022-11-09 17:56:38 +02:00
|
|
|
<span [matTooltip]="layoutButtonText('right')"
|
|
|
|
|
#rightLayoutTooltip="matTooltip"
|
|
|
|
|
matTooltipPosition="above">
|
|
|
|
|
{{ 'layout.right' | translate }}
|
|
|
|
|
</span>
|
2022-08-15 12:07:24 +03:00
|
|
|
</button>
|
2022-09-20 18:09:25 +03:00
|
|
|
<div fxFlex class="tb-layout-preview-element tb-layout-preview-input" *ngIf="showPreviewInputs('right')">
|
|
|
|
|
<input *ngIf="layoutsFormGroup.get('type').value !== layoutWidthType.FIXED"
|
2022-07-27 13:56:11 +03:00
|
|
|
formControlName="rightWidthPercentage"
|
|
|
|
|
type="number"
|
|
|
|
|
step="1"
|
2022-09-20 18:09:25 +03:00
|
|
|
min="{{ layoutPercentageSize.MIN }}"
|
|
|
|
|
max="{{ layoutPercentageSize.MAX }}"
|
2022-08-15 12:07:24 +03:00
|
|
|
required>
|
2022-09-20 18:09:25 +03:00
|
|
|
<input *ngIf="layoutsFormGroup.get('type').value === layoutWidthType.FIXED"
|
2022-08-15 12:07:24 +03:00
|
|
|
formControlName="fixedWidth"
|
|
|
|
|
type="number"
|
|
|
|
|
step="1"
|
2022-09-20 18:09:25 +03:00
|
|
|
min="{{ layoutFixedSize.MIN }}"
|
|
|
|
|
max="{{ layoutFixedSize.MAX }}"
|
2022-08-15 12:07:24 +03:00
|
|
|
required>
|
|
|
|
|
</div>
|
2022-04-05 13:56:44 +03:00
|
|
|
</div>
|
2022-07-27 13:56:11 +03:00
|
|
|
</div>
|
2022-08-15 12:07:24 +03:00
|
|
|
</div>
|
2022-09-20 18:09:25 +03:00
|
|
|
<div fxLayout="column" fxLayoutAlign="center center" fxLayoutGap="8px" *ngIf="layoutsFormGroup.get('right').value" style="width: 80%">
|
|
|
|
|
<mat-slider *ngIf="layoutsFormGroup.get('type').value === layoutWidthType.PERCENTAGE"
|
2022-08-19 13:57:49 +03:00
|
|
|
step="1"
|
2022-09-20 18:09:25 +03:00
|
|
|
min="{{ layoutPercentageSize.MIN }}"
|
|
|
|
|
max="{{ layoutPercentageSize.MAX }}"
|
2022-08-19 13:57:49 +03:00
|
|
|
style="width: 100%;"
|
2022-08-22 13:28:38 +03:00
|
|
|
color="accent"
|
2022-08-19 13:57:49 +03:00
|
|
|
formControlName="sliderPercentage"
|
|
|
|
|
thumbLabel
|
|
|
|
|
[displayWith]="formatSliderTooltipLabel.bind(this)">
|
|
|
|
|
</mat-slider>
|
2022-09-20 18:09:25 +03:00
|
|
|
<mat-slider *ngIf="layoutsFormGroup.get('type').value !== layoutWidthType.PERCENTAGE"
|
2022-08-19 13:57:49 +03:00
|
|
|
step="1"
|
2022-09-20 18:09:25 +03:00
|
|
|
min="{{ layoutFixedSize.MIN }}"
|
|
|
|
|
max="{{ layoutFixedSize.MAX }}"
|
2022-08-19 13:57:49 +03:00
|
|
|
style="width: 100%;"
|
2022-08-22 13:28:38 +03:00
|
|
|
color="accent"
|
2022-08-19 13:57:49 +03:00
|
|
|
formControlName="sliderFixed"
|
|
|
|
|
thumbLabel
|
|
|
|
|
[displayWith]="formatSliderTooltipLabel.bind(this)">
|
|
|
|
|
</mat-slider>
|
|
|
|
|
<div fxLayout="row" fxLayoutAlign="space-between center" class="tb-hint tb-hint-group" style="width: 100%;">
|
2022-09-20 18:09:25 +03:00
|
|
|
<label>
|
|
|
|
|
{{layoutsFormGroup.get('type').value === layoutWidthType.PERCENTAGE ? layoutPercentageSize.MIN + '%' : layoutFixedSize.MIN + 'px'}}
|
|
|
|
|
</label>
|
|
|
|
|
<label>
|
|
|
|
|
{{layoutsFormGroup.get('type').value === layoutWidthType.PERCENTAGE ? layoutPercentageSize.MAX + '%' : layoutFixedSize.MAX + 'px'}}
|
|
|
|
|
</label>
|
2022-04-05 13:56:44 +03:00
|
|
|
</div>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
2022-07-27 13:56:11 +03:00
|
|
|
</div>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
2020-04-21 11:53:26 +03:00
|
|
|
<div mat-dialog-actions fxLayoutAlign="end center">
|
|
|
|
|
<button mat-button
|
|
|
|
|
color="primary"
|
2019-10-31 10:06:57 +02:00
|
|
|
type="button"
|
2020-04-21 11:53:26 +03:00
|
|
|
(click)="cancel()" cdkFocusInitial>
|
2019-10-31 10:06:57 +02:00
|
|
|
{{ 'action.cancel' | translate }}
|
|
|
|
|
</button>
|
2020-10-14 12:32:07 +03:00
|
|
|
<button mat-raised-button color="primary"
|
|
|
|
|
type="submit"
|
2022-07-27 13:56:11 +03:00
|
|
|
[disabled]="layoutsFormGroup.invalid || !layoutsFormGroup.dirty">
|
2020-10-14 12:32:07 +03:00
|
|
|
{{ 'action.save' | translate }}
|
|
|
|
|
</button>
|
2019-10-31 10:06:57 +02:00
|
|
|
</div>
|
|
|
|
|
</form>
|