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 | |
Radek Krejci | 4990494 | 2018-01-29 13:32:11 +0100 | [diff] [blame] | 12 | import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; |
| 13 | import {MatProgressBarModule} from '@angular/material/progress-bar'; |
| 14 | |
| 15 | import { LoadingComponent } from './common/loading/loading.component'; |
| 16 | |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 17 | import { NetopeerComponent } from './netopeer.component'; |
| 18 | import { DashboardComponent } from './dashboard.component'; |
| 19 | import { InventoryComponent } from './inventory/inventory.component'; |
| 20 | import { InventorySchemasComponent } from './inventory/schemas.component'; |
| 21 | import { InventoryDevicesComponent } from './inventory/devices.component'; |
| 22 | import { ConfigComponent } from './config/config.component'; |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 23 | import { TreeView, TreeIndent, TreeCreate, TreeScrollTo, CheckLeafValue } from './config/tree.component'; |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 24 | import { YANGComponent } from './yang/yang.component'; |
| 25 | import { MonitoringComponent } from './monitoring/monitoring.component'; |
| 26 | import { PluginsComponent } from './plugins/plugins.component'; |
| 27 | |
Radek Krejci | d1fa33b | 2017-10-17 14:41:36 +0200 | [diff] [blame] | 28 | import { SessionsService } from './config/sessions.service' |
Radek Krejci | 6be087d | 2018-02-14 08:53:20 +0100 | [diff] [blame^] | 29 | import { SchemasService } from './yang/schemas.service' |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 30 | |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 31 | const routes: Routes = [ |
| 32 | { path : 'netopeer', component : NetopeerComponent, canActivate : [AuthGuard], |
Radek Krejci | a1fee3f | 2018-01-29 14:44:26 +0100 | [diff] [blame] | 33 | data : { role : 10, name : 'Netopeer', description : 'Network Management Center', icon : 'fa-gears' }, |
Radek Krejci | bd51ab4 | 2018-01-29 14:11:30 +0100 | [diff] [blame] | 34 | children: [{ |
| 35 | path : 'dashboard', |
| 36 | component : DashboardComponent, |
| 37 | canActivate : [AuthGuard], |
| 38 | data : { role : 10, name : 'Netopeer Dashboard'} |
| 39 | }, { |
| 40 | path : 'inventory', |
| 41 | component : InventoryComponent, |
| 42 | canActivate : [AuthGuard], |
| 43 | data : { role : 10, name : 'Netopeer Items Inventories'}, |
| 44 | children : [{ |
Radek Krejci | 6be087d | 2018-02-14 08:53:20 +0100 | [diff] [blame^] | 45 | path : '', |
| 46 | redirectTo: 'devices', |
| 47 | pathMatch: 'full', |
| 48 | }, { |
Radek Krejci | bd51ab4 | 2018-01-29 14:11:30 +0100 | [diff] [blame] | 49 | path : 'devices', |
| 50 | component : InventoryDevicesComponent, |
| 51 | canActivate : [AuthGuard], |
| 52 | data : { role : 10, name : 'NETCONF Devices Inventory'} |
| 53 | }, { |
| 54 | path : 'schemas', |
| 55 | component : InventorySchemasComponent, |
| 56 | canActivate : [AuthGuard], |
| 57 | data : { role : 10, name : 'YANG Schemas Inventory'} |
| 58 | }] |
| 59 | }, { |
| 60 | path : 'config', |
| 61 | component : ConfigComponent, |
| 62 | canActivate : [AuthGuard], |
| 63 | data : { role : 10, name : 'Netopeer Device Configuration'}, |
| 64 | }, { |
| 65 | path : 'yang', |
| 66 | component : YANGComponent, |
| 67 | canActivate : [AuthGuard], |
| 68 | data : { role : 10, name : 'Netopeer YANG Explorer'}, |
| 69 | }, { |
| 70 | path : 'monitoring', |
| 71 | component : MonitoringComponent, |
| 72 | canActivate : [AuthGuard], |
| 73 | data : { role : 10, name : 'Netopeer Device Monitoring'}, |
| 74 | }, { |
| 75 | path : 'plugins', |
| 76 | component : PluginsComponent, |
| 77 | canActivate : [AuthGuard], |
| 78 | data : { role : 10, name : 'Netopeer Plugins'}, |
| 79 | }] |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 80 | } |
| 81 | ] |
| 82 | |
| 83 | @NgModule({ |
| 84 | imports: [ |
| 85 | CommonModule, |
| 86 | FormsModule, |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 87 | ReactiveFormsModule, |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 88 | HttpModule, |
| 89 | NgbModule.forRoot(), |
Radek Krejci | 4990494 | 2018-01-29 13:32:11 +0100 | [diff] [blame] | 90 | RouterModule.forChild(routes), |
| 91 | MatProgressSpinnerModule, |
| 92 | MatProgressBarModule, |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 93 | ], |
| 94 | declarations: [ |
| 95 | NetopeerComponent, |
| 96 | DashboardComponent, |
| 97 | InventoryComponent, |
| 98 | InventorySchemasComponent, |
| 99 | InventoryDevicesComponent, |
| 100 | ConfigComponent, |
Radek Krejci | 4990494 | 2018-01-29 13:32:11 +0100 | [diff] [blame] | 101 | LoadingComponent, |
Radek Krejci | 6e772b2 | 2018-01-25 13:28:57 +0100 | [diff] [blame] | 102 | CheckLeafValue, |
| 103 | TreeScrollTo, |
| 104 | TreeIndent, |
Radek Krejci | 9b41f5b | 2018-01-31 14:17:50 +0100 | [diff] [blame] | 105 | TreeCreate, |
Radek Krejci | a133960 | 2017-11-02 13:52:38 +0100 | [diff] [blame] | 106 | TreeView, |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 107 | YANGComponent, |
| 108 | MonitoringComponent, |
| 109 | PluginsComponent |
| 110 | ], |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 111 | providers: [ |
Radek Krejci | 6be087d | 2018-02-14 08:53:20 +0100 | [diff] [blame^] | 112 | SessionsService, |
| 113 | SchemasService |
Radek Krejci | 95bd14c | 2017-09-21 14:24:13 +0200 | [diff] [blame] | 114 | ], |
Radek Krejci | d23f0df | 2017-08-31 16:34:49 +0200 | [diff] [blame] | 115 | entryComponents : [ |
| 116 | NetopeerComponent |
| 117 | ] |
| 118 | }) |
| 119 | export class NetopeerModule { } |