]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.ts
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / ceph / rgw / rgw-501 / rgw-501.component.ts
1 import { Component, OnDestroy, OnInit } from '@angular/core';
2 import { ActivatedRoute } from '@angular/router';
3
4 import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
5 import { SummaryService } from '../../../shared/services/summary.service';
6
7 @Component({
8 selector: 'cd-rgw-501',
9 templateUrl: './rgw-501.component.html',
10 styleUrls: ['./rgw-501.component.scss']
11 })
12 export class Rgw501Component implements OnInit, OnDestroy {
13 docsUrl: string;
14 message = 'The Object Gateway service is not configured.';
15 routeParamsSubscribe: any;
16
17 constructor(
18 private route: ActivatedRoute,
19 private summaryService: SummaryService,
20 private cephReleaseNamePipe: CephReleaseNamePipe
21 ) {}
22
23 ngOnInit() {
24 const subs = this.summaryService.subscribe((summary: any) => {
25 if (!summary) {
26 return;
27 }
28
29 const releaseName = this.cephReleaseNamePipe.transform(summary.version);
30 this.docsUrl =
31 `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/` +
32 `#enabling-the-object-gateway-management-frontend`;
33
34 setTimeout(() => {
35 subs.unsubscribe();
36 }, 0);
37 });
38
39 this.routeParamsSubscribe = this.route.params.subscribe((params: { message: string }) => {
40 this.message = params.message;
41 });
42 }
43
44 ngOnDestroy() {
45 this.routeParamsSubscribe.unsubscribe();
46 }
47 }