Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 1 | import { NgModule } from '@angular/core'; |
| 2 | import { CommonModule } from '@angular/common'; |
| 3 | import { Routes, RouterModule } from '@angular/router'; |
| 4 | import { FormsModule } from '@angular/forms'; |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 5 | import { ReactiveFormsModule } from '@angular/forms'; |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 6 | import { HttpModule } from '@angular/http'; |
| 7 | |
| 8 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; |
| 9 | |
| 10 | import { AuthGuard } from 'app/utils/auth.guard'; |
| 11 | |
| 12 | import { NetopeerComponent } from './netopeer.component'; |
| 13 | import { DashboardComponent } from './dashboard.component'; |
| 14 | import { InventoryComponent } from './inventory/inventory.component'; |
| 15 | import { InventorySchemasComponent } from './inventory/schemas.component'; |
| 16 | import { InventoryDevicesComponent } from './inventory/devices.component'; |
| 17 | import { ConfigComponent } from './config/config.component'; |
| 18 | import { YANGComponent } from './yang/yang.component'; |
| 19 | import { MonitoringComponent } from './monitoring/monitoring.component'; |
| 20 | import { PluginsComponent } from './plugins/plugins.component'; |
| 21 | |
Radek Krejci | d1fa33b | 2017-10-17 14:41:36 +0200 | [diff] [blame^] | 22 | import { SessionsService } from './config/sessions.service' |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 23 | |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 24 | |
| 25 | const 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 Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 48 | ReactiveFormsModule, |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 49 | 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 Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 64 | providers: [ |
| 65 | SessionsService |
| 66 | ], |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 67 | entryComponents : [ |
| 68 | NetopeerComponent |
| 69 | ] |
| 70 | }) |
| 71 | export class NetopeerModule { } |