-import { NgModule } from '@angular/core';
+import { Injectable, NgModule } from '@angular/core';
import { ActivatedRouteSnapshot, PreloadAllModules, RouterModule, Routes } from '@angular/router';
-import * as _ from 'lodash';
+import _ from 'lodash';
import { CephfsListComponent } from './ceph/cephfs/cephfs-list/cephfs-list.component';
import { ConfigurationFormComponent } from './ceph/cluster/configuration/configuration-form/configuration-form.component';
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 { ServiceFormComponent } from './ceph/cluster/services/service-form/service-form.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';
-import { Nfs501Component } from './ceph/nfs/nfs-501/nfs-501.component';
import { NfsFormComponent } from './ceph/nfs/nfs-form/nfs-form.component';
import { NfsListComponent } from './ceph/nfs/nfs-list/nfs-list.component';
import { PerformanceCounterComponent } from './ceph/performance-counter/performance-counter/performance-counter.component';
import { LoginPasswordFormComponent } from './core/auth/login-password-form/login-password-form.component';
import { LoginComponent } from './core/auth/login/login.component';
-import { SsoNotFoundComponent } from './core/auth/sso/sso-not-found/sso-not-found.component';
import { UserPasswordFormComponent } from './core/auth/user-password-form/user-password-form.component';
-import { ForbiddenComponent } from './core/forbidden/forbidden.component';
+import { ErrorComponent } from './core/error/error.component';
import { BlankLayoutComponent } from './core/layouts/blank-layout/blank-layout.component';
import { LoginLayoutComponent } from './core/layouts/login-layout/login-layout.component';
import { WorkbenchLayoutComponent } from './core/layouts/workbench-layout/workbench-layout.component';
-import { NotFoundComponent } from './core/not-found/not-found.component';
import { ActionLabels, URLVerbs } from './shared/constants/app.constants';
import { BreadcrumbsResolver, IBreadcrumb } from './shared/models/breadcrumbs';
import { AuthGuardService } from './shared/services/auth-guard.service';
import { ModuleStatusGuardService } from './shared/services/module-status-guard.service';
import { NoSsoGuardService } from './shared/services/no-sso-guard.service';
+@Injectable()
export class PerformanceCounterBreadcrumbsResolver extends BreadcrumbsResolver {
resolve(route: ActivatedRouteSnapshot) {
const result: IBreadcrumb[] = [];
}
}
+@Injectable()
export class StartCaseBreadcrumbsResolver extends BreadcrumbsResolver {
resolve(route: ActivatedRouteSnapshot) {
const path = route.params.name;
canActivateChild: [AuthGuardService, ChangePasswordGuardService],
children: [
{ path: 'dashboard', component: DashboardComponent },
+ { path: 'error', component: ErrorComponent },
+
// Cluster
{
path: 'hosts',
},
{
path: 'services',
- data: { breadcrumbs: 'Cluster/Services' },
+ canActivateChild: [ModuleStatusGuardService],
+ data: {
+ moduleStatusGuardConfig: {
+ apiPath: 'orchestrator',
+ redirectTo: 'error',
+ section: 'orch',
+ section_info: 'Orchestrator',
+ header: 'Orchestrator is not available'
+ },
+ breadcrumbs: 'Cluster/Services'
+ },
children: [
{ path: '', component: ServicesComponent },
{
},
{
path: 'inventory',
+ canActivate: [ModuleStatusGuardService],
component: InventoryComponent,
- data: { breadcrumbs: 'Cluster/Inventory' }
+ data: {
+ moduleStatusGuardConfig: {
+ apiPath: 'orchestrator',
+ redirectTo: 'error',
+ section: 'orch',
+ section_info: 'Orchestrator',
+ header: 'Orchestrator is not available'
+ },
+ breadcrumbs: 'Cluster/Inventory'
+ }
},
{
path: 'osd',
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: `silence/${URLVerbs.CREATE}/:id`,
- component: SilenceFormComponent,
- data: { breadcrumbs: ActionLabels.CREATE }
+ path: 'active-alerts',
+ data: { breadcrumbs: 'Active Alerts' },
+ component: ActiveAlertListComponent
},
{
- 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 }
+ }
+ ]
}
]
},
data: {
moduleStatusGuardConfig: {
apiPath: 'rgw',
- redirectTo: 'rgw/501'
+ redirectTo: 'error',
+ section: 'rgw',
+ section_info: 'Object Gateway',
+ header: 'The Object Gateway Service is not configured'
},
breadcrumbs: true,
text: 'Object Gateway',
]
},
// NFS
- {
- path: 'nfs/501/:message',
- component: Nfs501Component,
- data: { breadcrumbs: 'NFS' }
- },
{
path: 'nfs',
canActivateChild: [FeatureTogglesGuardService, ModuleStatusGuardService],
data: {
moduleStatusGuardConfig: {
apiPath: 'nfs-ganesha',
- redirectTo: 'nfs/501'
+ redirectTo: 'error',
+ section: 'nfs-ganesha',
+ section_info: 'NFS GANESHA',
+ header: 'NFS-Ganesha is not configured'
},
breadcrumbs: 'NFS'
},
{
path: '',
component: BlankLayoutComponent,
- children: [
- // Single Sign-On (SSO)
- { path: 'sso/404', component: SsoNotFoundComponent },
- // System
- { path: '403', component: ForbiddenComponent },
- { path: '404', component: NotFoundComponent },
- { path: '**', redirectTo: '/404' }
- ]
+ children: [{ path: '**', redirectTo: '/error' }]
}
];