2025-04-25 17:56:36 +03:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
Copyright © 2016-2025 The Thingsboard Authors
|
|
|
|
|
|
|
|
|
|
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-convert-settings-panel">
|
2025-04-29 15:35:18 +03:00
|
|
|
<div class="tb-convert-settings-title" translate>unit.convert.units-conversion-settings</div>
|
2025-04-25 17:56:36 +03:00
|
|
|
<div class="tb-convert-settings-panel-content" [formGroup]="convertUnitForm">
|
|
|
|
|
<div class="tb-form-row">
|
2025-04-29 15:35:18 +03:00
|
|
|
<div class="min-w-25" [class.tb-disabled-label]="convertUnitForm.get('from').disabled" translate>unit.convert.convert-from</div>
|
|
|
|
|
<tb-unit-input #unitFrom class="flex-1" [required]="required" formControlName="from"></tb-unit-input>
|
2025-04-25 17:56:36 +03:00
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-row">
|
|
|
|
|
<mat-slide-toggle class="mat-slide fixed-title-width" formControlName="convertUnit">
|
2025-04-29 15:35:18 +03:00
|
|
|
<div tb-hint-tooltip-icon="{{ 'unit.convert.convert-unit-hint' | translate }}">
|
|
|
|
|
{{ 'unit.convert.convert-unit' | translate }}
|
|
|
|
|
</div>
|
2025-04-25 17:56:36 +03:00
|
|
|
</mat-slide-toggle>
|
|
|
|
|
</div>
|
2025-04-29 15:35:18 +03:00
|
|
|
<div class="tb-form-row">
|
|
|
|
|
<div class="min-w-25" [class.tb-disabled-label]="convertUnitForm.get('METRIC').disabled" translate>unit.convert.to-metric</div>
|
|
|
|
|
<tb-unit-input class="flex-1"
|
|
|
|
|
formControlName="METRIC"
|
|
|
|
|
[unitSystem]="UnitSystem.METRIC"
|
|
|
|
|
[measure]="measure">
|
|
|
|
|
</tb-unit-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-row">
|
|
|
|
|
<div class="min-w-25" [class.tb-disabled-label]="convertUnitForm.get('IMPERIAL').disabled" translate>unit.convert.to-imperial</div>
|
|
|
|
|
<tb-unit-input class="flex-1"
|
|
|
|
|
formControlName="IMPERIAL"
|
|
|
|
|
[unitSystem]="UnitSystem.IMPERIAL"
|
|
|
|
|
[measure]="measure">
|
|
|
|
|
</tb-unit-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="tb-form-row">
|
|
|
|
|
<div class="min-w-25" [class.tb-disabled-label]="convertUnitForm.get('HYBRID').disabled" translate>unit.convert.to-imperial</div>
|
|
|
|
|
<tb-unit-input class="flex-1"
|
|
|
|
|
formControlName="HYBRID"
|
|
|
|
|
[measure]="measure">
|
|
|
|
|
</tb-unit-input>
|
|
|
|
|
</div>
|
2025-04-25 17:56:36 +03:00
|
|
|
</div>
|
|
|
|
|
<div class="tb-convert-settings-panel-buttons">
|
|
|
|
|
<button mat-button
|
|
|
|
|
color="primary"
|
|
|
|
|
type="button"
|
|
|
|
|
(click)="cancel()">
|
2025-04-29 15:35:18 +03:00
|
|
|
{{ (disabled ? 'action.close': 'action.cancel') | translate }}
|
2025-04-25 17:56:36 +03:00
|
|
|
</button>
|
|
|
|
|
<button mat-raised-button
|
|
|
|
|
color="primary"
|
|
|
|
|
type="button"
|
2025-04-29 15:35:18 +03:00
|
|
|
*ngIf="!disabled"
|
2025-04-25 17:56:36 +03:00
|
|
|
(click)="applyUnitSettings()"
|
|
|
|
|
[disabled]="convertUnitForm.invalid || convertUnitForm.pristine">
|
|
|
|
|
{{ 'action.apply' | translate }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|