blob: 24e068577008ea1ea9ed589c736296b4e716b475 [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';
Radek Krejcia1339602017-11-02 13:52:38 +010018import { TreeView } from './config/tree.component';
Radek Krejcid23f0df2017-08-31 16:34:49 +020019import { YANGComponent } from './yang/yang.component';
20import { MonitoringComponent } from './monitoring/monitoring.component';
21import { PluginsComponent } from './plugins/plugins.component';
22
Radek Krejcid1fa33b2017-10-17 14:41:36 +020023import { SessionsService } from './config/sessions.service'
Radek Krejci95bd14c2017-09-21 14:24:13 +020024
Radek Krejcid23f0df2017-08-31 16:34:49 +020025
26const routes: Routes = [
27 { path : 'netopeer', component : NetopeerComponent, canActivate : [AuthGuard],
28 data : { role : 10, name : 'Netopeer', description : 'Network Management Center', icon : 'fa-user-secret' },
29 children: [
30 { path : 'dashboard', component : DashboardComponent, canActivate : [AuthGuard] },
31 { path : 'inventory', component : InventoryComponent, canActivate : [AuthGuard],
32 children : [
33 { path : 'devices', component : InventoryDevicesComponent, canActivate : [AuthGuard] },
34 { path : 'schemas', component : InventorySchemasComponent, canActivate : [AuthGuard] }
35 ]
36 },
37 { path : 'config', component : ConfigComponent, canActivate : [AuthGuard] },
38 { path : 'yang', component : YANGComponent, canActivate : [AuthGuard] },
39 { path : 'monitoring', component : MonitoringComponent, canActivate : [AuthGuard] },
40 { path : 'plugins', component : PluginsComponent, canActivate : [AuthGuard] }
41 ]
42 }
43]
44
45@NgModule({
46 imports: [
47 CommonModule,
48 FormsModule,
Radek Krejci80e003e2017-09-21 14:20:20 +020049 ReactiveFormsModule,
Radek Krejcid23f0df2017-08-31 16:34:49 +020050 HttpModule,
51 NgbModule.forRoot(),
52 RouterModule.forChild(routes)
53 ],
54 declarations: [
55 NetopeerComponent,
56 DashboardComponent,
57 InventoryComponent,
58 InventorySchemasComponent,
59 InventoryDevicesComponent,
60 ConfigComponent,
Radek Krejcia1339602017-11-02 13:52:38 +010061 TreeView,
Radek Krejcid23f0df2017-08-31 16:34:49 +020062 YANGComponent,
63 MonitoringComponent,
64 PluginsComponent
65 ],
Radek Krejci95bd14c2017-09-21 14:24:13 +020066 providers: [
67 SessionsService
68 ],
Radek Krejcid23f0df2017-08-31 16:34:49 +020069 entryComponents : [
70 NetopeerComponent
71 ]
72})
73export class NetopeerModule { }