blob: c3ba99e085921bda90df2ab4bdd6f99adc4e7978 [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
22
23const routes: Routes = [
24 { path : 'netopeer', component : NetopeerComponent, canActivate : [AuthGuard],
25 data : { role : 10, name : 'Netopeer', description : 'Network Management Center', icon : 'fa-user-secret' },
26 children: [
27 { path : 'dashboard', component : DashboardComponent, canActivate : [AuthGuard] },
28 { path : 'inventory', component : InventoryComponent, canActivate : [AuthGuard],
29 children : [
30 { path : 'devices', component : InventoryDevicesComponent, canActivate : [AuthGuard] },
31 { path : 'schemas', component : InventorySchemasComponent, canActivate : [AuthGuard] }
32 ]
33 },
34 { path : 'config', component : ConfigComponent, canActivate : [AuthGuard] },
35 { path : 'yang', component : YANGComponent, canActivate : [AuthGuard] },
36 { path : 'monitoring', component : MonitoringComponent, canActivate : [AuthGuard] },
37 { path : 'plugins', component : PluginsComponent, canActivate : [AuthGuard] }
38 ]
39 }
40]
41
42@NgModule({
43 imports: [
44 CommonModule,
45 FormsModule,
Radek Krejci80e003e2017-09-21 14:20:20 +020046 ReactiveFormsModule,
Radek Krejcid23f0df2017-08-31 16:34:49 +020047 HttpModule,
48 NgbModule.forRoot(),
49 RouterModule.forChild(routes)
50 ],
51 declarations: [
52 NetopeerComponent,
53 DashboardComponent,
54 InventoryComponent,
55 InventorySchemasComponent,
56 InventoryDevicesComponent,
57 ConfigComponent,
58 YANGComponent,
59 MonitoringComponent,
60 PluginsComponent
61 ],
62 entryComponents : [
63 NetopeerComponent
64 ]
65})
66export class NetopeerModule { }