data.in_quorum.map((row) => {
row.cdOpenSessions = row.stats.num_sessions.map(i => i[1]);
row.cdLink = '/perf_counters/mon/' + row.name;
+ row.cdParams = {fromLink: '/monitor'};
return row;
});
data.out_quorum.map((row) => {
row.cdLink = '/perf_counters/mon/' + row.name;
+ row.cdParams = {fromLink: '/monitor'};
return row;
});
+<nav aria-label="breadcrumb">
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item">Cluster</li>
+ <li class="breadcrumb-item">
+ <a [routerLink]="fromLink">
+ <span *ngIf="fromLink === '/monitor'">Monitors</span>
+ <span *ngIf="fromLink === '/hosts'">Hosts</span>
+ </a>
+ </li>
+ <li class="breadcrumb-item active"
+ i18n>Performance Counters</li>
+ </ol>
+</nav>
+
<fieldset>
- <legend i18n>Performance Counters</legend>
- <h3>{{ serviceType }}.{{ serviceId }}</h3>
+ <legend>{{ serviceType }}.{{ serviceId }}</legend>
<cd-table-performance-counter [serviceType]="serviceType"
[serviceId]="serviceId">
</cd-table-performance-counter>
styleUrls: ['./performance-counter.component.scss']
})
export class PerformanceCounterComponent {
+
+ static defaultFromLink = '/hosts';
+
serviceId: string;
serviceType: string;
+ fromLink: string;
constructor(private route: ActivatedRoute) {
+ this.route.queryParams.subscribe(
+ (params: { fromLink: string }) => {
+ this.fromLink = params.fromLink || PerformanceCounterComponent.defaultFromLink;
+ }
+ );
this.route.params.subscribe(
(params: { type: string; id: string }) => {
this.serviceId = params.id;