diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.ts new file mode 100644 index 000000000..9321e0e9a --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/performance-counter/performance-counter/performance-counter.component.ts @@ -0,0 +1,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; + }); + } +} |