} from './ceph/performance-counter/performance-counter/performance-counter.component';
import { RgwDaemonListComponent } from './ceph/rgw/rgw-daemon-list/rgw-daemon-list.component';
import { LoginComponent } from './core/auth/login/login.component';
+import { NotFoundComponent } from './core/not-found/not-found.component';
import { AuthGuardService } from './shared/services/auth-guard.service';
const routes: Routes = [
component: PerformanceCounterComponent,
canActivate: [AuthGuardService]
},
- { path: 'monitor', component: MonitorComponent, canActivate: [AuthGuardService] }
+ { path: 'monitor', component: MonitorComponent, canActivate: [AuthGuardService] },
+ { path: '404', component: NotFoundComponent },
+ { path: '**', redirectTo: '/404'}
];
@NgModule({
import { AuthModule } from './auth/auth.module';
import { NavigationModule } from './navigation/navigation.module';
+import { NotFoundComponent } from './not-found/not-found.component';
@NgModule({
imports: [
AuthModule
],
exports: [NavigationModule],
- declarations: []
+ declarations: [NotFoundComponent]
})
export class CoreModule { }
--- /dev/null
+<div class="row">
+ <div class="col-md-12 text-center">
+ <h1>Sorry, we could not find what you were looking for</h1>
+
+ <img class="img-responsive center-block img-rounded"
+ src="/assets/1280px-Mimic_Octopus2.jpg">
+ <span>
+ "<a href="https://www.flickr.com/photos/37707866@N00/4838953223">Mimic Octopus</a>" by prilfish is licensed under
+ <a rel="nofollow"
+ class="external text"
+ href="https://creativecommons.org/licenses/by/2.0/">CC BY 2.0</a>
+ </span>
+ </div>
+</div>
--- /dev/null
+h1 {
+ font-size: -webkit-xxx-large;
+}
+
+h2 {
+ font-size: xx-large;
+}
+
+*{
+ font-family: monospace;
+}
+
+img{
+ width: 50vw;
+}
--- /dev/null
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { NotFoundComponent } from './not-found.component';
+
+describe('NotFoundComponent', () => {
+ let component: NotFoundComponent;
+ let fixture: ComponentFixture<NotFoundComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ NotFoundComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(NotFoundComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
--- /dev/null
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'cd-not-found',
+ templateUrl: './not-found.component.html',
+ styleUrls: ['./not-found.component.scss']
+})
+export class NotFoundComponent {
+ constructor() {}
+}
}
}, (err: any) => {
if (err instanceof HttpErrorResponse) {
+ if (err.status === 404) {
+ this.router.navigate(['/404']);
+ return;
+ }
+
this.toastr.error(err.error.detail || '', `${err.status} - ${err.statusText}`);
if (err.status === 401) {
this.authStorageService.remove();