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'; |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 18 | import { TreeView } from './config/tree.component'; |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 19 | import { YANGComponent } from './yang/yang.component'; |
| 20 | import { MonitoringComponent } from './monitoring/monitoring.component'; |
| 21 | import { PluginsComponent } from './plugins/plugins.component'; |
| 22 | |
Radek Krejci | d1fa33b | 2017-10-17 14:41:36 +0200 | [diff] [blame] | 23 | import { SessionsService } from './config/sessions.service' |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 24 | |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 25 | |
| 26 | const 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 Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 49 | ReactiveFormsModule, |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 50 | HttpModule, |
| 51 | NgbModule.forRoot(), |
| 52 | RouterModule.forChild(routes) |
| 53 | ], |
| 54 | declarations: [ |
| 55 | NetopeerComponent, |
| 56 | DashboardComponent, |
| 57 | InventoryComponent, |
| 58 | InventorySchemasComponent, |
| 59 | InventoryDevicesComponent, |
| 60 | ConfigComponent, |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 61 | TreeView, |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 62 | YANGComponent, |
| 63 | MonitoringComponent, |
| 64 | PluginsComponent |
| 65 | ], |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 66 | providers: [ |
| 67 | SessionsService |
| 68 | ], |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 69 | entryComponents : [ |
| 70 | NetopeerComponent |
| 71 | ] |
| 72 | }) |
| 73 | export class NetopeerModule { } |