blob: b97e9b648430036e312cfb91c76a2ecc89b0ec50 [file] [log] [blame]
Radek Krejcid23f0df2017-08-31 16:34:49 +02001import { NgModule } from '@angular/core';
2import { CommonModule } from '@angular/common';
3import { Routes, RouterModule } from '@angular/router';
4import { FormsModule } from '@angular/forms';
Radek Krejci80e003e2017-09-21 14:20:20 +02005import { ReactiveFormsModule } from '@angular/forms';
Radek Krejcid23f0df2017-08-31 16:34:49 +02006import { HttpModule } from '@angular/http';
7
8import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
9
10import { AuthGuard } from 'app/utils/auth.guard';
11
12import { NetopeerComponent } from './netopeer.component';
13import { DashboardComponent } from './dashboard.component';
14import { InventoryComponent } from './inventory/inventory.component';
15import { InventorySchemasComponent } from './inventory/schemas.component';
16import { InventoryDevicesComponent } from './inventory/devices.component';
17import { ConfigComponent } from './config/config.component';
18import { YANGComponent } from './yang/yang.component';
19import { MonitoringComponent } from './monitoring/monitoring.component';
20import { PluginsComponent } from './plugins/plugins.component';
21
Radek Krejcid1fa33b2017-10-17 14:41:36 +020022import { SessionsService } from './config/sessions.service'
Radek Krejci95bd14c2017-09-21 14:24:13 +020023
Radek Krejcid23f0df2017-08-31 16:34:49 +020024
25const routes: Routes = [
26 { path : 'netopeer', component : NetopeerComponent, canActivate : [AuthGuard],
27 data : { role : 10, name : 'Netopeer', description : 'Network Management Center', icon : 'fa-user-secret' },
28 children: [
29 { path : 'dashboard', component : DashboardComponent, canActivate : [AuthGuard] },
30 { path : 'inventory', component : InventoryComponent, canActivate : [AuthGuard],
31 children : [
32 { path : 'devices', component : InventoryDevicesComponent, canActivate : [AuthGuard] },
33 { path : 'schemas', component : InventorySchemasComponent, canActivate : [AuthGuard] }
34 ]
35 },
36 { path : 'config', component : ConfigComponent, canActivate : [AuthGuard] },
37 { path : 'yang', component : YANGComponent, canActivate : [AuthGuard] },
38 { path : 'monitoring', component : MonitoringComponent, canActivate : [AuthGuard] },
39 { path : 'plugins', component : PluginsComponent, canActivate : [AuthGuard] }
40 ]
41 }
42]
43
44@NgModule({
45 imports: [
46 CommonModule,
47 FormsModule,
Radek Krejci80e003e2017-09-21 14:20:20 +020048 ReactiveFormsModule,
Radek Krejcid23f0df2017-08-31 16:34:49 +020049 HttpModule,
50 NgbModule.forRoot(),
51 RouterModule.forChild(routes)
52 ],
53 declarations: [
54 NetopeerComponent,
55 DashboardComponent,
56 InventoryComponent,
57 InventorySchemasComponent,
58 InventoryDevicesComponent,
59 ConfigComponent,
60 YANGComponent,
61 MonitoringComponent,
62 PluginsComponent
63 ],
Radek Krejci95bd14c2017-09-21 14:24:13 +020064 providers: [
65 SessionsService
66 ],
Radek Krejcid23f0df2017-08-31 16:34:49 +020067 entryComponents : [
68 NetopeerComponent
69 ]
70})
71export class NetopeerModule { }