blob: 9321e0e9aae86d82426d5cc195e50b05f446bd60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'cd-performance-counter',
templateUrl: './performance-counter.component.html',
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 = decodeURIComponent(params.id);
this.serviceType = params.type;
});
}
}
|