]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts
import 15.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / components / grafana / grafana.component.ts
index 4c4b5ecedfa2d0e462eca0de00bb90f1cff0f8f0..7d8c49095bdc98b786b5da7f2be5fbdd5317bb19 100644 (file)
@@ -4,8 +4,6 @@ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
 import { I18n } from '@ngx-translate/i18n-polyfill';
 
 import { Icons } from '../../../shared/enum/icons.enum';
-import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
-import { SummaryService } from '../../../shared/services/summary.service';
 import { SettingsService } from '../../api/settings.service';
 
 @Component({
@@ -38,13 +36,9 @@ export class GrafanaComponent implements OnInit, OnChanges {
   @Input()
   uid: string;
 
-  docsUrl: string;
-
   constructor(
-    private summaryService: SummaryService,
     private sanitizer: DomSanitizer,
     private settingsService: SettingsService,
-    private cephReleaseNamePipe: CephReleaseNamePipe,
     private i18n: I18n
   ) {
     this.grafanaTimes = [
@@ -84,10 +78,6 @@ export class GrafanaComponent implements OnInit, OnChanges {
         name: this.i18n('Yesterday'),
         value: 'from=now-1d%2Fd&to=now-1d%2Fd'
       },
-      {
-        name: this.i18n('Today'),
-        value: 'from=now%2Fd&to=now%2Fd'
-      },
       {
         name: this.i18n('Today so far'),
         value: 'from=now%2Fd&to=now'
@@ -108,10 +98,6 @@ export class GrafanaComponent implements OnInit, OnChanges {
         name: this.i18n('Previous week'),
         value: 'from=now-1w%2Fw&to=now-1w%2Fw'
       },
-      {
-        name: this.i18n('This week'),
-        value: 'from=now%2Fw&to=now%2Fw'
-      },
       {
         name: this.i18n('This week so far'),
         value: 'from=now%2Fw&to=now'
@@ -124,10 +110,6 @@ export class GrafanaComponent implements OnInit, OnChanges {
         name: this.i18n('Previous month'),
         value: 'from=now-1M%2FM&to=now-1M%2FM'
       },
-      {
-        name: this.i18n('This month'),
-        value: 'from=now%2FM&to=now%2FM'
-      },
       {
         name: this.i18n('This month so far'),
         value: 'from=now%2FM&to=now'
@@ -152,10 +134,6 @@ export class GrafanaComponent implements OnInit, OnChanges {
         name: this.i18n('Previous year'),
         value: 'from=now-1y%2Fy&to=now-1y%2Fy'
       },
-      {
-        name: this.i18n('This year'),
-        value: 'from=now%2Fy&to=now%2Fy'
-      },
       {
         name: this.i18n('This year so far'),
         value: 'from=now%2Fy&to=now'
@@ -179,20 +157,6 @@ export class GrafanaComponent implements OnInit, OnChanges {
       three: 'grafana_three'
     };
 
-    const subs = this.summaryService.subscribe((summary: any) => {
-      if (!summary) {
-        return;
-      }
-
-      const releaseName = this.cephReleaseNamePipe.transform(summary.version);
-      this.docsUrl =
-        `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/` +
-        `#enabling-the-embedding-of-grafana-dashboards`;
-
-      setTimeout(() => {
-        subs.unsubscribe();
-      }, 0);
-    });
     this.settingsService.ifSettingConfigured('api/grafana/url', (url) => {
       this.grafanaExist = true;
       this.loading = false;