Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 0500e21

Browse files
oodamienBoykoAlex
authored andcommitted
Analytics UI
Resolves #802
1 parent c38ae12 commit 0500e21

File tree

5 files changed

+197
-137
lines changed

5 files changed

+197
-137
lines changed
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
<h1>Analytics</h1>
2-
<p [hidden]="!router.isActive('/analytics/dashboard', true)">
3-
This section displays dashboard for the metrics data from various counter apps.
4-
</p>
5-
<p [hidden]="!router.isActive('/analytics/counters', true)">
6-
This section displays counters and their values.
7-
</p>
8-
1+
<div class="heading">
2+
<div class="description">
3+
<h1>Analytics</h1>
4+
<p [hidden]="!router.isActive('/analytics/dashboard', true)">
5+
This section displays dashboard for the metrics data from various counter apps.
6+
</p>
7+
<p [hidden]="!router.isActive('/analytics/counters', true)">
8+
This section displays counters and their values.
9+
</p>
10+
</div>
11+
</div>
912
<div class="tab-simple">
1013
<ul class="nav nav-tabs">
1114
<li role="presentation" routerLinkActive="active"><a routerLink="dashboard">Dashboard</a></li>
1215
<li role="presentation" routerLinkActive="active"><a routerLink="counters">Counters</a></li>
1316
</ul>
1417
<div class="tab-content">
15-
<div class="tab-pane in active"><router-outlet></router-outlet></div>
18+
<div class="tab-pane in active">
19+
<router-outlet></router-outlet>
20+
</div>
1621
</div>
1722
</div>
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { NgModule } from '@angular/core';
22
import { SharedModule } from '../shared/shared.module';
3-
43
import { AnalyticsComponent } from './analytics.component';
54
import { CountersComponent } from './counters/counters.component';
65
import { DashboardComponent } from './dashboard/dashboard.component';
7-
86
import { AnalyticsService } from './analytics.service';
97
import { AnalyticsRoutingModule } from './analytics-routing.module';
108
import { BarChartComponent } from './charts/bar-chart/bar-chart.component';
@@ -13,10 +11,17 @@ import { GraphChartComponent } from './charts/graph-chart/graph-chart.component'
1311
import { CounterHeaderComponent } from './components/counter-header.component';
1412
import { PieChartComponent } from './charts/pie-chart/pie-chart.component';
1513

14+
/**
15+
* Analytics Module
16+
*/
1617
import { TooltipModule } from 'ngx-bootstrap/tooltip';
1718

1819
@NgModule({
19-
imports: [ AnalyticsRoutingModule, SharedModule, TooltipModule.forRoot() ],
20+
imports: [
21+
AnalyticsRoutingModule,
22+
SharedModule,
23+
TooltipModule.forRoot()
24+
],
2025
declarations: [
2126
AnalyticsComponent,
2227
BarChartComponent,
@@ -27,6 +32,9 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip';
2732
GraphChartComponent,
2833
PieChartComponent
2934
],
30-
providers: [ AnalyticsService ]
35+
providers: [
36+
AnalyticsService
37+
]
3138
})
32-
export class AnalyticsModule { }
39+
export class AnalyticsModule {
40+
}
Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
1-
<form #refreshRateForm="ngForm" class="form-inline" name="refreshRateForm" role="form" (ngSubmit)="changeRefreshRate()" novalidate>
1+
<form #refreshRateForm="ngForm" class="form-inline" name="refreshRateForm" role="form" (ngSubmit)="changeRefreshRate()"
2+
novalidate>
23
<div class="form-group">
34
<label for="refreshRateFormField" style="display: inline">Update [seconds]:</label>
4-
<input #refreshRateFormField2="ngModel" type="number" id="refreshRateFormField" name="refreshRateFormField" autofocus [(ngModel)]="refreshRateFormField" required
5-
class="form-control" placeholder="Inerval in seconds" style="width: 150px"/>
5+
<input #refreshRateFormField2="ngModel" type="number" id="refreshRateFormField" name="refreshRateFormField"
6+
autofocus [(ngModel)]="refreshRateFormField" required
7+
class="form-control input-sm" placeholder="Inerval in seconds" style="width: 100px"/>
68
<span class="help-block" *ngIf="refreshRateFormField2.invalid && refreshRateFormField2.touched">Please provide a valid polling interval (0-1000s).</span>
79
</div>
8-
<button type="submit" [disabled]="refreshRateForm.invalid"
9-
class="btn btn-default">Update <span class="glyphicon glyphicon-arrow-right"></span></button>
10+
<button type="submit" [disabled]="refreshRateForm.invalid" style="margin-top: 1px;margin-left:2px"
11+
class="btn btn-primary">Update
12+
</button>
1013
</form>
11-
<div *ngIf="!counters || counters.items.length === 0">No counters available.</div>
14+
15+
<hr>
16+
17+
<div *ngIf="!counters || counters.items.length === 0">
18+
<div class="alert alert-warning" style="display:inline-block;margin:0 auto">
19+
No counters available.
20+
</div>
21+
</div>
22+
1223
<table *ngIf="counters?.items && counters.items.length > 0" class="table table-hover">
1324
<thead>
14-
<tr>
15-
<th style="width: 100px">Stream</th>
16-
<th style="width: 100px">Value</th>
17-
<th style="width: 100px">Latest [counts/second]</th>
18-
<th style="width: 300px">Rate [counts/second]</th>
19-
</tr>
25+
<tr>
26+
<th style="width: 100px">Stream</th>
27+
<th style="width: 100px">Value</th>
28+
<th style="width: 100px">Latest [counts/second]</th>
29+
<th style="width: 300px">Rate [counts/second]</th>
30+
</tr>
2031
</thead>
2132
<tbody>
22-
<tr *ngFor="let item of counters.items | paginate: counters.getPaginationInstance(); index as i; trackBy: trackByIndex">
33+
<tr
34+
*ngFor="let item of counters.items | paginate: counters.getPaginationInstance(); index as i; trackBy: trackByIndex">
2335
<td>{{ item.name }}</td>
2436
<td>{{ item.value }}</td>
2537
<td>{{ item.latestRate }}</td>
2638
<td>
2739
<app-graph-chart [chartData]="item.rates" [height]="140" [total]="totalCacheSize()"
28-
[reverse]="true" [axisUnitsX]="'seconds ago'" [axisUnitsY]="'counts'"
29-
[unitsPerTickX]="refreshRate"></app-graph-chart>
40+
[reverse]="true" [axisUnitsX]="'seconds ago'" [axisUnitsY]="'counts'"
41+
[unitsPerTickX]="refreshRate"></app-graph-chart>
3042
</td>
3143
</tr>
3244
</tbody>
3345
</table>
34-
<pagination-controls *ngIf="counters?.items && counters?.items.length > 0" (pageChange)="getPage($event)"></pagination-controls>
46+
<pagination-controls *ngIf="counters?.items && counters?.items.length > 0"
47+
(pageChange)="getPage($event)"></pagination-controls>
3548

0 commit comments

Comments
 (0)