Browse Source

Refactoring

pull/4501/head
Kalutka Zhenya 5 years ago
parent
commit
23ece9c247
  1. 2
      ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html
  2. 8
      ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts

2
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html

@ -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"

8
ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts

@ -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…
Cancel
Save