Browse Source

test

pull/11187/head
ThingsBoard 2 years ago
parent
commit
1804cb18e6
  1. 16
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-statistics.component.html
  2. 5
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-statistics.component.scss
  3. 6
      ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-statistics.component.ts
  4. 1
      ui-ngx/src/assets/locale/locale.constant-en_US.json
  5. 3
      ui-ngx/src/styles.scss

16
ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-statistics.component.html

@ -30,8 +30,11 @@
</mat-form-field>
<mat-error
*ngIf="!statisticsKeys.length && !commands.length">
{{'gateway.statistics.statistic-commands-empty' | translate }}
{{ 'gateway.statistics.statistic-commands-empty' | translate }}
</mat-error>
<button mat-flat-button class="mat-mdc-icon-button tb-mat-185" color="primary" (click)="navigateToStatistics()">
{{ 'gateway.statistics.statistics-button' | translate }}
</button>
<mat-form-field class="mat-block" *ngIf="commandObj">
<mat-label>{{ 'gateway.statistics.command' | translate }}</mat-label>
<input matInput [value]="commandObj.command" disabled>
@ -42,14 +45,17 @@
<table [fxShow]="!isNumericData" mat-table [dataSource]="dataSource"
matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="pageLink.sortDirection()"
matSortDisableClear>
<ng-container matColumnDef="0">
<mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'widgets.gateway.created-time' | translate }}</mat-header-cell>
<ng-container matColumnDef="0">test
<mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'widgets.gateway.created-time' | translate }}
</mat-header-cell>
<mat-cell *matCellDef="let row; let rowIndex = index">
{{row[0]| date:'yyyy-MM-dd HH:mm:ss' }}
{{ row[0]| date:'yyyy-MM-dd HH:mm:ss' }}
</mat-cell>
</ng-container>
<ng-container matColumnDef="1">
<mat-header-cell *matHeaderCellDef mat-sort-header style="width: 70%">{{ 'widgets.gateway.message' | translate }}</mat-header-cell>
<mat-header-cell *matHeaderCellDef mat-sort-header
style="width: 70%">{{ 'widgets.gateway.message' | translate }}
</mat-header-cell>
<mat-cell *matCellDef="let row">
{{ row[1] }}
</mat-cell>

5
ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-statistics.component.scss

@ -36,6 +36,11 @@
}
}
.mat-mdc-icon-button {
height: 40px;
margin-top: 22px;
}
.chart-box, .chart-container {
height: 100%;
flex-grow: 1;

6
ui-ngx/src/app/modules/home/components/widget/lib/gateway/gateway-statistics.component.ts

@ -32,6 +32,7 @@ import { Direction, SortOrder } from '@shared/models/page/sort-order';
import { MatTableDataSource } from '@angular/material/table';
import { MatSort } from '@angular/material/sort';
import { NULL_UUID } from '@shared/models/id/has-uuid';
import {deepClone} from "@core/utils";
@Component({
selector: 'tb-gateway-statistics',
@ -135,6 +136,11 @@ export class GatewayStatisticsComponent implements AfterViewInit {
}
}
public navigateToStatistics() {
const params = deepClone(this.ctx.stateController.getStateParams());
this.ctx.stateController.openState('configuration', params);
}
public sortData() {
this.dataSource.sortData(this.dataSource.data, this.sort);
}

1
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -3152,6 +3152,7 @@
"statistic": "Statistic",
"statistics": "Statistics",
"statistic-commands-empty": "No configured statistic keys found. You can configure them in \"Statistics\" tab in general configuration.",
"statistics-button": "Go to configuration",
"commands": "Commands",
"send-period": "Statistic send period (in sec)",
"send-period-required": "Statistic send period is required",

3
ui-ngx/src/styles.scss

@ -941,6 +941,9 @@ mat-icon {
&.tb-mat-96 {
@include tb-mat-icon-button-size(96);
}
&.tb-mat-185 {
@include tb-mat-icon-button-size(185);
}
}
.mat-mdc-snack-bar-container {

Loading…
Cancel
Save