]> git.apps.os.sepia.ceph.com Git - ceph.git/blob
e6eaf5db4100c4af687514484e1eb2461a7d7f03
[ceph.git] /
1 import { Component } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3
4 @Component({
5   selector: 'cd-performance-counter',
6   templateUrl: './performance-counter.component.html',
7   styleUrls: ['./performance-counter.component.scss']
8 })
9 export class PerformanceCounterComponent {
10   static defaultFromLink = '/hosts';
11
12   serviceId: string;
13   serviceType: string;
14   fromLink: string;
15
16   constructor(private route: ActivatedRoute) {
17     this.route.queryParams.subscribe((params: { fromLink: string }) => {
18       this.fromLink = params.fromLink || PerformanceCounterComponent.defaultFromLink;
19     });
20     this.route.params.subscribe((params: { type: string; id: string }) => {
21       this.serviceId = params.id;
22       this.serviceType = params.type;
23     });
24   }
25 }