2020-01-14 13:41:28 +01:00
|
|
|
import { NgModule } from '@angular/core';
|
2020-08-26 19:25:31 +02:00
|
|
|
import {Routes, RouterModule, ExtraOptions} from '@angular/router';
|
2020-05-19 12:49:06 +02:00
|
|
|
import {HomeComponent} from './home/home.component';
|
2020-06-19 08:43:22 +02:00
|
|
|
import {LoginService} from './services/login.service';
|
|
|
|
import {SampleComponent} from './sample/sample.component';
|
2020-05-22 09:36:50 +02:00
|
|
|
import {SamplesComponent} from './samples/samples.component';
|
2020-07-14 15:58:33 +02:00
|
|
|
import {DocumentationComponent} from './documentation/documentation.component';
|
2020-07-27 17:52:03 +02:00
|
|
|
import {TemplatesComponent} from './templates/templates.component';
|
2020-07-29 13:14:29 +02:00
|
|
|
import {SettingsComponent} from './settings/settings.component';
|
|
|
|
import {UsersComponent} from './users/users.component';
|
2020-08-10 16:15:17 +02:00
|
|
|
import {ChangelogComponent} from './changelog/changelog.component';
|
2020-08-28 16:58:35 +02:00
|
|
|
import {DocumentationDatabaseComponent} from './documentation/documentation-database/documentation-database.component';
|
2020-08-12 15:15:31 +02:00
|
|
|
import {PredictionComponent} from './prediction/prediction.component';
|
2020-08-20 10:42:02 +02:00
|
|
|
import {ModelTemplatesComponent} from './model-templates/model-templates.component';
|
2020-09-03 15:51:53 +02:00
|
|
|
import {DocumentationArchitectureComponent} from
|
|
|
|
'./documentation/documentation-architecture/documentation-architecture.component';
|
2020-08-31 16:14:47 +02:00
|
|
|
import {MaterialsComponent} from './materials/materials.component';
|
|
|
|
import {MaterialComponent} from './material/material.component';
|
2020-09-01 15:15:21 +02:00
|
|
|
import {DocumentationModelsComponent} from './documentation/documentation-models/documentation-models.component';
|
2020-01-14 13:41:28 +01:00
|
|
|
|
|
|
|
|
2020-05-19 12:49:06 +02:00
|
|
|
const routes: Routes = [
|
2020-05-20 10:07:34 +02:00
|
|
|
{path: '', component: HomeComponent},
|
2020-05-22 12:52:17 +02:00
|
|
|
{path: 'home', component: HomeComponent},
|
2020-08-12 15:15:31 +02:00
|
|
|
{path: 'prediction', component: PredictionComponent},
|
2020-08-20 10:42:02 +02:00
|
|
|
{path: 'models', component: ModelTemplatesComponent},
|
2020-06-19 08:43:22 +02:00
|
|
|
{path: 'samples', component: SamplesComponent, canActivate: [LoginService]},
|
|
|
|
{path: 'samples/new', component: SampleComponent, canActivate: [LoginService]},
|
|
|
|
{path: 'samples/edit/:id', component: SampleComponent, canActivate: [LoginService]},
|
2020-08-31 16:14:47 +02:00
|
|
|
{path: 'materials', component: MaterialsComponent, canActivate: [LoginService]},
|
|
|
|
{path: 'materials/edit/:id', component: MaterialComponent, canActivate: [LoginService]},
|
2020-07-29 13:14:29 +02:00
|
|
|
{path: 'templates', component: TemplatesComponent, canActivate: [LoginService]},
|
2020-08-10 16:15:17 +02:00
|
|
|
{path: 'changelog', component: ChangelogComponent, canActivate: [LoginService]},
|
2020-07-30 14:23:51 +02:00
|
|
|
{path: 'users', component: UsersComponent, canActivate: [LoginService]},
|
2020-07-29 13:14:29 +02:00
|
|
|
{path: 'settings', component: SettingsComponent, canActivate: [LoginService]},
|
2020-07-14 15:58:33 +02:00
|
|
|
{path: 'documentation', component: DocumentationComponent},
|
2020-08-28 16:58:35 +02:00
|
|
|
{path: 'documentation/architecture', component: DocumentationArchitectureComponent},
|
2020-08-11 14:18:16 +02:00
|
|
|
{path: 'documentation/database', component: DocumentationDatabaseComponent},
|
2020-09-01 15:15:21 +02:00
|
|
|
{path: 'documentation/models', component: DocumentationModelsComponent},
|
2020-05-20 10:07:34 +02:00
|
|
|
|
|
|
|
// if not authenticated
|
|
|
|
{ path: '**', redirectTo: '' }
|
2020-05-19 12:49:06 +02:00
|
|
|
];
|
2020-01-14 13:41:28 +01:00
|
|
|
|
2020-08-26 19:25:31 +02:00
|
|
|
const routerOptions: ExtraOptions = {
|
|
|
|
scrollPositionRestoration: 'enabled',
|
|
|
|
anchorScrolling: 'enabled',
|
|
|
|
scrollOffset: [0, 64],
|
|
|
|
};
|
|
|
|
|
2020-01-14 13:41:28 +01:00
|
|
|
@NgModule({
|
2020-08-26 19:25:31 +02:00
|
|
|
imports: [RouterModule.forRoot(routes, routerOptions)],
|
2020-01-14 13:41:28 +01:00
|
|
|
exports: [RouterModule]
|
|
|
|
})
|
|
|
|
export class AppRoutingModule { }
|