This PR refactors the /monitoring page by introducing a new component which is responsible for rendering the tabs. All tabs have a dedicated route/URL now, no fragments are used anymore, thus they will act like the iSCSI and RBD pages.
Fixes: https://tracker.ceph.com/issues/45375
Signed-off-by: Volker Theile <vtheile@suse.com>
import { MonitorComponent } from './ceph/cluster/monitor/monitor.component';
import { OsdFormComponent } from './ceph/cluster/osd/osd-form/osd-form.component';
import { OsdListComponent } from './ceph/cluster/osd/osd-list/osd-list.component';
-import { MonitoringListComponent } from './ceph/cluster/prometheus/monitoring-list/monitoring-list.component';
+import { ActiveAlertListComponent } from './ceph/cluster/prometheus/active-alert-list/active-alert-list.component';
+import { RulesListComponent } from './ceph/cluster/prometheus/rules-list/rules-list.component';
import { SilenceFormComponent } from './ceph/cluster/prometheus/silence-form/silence-form.component';
+import { SilenceListComponent } from './ceph/cluster/prometheus/silence-list/silence-list.component';
import { ServicesComponent } from './ceph/cluster/services/services.component';
import { TelemetryComponent } from './ceph/cluster/telemetry/telemetry.component';
import { DashboardComponent } from './ceph/dashboard/dashboard/dashboard.component';
path: 'monitoring',
data: { breadcrumbs: 'Cluster/Monitoring' },
children: [
+ { path: '', redirectTo: 'active-alerts', pathMatch: 'full' },
{
- path: '',
- component: MonitoringListComponent
- },
- {
- path: 'silence/' + URLVerbs.CREATE,
- component: SilenceFormComponent,
- data: { breadcrumbs: `${ActionLabels.CREATE} Silence` }
+ path: 'active-alerts',
+ data: { breadcrumbs: 'Active Alerts' },
+ component: ActiveAlertListComponent
},
{
- path: `silence/${URLVerbs.CREATE}/:id`,
- component: SilenceFormComponent,
- data: { breadcrumbs: ActionLabels.CREATE }
- },
- {
- path: `silence/${URLVerbs.EDIT}/:id`,
- component: SilenceFormComponent,
- data: { breadcrumbs: ActionLabels.EDIT }
+ path: 'alerts',
+ data: { breadcrumbs: 'Alerts' },
+ component: RulesListComponent
},
{
- path: `silence/${URLVerbs.RECREATE}/:id`,
- component: SilenceFormComponent,
- data: { breadcrumbs: ActionLabels.RECREATE }
+ path: 'silences',
+ data: { breadcrumbs: 'Silences' },
+ children: [
+ {
+ path: '',
+ component: SilenceListComponent
+ },
+ {
+ path: URLVerbs.CREATE,
+ component: SilenceFormComponent,
+ data: { breadcrumbs: `${ActionLabels.CREATE} Silence` }
+ },
+ {
+ path: `${URLVerbs.CREATE}/:id`,
+ component: SilenceFormComponent,
+ data: { breadcrumbs: ActionLabels.CREATE }
+ },
+ {
+ path: `${URLVerbs.EDIT}/:id`,
+ component: SilenceFormComponent,
+ data: { breadcrumbs: ActionLabels.EDIT }
+ },
+ {
+ path: `${URLVerbs.RECREATE}/:id`,
+ component: SilenceFormComponent,
+ data: { breadcrumbs: ActionLabels.RECREATE }
+ }
+ ]
}
]
},
import { OsdReweightModalComponent } from './osd/osd-reweight-modal/osd-reweight-modal.component';
import { OsdScrubModalComponent } from './osd/osd-scrub-modal/osd-scrub-modal.component';
import { ActiveAlertListComponent } from './prometheus/active-alert-list/active-alert-list.component';
-import { MonitoringListComponent } from './prometheus/monitoring-list/monitoring-list.component';
+import { PrometheusTabsComponent } from './prometheus/prometheus-tabs/prometheus-tabs.component';
import { RulesListComponent } from './prometheus/rules-list/rules-list.component';
import { SilenceFormComponent } from './prometheus/silence-form/silence-form.component';
import { SilenceListComponent } from './prometheus/silence-list/silence-list.component';
LogsComponent,
OsdRecvSpeedModalComponent,
OsdPgScrubModalComponent,
- ActiveAlertListComponent,
OsdRecvSpeedModalComponent,
SilenceFormComponent,
SilenceListComponent,
OsdCreationPreviewModalComponent,
RulesListComponent,
ActiveAlertListComponent,
- MonitoringListComponent,
HostFormComponent,
ServiceDetailsComponent,
ServiceDaemonListComponent,
- TelemetryComponent
+ TelemetryComponent,
+ PrometheusTabsComponent
]
})
export class ClusterModule {}
-<cd-table [data]="prometheusAlertService.alerts"
+<cd-prometheus-tabs></cd-prometheus-tabs>
+
+<cd-alert-panel *ngIf="!isAlertmanagerConfigured"
+ type="info"
+ i18n>To see all active Prometheus alerts, please
+ provide the URL to the API of Prometheus' Alertmanager as described
+ in the <a href="{{docsUrl}}"
+ target="_blank">documentation</a>.
+</cd-alert-panel>
+
+<cd-table *ngIf="isAlertmanagerConfigured"
+ [data]="prometheusAlertService.alerts"
[columns]="columns"
identifier="fingerprint"
[forceIdentifier]="true"
-import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core';
+import { Component, Inject, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { I18n } from '@ngx-translate/i18n-polyfill';
-import { ListWithDetails } from '../../../../shared/classes/list-with-details.class';
+import { PrometheusService } from '../../../../shared/api/prometheus.service';
import { CellTemplate } from '../../../../shared/enum/cell-template.enum';
import { Icons } from '../../../../shared/enum/icons.enum';
import { CdTableAction } from '../../../../shared/models/cd-table-action';
import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
import { Permission } from '../../../../shared/models/permissions';
import { CdDatePipe } from '../../../../shared/pipes/cd-date.pipe';
+import { CephReleaseNamePipe } from '../../../../shared/pipes/ceph-release-name.pipe';
import { AuthStorageService } from '../../../../shared/services/auth-storage.service';
import { PrometheusAlertService } from '../../../../shared/services/prometheus-alert.service';
+import { SummaryService } from '../../../../shared/services/summary.service';
import { URLBuilderService } from '../../../../shared/services/url-builder.service';
+import { PrometheusListHelper } from '../prometheus-list-helper';
-const BASE_URL = 'silence'; // as only silence actions can be used
+const BASE_URL = 'silences'; // as only silence actions can be used
@Component({
selector: 'cd-active-alert-list',
templateUrl: './active-alert-list.component.html',
styleUrls: ['./active-alert-list.component.scss']
})
-export class ActiveAlertListComponent extends ListWithDetails implements OnInit {
+export class ActiveAlertListComponent extends PrometheusListHelper implements OnInit {
@ViewChild('externalLinkTpl', { static: true })
externalLinkTpl: TemplateRef<any>;
columns: CdTableColumn[];
public prometheusAlertService: PrometheusAlertService,
private urlBuilder: URLBuilderService,
private i18n: I18n,
- private cdDatePipe: CdDatePipe
+ private cdDatePipe: CdDatePipe,
+ @Inject(PrometheusService) prometheusService: PrometheusService,
+ @Inject(SummaryService) summaryService: SummaryService,
+ @Inject(CephReleaseNamePipe) cephReleaseNamePipe: CephReleaseNamePipe
) {
- super();
+ super(prometheusService, summaryService, cephReleaseNamePipe);
this.permission = this.authStorageService.getPermissions().prometheus;
this.tableActions = [
{
}
ngOnInit() {
+ super.ngOnInit();
this.columns = [
{
name: this.i18n('Name'),
+++ /dev/null
-<ul ngbNav
- #nav="ngbNav"
- [activeId]="route.snapshot.fragment"
- (navChange)="setFragment($event.nextId)"
- class="nav-tabs">
- <li ngbNavItem="active-alerts">
- <a ngbNavLink
- i18n>Active Alerts</a>
- <ng-template ngbNavContent>
- <cd-active-alert-list *ngIf="isAlertmanagerConfigured"></cd-active-alert-list>
- <cd-alert-panel type="info"
- i18n
- *ngIf="!isAlertmanagerConfigured">To see all active Prometheus alerts, please
- provide the URL to the API of Prometheus' Alertmanager as described in the
- <a href="{{docsUrl}}"
- target="_blank">documentation</a>.</cd-alert-panel>
- </ng-template>
- </li>
- <li ngbNavItem="all-alerts">
- <a ngbNavLink
- i18n>All Alerts</a>
- <ng-template ngbNavContent>
- <cd-rules-list *ngIf="isPrometheusConfigured"
- [data]="prometheusAlertService.rules"></cd-rules-list>
- <cd-alert-panel type="info"
- *ngIf="!isPrometheusConfigured">To see all configured Prometheus alerts,
- please provide the URL to
- the API of Prometheus as described in the
- <a href="{{docsUrl}}"
- target="_blank">documentation</a>.</cd-alert-panel>
- </ng-template>
- </li>
- <li ngbNavItem="silences">
- <a ngbNavLink
- i18n>Silences</a>
- <ng-template ngbNavContent>
- <cd-silences-list *ngIf="isAlertmanagerConfigured"></cd-silences-list>
- <cd-alert-panel *ngIf="!isAlertmanagerConfigured"
- type="info"
- i18n>To enable Silences, please provide the URL to the API of the Prometheus' Alertmanager as
- described in the
- <a href="{{docsUrl}}"
- target="_blank">documentation</a>.</cd-alert-panel>
- </ng-template>
- </li>
-</ul>
-
-<div [ngbNavOutlet]="nav"></div>
+++ /dev/null
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { ToastrModule } from 'ngx-toastr';
-
-import { i18nProviders } from '../../../../../testing/unit-test-helper';
-import { AuthModule } from '../../../../core/auth/auth.module';
-import { CoreModule } from '../../../../core/core.module';
-import { CephfsModule } from '../../../cephfs/cephfs.module';
-import { DashboardModule } from '../../../dashboard/dashboard.module';
-import { NfsModule } from '../../../nfs/nfs.module';
-import { ClusterModule } from '../../cluster.module';
-import { MonitoringListComponent } from './monitoring-list.component';
-
-describe('MonitoringListComponent', () => {
- let component: MonitoringListComponent;
- let fixture: ComponentFixture<MonitoringListComponent>;
-
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [
- ClusterModule,
- DashboardModule,
- CephfsModule,
- AuthModule,
- NfsModule,
- CoreModule,
- ToastrModule.forRoot(),
- HttpClientTestingModule
- ],
- declarations: [],
- providers: [i18nProviders]
- }).compileComponents();
- }));
-
- beforeEach(() => {
- fixture = TestBed.createComponent(MonitoringListComponent);
- component = fixture.componentInstance;
- fixture.detectChanges();
- });
-
- it('should create', () => {
- expect(component).toBeTruthy();
- });
-});
+++ /dev/null
-import { Component, OnInit } from '@angular/core';
-import { ActivatedRoute, Router } from '@angular/router';
-
-import { PrometheusService } from '../../../../shared/api/prometheus.service';
-import { CephReleaseNamePipe } from '../../../../shared/pipes/ceph-release-name.pipe';
-import { PrometheusAlertService } from '../../../../shared/services/prometheus-alert.service';
-import { SummaryService } from '../../../../shared/services/summary.service';
-
-@Component({
- selector: 'cd-monitoring-list',
- templateUrl: './monitoring-list.component.html',
- styleUrls: ['./monitoring-list.component.scss']
-})
-export class MonitoringListComponent implements OnInit {
- constructor(
- public prometheusAlertService: PrometheusAlertService,
- private prometheusService: PrometheusService,
- public route: ActivatedRoute,
- private router: Router,
- private summaryService: SummaryService,
- private cephReleaseNamePipe: CephReleaseNamePipe
- ) {}
- isPrometheusConfigured = false;
- isAlertmanagerConfigured = false;
-
- docsUrl = '';
-
- ngOnInit() {
- this.prometheusService.ifAlertmanagerConfigured(() => {
- this.isAlertmanagerConfigured = true;
- });
- this.prometheusService.ifPrometheusConfigured(() => {
- this.isPrometheusConfigured = true;
- });
-
- this.summaryService.subscribeOnce((summary) => {
- const releaseName = this.cephReleaseNamePipe.transform(summary.version);
- this.docsUrl = `https://docs.ceph.com/docs/${releaseName}/mgr/dashboard/#enabling-prometheus-alerting`;
- });
- }
-
- setFragment(element: string) {
- this.router.navigate([], { fragment: element });
- }
-}
--- /dev/null
+import { OnInit } from '@angular/core';
+
+import { PrometheusService } from '../../../shared/api/prometheus.service';
+import { ListWithDetails } from '../../../shared/classes/list-with-details.class';
+import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
+import { SummaryService } from '../../../shared/services/summary.service';
+
+export class PrometheusListHelper extends ListWithDetails implements OnInit {
+ public isPrometheusConfigured = false;
+ public isAlertmanagerConfigured = false;
+ public docsUrl = '';
+
+ constructor(
+ protected prometheusService: PrometheusService,
+ protected summaryService: SummaryService,
+ protected cephReleaseNamePipe: CephReleaseNamePipe
+ ) {
+ super();
+ }
+
+ ngOnInit() {
+ this.prometheusService.ifAlertmanagerConfigured(() => {
+ this.isAlertmanagerConfigured = true;
+ });
+ this.prometheusService.ifPrometheusConfigured(() => {
+ this.isPrometheusConfigured = true;
+ });
+ this.summaryService.subscribeOnce((summary) => {
+ const releaseName = this.cephReleaseNamePipe.transform(summary.version);
+ this.docsUrl = `https://docs.ceph.com/docs/${releaseName}/mgr/dashboard/#enabling-prometheus-alerting`;
+ });
+ }
+}
--- /dev/null
+<ul ngbNav
+ #nav="ngbNav"
+ [activeId]="router.url"
+ (navChange)="router.navigate([$event.nextId])"
+ class="nav-tabs">
+ <li ngbNavItem="/monitoring/active-alerts">
+ <a ngbNavLink
+ i18n>Active Alerts</a>
+ </li>
+ <li ngbNavItem="/monitoring/alerts">
+ <a ngbNavLink
+ i18n>Alerts</a>
+ </li>
+ <li ngbNavItem="/monitoring/silences">
+ <a ngbNavLink
+ i18n>Silences</a>
+ </li>
+</ul>
--- /dev/null
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { RouterTestingModule } from '@angular/router/testing';
+
+import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
+
+import { configureTestBed } from '../../../../../testing/unit-test-helper';
+import { PrometheusTabsComponent } from './prometheus-tabs.component';
+
+describe('PrometheusTabsComponent', () => {
+ let component: PrometheusTabsComponent;
+ let fixture: ComponentFixture<PrometheusTabsComponent>;
+
+ configureTestBed({
+ imports: [RouterTestingModule, NgbNavModule],
+ declarations: [PrometheusTabsComponent]
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(PrometheusTabsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component } from '@angular/core';
+import { Router } from '@angular/router';
+
+@Component({
+ selector: 'cd-prometheus-tabs',
+ templateUrl: './prometheus-tabs.component.html',
+ styleUrls: ['./prometheus-tabs.component.scss']
+})
+export class PrometheusTabsComponent {
+ constructor(public router: Router) {}
+}
-<cd-table [data]="data"
+<cd-prometheus-tabs></cd-prometheus-tabs>
+
+<cd-alert-panel *ngIf="!isPrometheusConfigured"
+ type="info"
+ i18n>To see all configured Prometheus alerts, please
+ provide the URL to the API of Prometheus as described in
+ the <a href="{{docsUrl}}"
+ target="_blank">documentation</a>.
+</cd-alert-panel>
+
+<cd-table *ngIf="isPrometheusConfigured"
+ [data]="prometheusAlertService.rules"
[columns]="columns"
[hasDetails]="true"
(updateSelection)="setExpandedRow($event)"
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { RouterTestingModule } from '@angular/router/testing';
+
+import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
+import { ToastrModule } from 'ngx-toastr';
import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper';
import { PrometheusService } from '../../../../shared/api/prometheus.service';
import { SettingsService } from '../../../../shared/api/settings.service';
import { SharedModule } from '../../../../shared/shared.module';
+import { PrometheusTabsComponent } from '../prometheus-tabs/prometheus-tabs.component';
import { RulesListComponent } from './rules-list.component';
describe('RulesListComponent', () => {
let fixture: ComponentFixture<RulesListComponent>;
configureTestBed({
- declarations: [RulesListComponent],
- imports: [HttpClientTestingModule, SharedModule, BrowserAnimationsModule],
+ declarations: [RulesListComponent, PrometheusTabsComponent],
+ imports: [
+ HttpClientTestingModule,
+ SharedModule,
+ NgbNavModule,
+ RouterTestingModule,
+ ToastrModule.forRoot()
+ ],
providers: [PrometheusService, SettingsService, i18nProviders]
});
-import { Component, Input, OnInit } from '@angular/core';
+import { Component, Inject, OnInit } from '@angular/core';
import { I18n } from '@ngx-translate/i18n-polyfill';
-import { ListWithDetails } from '../../../../shared/classes/list-with-details.class';
+import { PrometheusService } from '../../../../shared/api/prometheus.service';
import { CdTableColumn } from '../../../../shared/models/cd-table-column';
import { PrometheusRule } from '../../../../shared/models/prometheus-alerts';
+import { CephReleaseNamePipe } from '../../../../shared/pipes/ceph-release-name.pipe';
import { DurationPipe } from '../../../../shared/pipes/duration.pipe';
+import { PrometheusAlertService } from '../../../../shared/services/prometheus-alert.service';
+import { SummaryService } from '../../../../shared/services/summary.service';
+import { PrometheusListHelper } from '../prometheus-list-helper';
@Component({
selector: 'cd-rules-list',
templateUrl: './rules-list.component.html',
styleUrls: ['./rules-list.component.scss']
})
-export class RulesListComponent extends ListWithDetails implements OnInit {
- @Input()
- data: any;
+export class RulesListComponent extends PrometheusListHelper implements OnInit {
columns: CdTableColumn[];
expandedRow: PrometheusRule;
*/
hideKeys = ['alerts', 'type'];
- constructor(private i18n: I18n) {
- super();
+ constructor(
+ private i18n: I18n,
+ public prometheusAlertService: PrometheusAlertService,
+ @Inject(PrometheusService) prometheusService: PrometheusService,
+ @Inject(SummaryService) summaryService: SummaryService,
+ @Inject(CephReleaseNamePipe) cephReleaseNamePipe: CephReleaseNamePipe
+ ) {
+ super(prometheusService, summaryService, cephReleaseNamePipe);
}
ngOnInit() {
+ super.ngOnInit();
this.columns = [
{ prop: 'name', name: this.i18n('Name') },
{ prop: 'labels.severity', name: this.i18n('Severity') },
const changeAction = (action: string) => {
const modes = {
- add: '/monitoring/silence/add',
- alertAdd: '/monitoring/silence/add/someAlert',
- recreate: '/monitoring/silence/recreate/someExpiredId',
- edit: '/monitoring/silence/edit/someNotExpiredId'
+ add: '/monitoring/silences/add',
+ alertAdd: '/monitoring/silences/add/someAlert',
+ recreate: '/monitoring/silences/recreate/someExpiredId',
+ edit: '/monitoring/silences/edit/someNotExpiredId'
};
Object.defineProperty(router, 'url', { value: modes[action] });
callInit();
}
private chooseMode() {
- this.edit = this.router.url.startsWith('/monitoring/silence/edit');
- this.recreate = this.router.url.startsWith('/monitoring/silence/recreate');
+ this.edit = this.router.url.startsWith('/monitoring/silences/edit');
+ this.recreate = this.router.url.startsWith('/monitoring/silences/recreate');
if (this.edit) {
this.action = this.actionLabels.EDIT;
} else if (this.recreate) {
}
this.prometheusService.setSilence(this.getSubmitData()).subscribe(
(resp) => {
- this.router.navigate(['/monitoring'], { fragment: 'silences' });
+ this.router.navigate(['/monitoring/silences']);
this.notificationService.show(
NotificationType.success,
this.getNotificationTile(resp.body['silenceId']),
-<cd-table [data]="silences"
+<cd-prometheus-tabs></cd-prometheus-tabs>
+
+<cd-alert-panel *ngIf="!isAlertmanagerConfigured"
+ type="info"
+ i18n>To enable Silences, please provide the URL to the
+ API of the Prometheus' Alertmanager as described in
+ the <a href="{{docsUrl}}"
+ target="_blank">documentation</a>.
+</cd-alert-panel>
+
+<cd-table *ngIf="isAlertmanagerConfigured"
+ [data]="silences"
[columns]="columns"
[forceIdentifier]="true"
[customCss]="customCss"
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
+import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { ToastrModule } from 'ngx-toastr';
import { of } from 'rxjs';
import { ModalService } from '../../../../shared/services/modal.service';
import { NotificationService } from '../../../../shared/services/notification.service';
import { SharedModule } from '../../../../shared/shared.module';
+import { PrometheusTabsComponent } from '../prometheus-tabs/prometheus-tabs.component';
import { SilenceListComponent } from './silence-list.component';
describe('SilenceListComponent', () => {
SharedModule,
ToastrModule.forRoot(),
RouterTestingModule,
- HttpClientTestingModule
+ HttpClientTestingModule,
+ NgbNavModule
],
- declarations: [SilenceListComponent],
+ declarations: [SilenceListComponent, PrometheusTabsComponent],
providers: [i18nProviders]
});
-import { Component } from '@angular/core';
+import { Component, Inject } from '@angular/core';
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { I18n } from '@ngx-translate/i18n-polyfill';
import { Observable, Subscriber } from 'rxjs';
import { PrometheusService } from '../../../../shared/api/prometheus.service';
-import { ListWithDetails } from '../../../../shared/classes/list-with-details.class';
import { CriticalConfirmationModalComponent } from '../../../../shared/components/critical-confirmation-modal/critical-confirmation-modal.component';
import {
ActionLabelsI18n,
import { CdTableSelection } from '../../../../shared/models/cd-table-selection';
import { Permission } from '../../../../shared/models/permissions';
import { CdDatePipe } from '../../../../shared/pipes/cd-date.pipe';
+import { CephReleaseNamePipe } from '../../../../shared/pipes/ceph-release-name.pipe';
import { AuthStorageService } from '../../../../shared/services/auth-storage.service';
import { ModalService } from '../../../../shared/services/modal.service';
import { NotificationService } from '../../../../shared/services/notification.service';
+import { SummaryService } from '../../../../shared/services/summary.service';
import { URLBuilderService } from '../../../../shared/services/url-builder.service';
+import { PrometheusListHelper } from '../prometheus-list-helper';
-const BASE_URL = 'monitoring/silence';
+const BASE_URL = 'monitoring/silences';
@Component({
providers: [{ provide: URLBuilderService, useValue: new URLBuilderService(BASE_URL) }],
templateUrl: './silence-list.component.html',
styleUrls: ['./silence-list.component.scss']
})
-export class SilenceListComponent extends ListWithDetails {
+export class SilenceListComponent extends PrometheusListHelper {
silences: AlertmanagerSilence[] = [];
columns: CdTableColumn[];
tableActions: CdTableAction[];
private authStorageService: AuthStorageService,
private i18n: I18n,
private cdDatePipe: CdDatePipe,
- private prometheusService: PrometheusService,
private modalService: ModalService,
private notificationService: NotificationService,
private urlBuilder: URLBuilderService,
private actionLabels: ActionLabelsI18n,
- private succeededLabels: SucceededActionLabelsI18n
+ private succeededLabels: SucceededActionLabelsI18n,
+ @Inject(PrometheusService) prometheusService: PrometheusService,
+ @Inject(SummaryService) summaryService: SummaryService,
+ @Inject(CephReleaseNamePipe) cephReleaseNamePipe: CephReleaseNamePipe
) {
- super();
+ super(prometheusService, summaryService, cephReleaseNamePipe);
this.permission = this.authStorageService.getPermissions().prometheus;
const selectionExpired = (selection: CdTableSelection) =>
selection.first() && selection.first().status && selection.first().status.state === 'expired';
permission: 'create',
icon: Icons.add,
routerLink: () => this.urlBuilder.getCreate(),
- preserveFragment: true,
canBePrimary: (selection: CdTableSelection) => !selection.hasSingleSelection,
name: this.actionLabels.CREATE
},
!selectionExpired(selection),
icon: Icons.copy,
routerLink: () => this.urlBuilder.getRecreate(this.selection.first().id),
- preserveFragment: true,
name: this.actionLabels.RECREATE
},
{
(selection.first().cdExecuting && !selectionExpired(selection)) ||
selectionExpired(selection),
routerLink: () => this.urlBuilder.getEdit(this.selection.first().id),
- preserveFragment: true,
name: this.actionLabels.EDIT
},
{