Merge pull request #576 from GNS3/404-Not-found-page-support

404 Not found page support
This commit is contained in:
piotrpekala7 2019-11-05 10:43:00 +01:00 committed by GitHub
commit 00cf8a29c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 6 deletions

View File

@ -57,6 +57,7 @@ import { TracengPreferencesComponent } from './components/preferences/traceng/tr
import { TracengTemplatesComponent } from './components/preferences/traceng/traceng-templates/traceng-templates.component';
import { AddTracengTemplateComponent } from './components/preferences/traceng/add-traceng/add-traceng-template.component';
import { TracengTemplateDetailsComponent } from './components/preferences/traceng/traceng-template-details/traceng-template-details.component';
import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component';
const routes: Routes = [
{
@ -128,15 +129,15 @@ const routes: Routes = [
{ path: 'server/:server_id/preferences/iou/templates', component: IouTemplatesComponent },
{ path: 'server/:server_id/preferences/iou/templates/:template_id', component: IouTemplateDetailsComponent },
{ path: 'server/:server_id/preferences/iou/templates/:template_id/copy', component: CopyIouTemplateComponent },
{ path: 'server/:server_id/preferences/iou/addtemplate', component: AddIouTemplateComponent }
{ path: 'server/:server_id/preferences/iou/addtemplate', component: AddIouTemplateComponent },
{
path: '**',
component: PageNotFoundComponent
}
]
},
{
path: 'server/:server_id/project/:project_id', component: ProjectMapComponent,
},
{
path: '**',
redirectTo: 'servers'
}
];

View File

@ -245,6 +245,7 @@ import { ScreenshotDialogComponent } from './components/project-map/screenshot-d
import { ResizableModule } from 'angular-resizable-element';
import { DragAndDropModule } from 'angular-draggable-droppable';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { PageNotFoundComponent } from './components/page-not-found/page-not-found.component';
if (environment.production) {
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
@ -412,7 +413,8 @@ if (environment.production) {
StartCaptureOnStartedLinkActionComponent,
LockActionComponent,
NavigationDialogComponent,
ScreenshotDialogComponent
ScreenshotDialogComponent,
PageNotFoundComponent
],
imports: [
BrowserModule,

View File

@ -0,0 +1,6 @@
<div class="content">
<div class="default-header">
<h1>404 Page not found</h1>
<button mat-button routerLink="/servers">Navigate to homepage</button>
</div>
</div>

View File

@ -0,0 +1,3 @@
div {
text-align: center
}

View File

@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-page-not-found',
templateUrl: './page-not-found.component.html',
styleUrls: ['./page-not-found.component.scss']
})
export class PageNotFoundComponent {
constructor(){}
}