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'; |
| 5 | import { HttpModule } from '@angular/http'; |
| 6 | |
| 7 | import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; |
| 8 | |
| 9 | import { AuthGuard } from 'app/utils/auth.guard'; |
| 10 | |
| 11 | import { NetopeerComponent } from './netopeer.component'; |
| 12 | import { DashboardComponent } from './dashboard.component'; |
| 13 | import { InventoryComponent } from './inventory/inventory.component'; |
| 14 | import { InventorySchemasComponent } from './inventory/schemas.component'; |
| 15 | import { InventoryDevicesComponent } from './inventory/devices.component'; |
| 16 | import { ConfigComponent } from './config/config.component'; |
| 17 | import { YANGComponent } from './yang/yang.component'; |
| 18 | import { MonitoringComponent } from './monitoring/monitoring.component'; |
| 19 | import { PluginsComponent } from './plugins/plugins.component'; |
| 20 | |
| 21 | |
| 22 | const routes: Routes = [ |
| 23 | { path : 'netopeer', component : NetopeerComponent, canActivate : [AuthGuard], |
| 24 | data : { role : 10, name : 'Netopeer', description : 'Network Management Center', icon : 'fa-user-secret' }, |
| 25 | children: [ |
| 26 | { path : 'dashboard', component : DashboardComponent, canActivate : [AuthGuard] }, |
| 27 | { path : 'inventory', component : InventoryComponent, canActivate : [AuthGuard], |
| 28 | children : [ |
| 29 | { path : 'devices', component : InventoryDevicesComponent, canActivate : [AuthGuard] }, |
| 30 | { path : 'schemas', component : InventorySchemasComponent, canActivate : [AuthGuard] } |
| 31 | ] |
| 32 | }, |
| 33 | { path : 'config', component : ConfigComponent, canActivate : [AuthGuard] }, |
| 34 | { path : 'yang', component : YANGComponent, canActivate : [AuthGuard] }, |
| 35 | { path : 'monitoring', component : MonitoringComponent, canActivate : [AuthGuard] }, |
| 36 | { path : 'plugins', component : PluginsComponent, canActivate : [AuthGuard] } |
| 37 | ] |
| 38 | } |
| 39 | ] |
| 40 | |
| 41 | @NgModule({ |
| 42 | imports: [ |
| 43 | CommonModule, |
| 44 | FormsModule, |
| 45 | HttpModule, |
| 46 | NgbModule.forRoot(), |
| 47 | RouterModule.forChild(routes) |
| 48 | ], |
| 49 | declarations: [ |
| 50 | NetopeerComponent, |
| 51 | DashboardComponent, |
| 52 | InventoryComponent, |
| 53 | InventorySchemasComponent, |
| 54 | InventoryDevicesComponent, |
| 55 | ConfigComponent, |
| 56 | YANGComponent, |
| 57 | MonitoringComponent, |
| 58 | PluginsComponent |
| 59 | ], |
| 60 | entryComponents : [ |
| 61 | NetopeerComponent |
| 62 | ] |
| 63 | }) |
| 64 | export class NetopeerModule { } |