Refactoring
This commit is contained in:
parent
501df2504c
commit
23ece9c247
@ -39,7 +39,7 @@
|
||||
</mat-toolbar>
|
||||
<mat-tab-group [ngClass]="{'tb-headless': sources.length === 1}" fxFlex
|
||||
[(selectedIndex)]="sourceIndex" (selectedIndexChange)="onSourceIndexChanged()">
|
||||
<mat-tab *ngFor="let source of sources; trackBy: trackBySourcesIndex; let index = index;" label="{{getTabLabel(source, this.useDeviceLabel)}}">
|
||||
<mat-tab *ngFor="let source of sources; trackBy: trackBySourcesIndex; let index = index;" label="{{getTabLabel(source)}}">
|
||||
<ng-template [ngIf]="isActiveTab(index)">
|
||||
<div fxFlex class="table-container">
|
||||
<table mat-table [dataSource]="source.timeseriesDatasource" [trackBy]="trackByRowTimestamp"
|
||||
|
||||
@ -129,7 +129,7 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
|
||||
private defaultSortOrder = '-0';
|
||||
private hideEmptyLines = false;
|
||||
public showTimestamp = true;
|
||||
public useDeviceLabel = false;
|
||||
private useDeviceLabel = false;
|
||||
private dateFormatFilter: string;
|
||||
|
||||
private rowStylesInfo: RowStyleInfo;
|
||||
@ -234,9 +234,9 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI
|
||||
this.updateDatasources();
|
||||
}
|
||||
|
||||
public getTabLabel(source, useDeviceLabel){
|
||||
if(useDeviceLabel){
|
||||
return source.datasource.entityLabel ? source.datasource.entityLabel : source.datasource.entityName;
|
||||
public getTabLabel(source){
|
||||
if(this.useDeviceLabel){
|
||||
return source.datasource.entityLabel || source.datasource.entityName;
|
||||
} else {
|
||||
return source.datasource.entityName;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user