blob: 72f3097a064d07d471b9b03a215b16f9a594a1d4 [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
Radek Krejci49904942018-01-29 13:32:11 +010012import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
13import {MatProgressBarModule} from '@angular/material/progress-bar';
14
15import { LoadingComponent } from './common/loading/loading.component';
16
Radek Krejcid23f0df2017-08-31 16:34:49 +020017import { NetopeerComponent } from './netopeer.component';
18import { DashboardComponent } from './dashboard.component';
19import { InventoryComponent } from './inventory/inventory.component';
20import { InventorySchemasComponent } from './inventory/schemas.component';
21import { InventoryDevicesComponent } from './inventory/devices.component';
22import { ConfigComponent } from './config/config.component';
Radek Krejci9b41f5b2018-01-31 14:17:50 +010023import { TreeView, TreeIndent, TreeCreate, TreeScrollTo, CheckLeafValue } from './config/tree.component';
Radek Krejcid23f0df2017-08-31 16:34:49 +020024import { YANGComponent } from './yang/yang.component';
25import { MonitoringComponent } from './monitoring/monitoring.component';
26import { PluginsComponent } from './plugins/plugins.component';
27
Radek Krejcid1fa33b2017-10-17 14:41:36 +020028import { SessionsService } from './config/sessions.service'
Radek Krejci6be087d2018-02-14 08:53:20 +010029import { SchemasService } from './yang/schemas.service'
Radek Krejci95bd14c2017-09-21 14:24:13 +020030
Radek Krejcid23f0df2017-08-31 16:34:49 +020031const routes: Routes = [
32 { path : 'netopeer', component : NetopeerComponent, canActivate : [AuthGuard],
Radek Krejcia1fee3f2018-01-29 14:44:26 +010033 data : { role : 10, name : 'Netopeer', description : 'Network Management Center', icon : 'fa-gears' },
Radek Krejcibd51ab42018-01-29 14:11:30 +010034 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 Krejci6be087d2018-02-14 08:53:20 +010045 path : '',
46 redirectTo: 'devices',
47 pathMatch: 'full',
48 }, {
Radek Krejcibd51ab42018-01-29 14:11:30 +010049 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 Krejcid23f0df2017-08-31 16:34:49 +020080 }
81]
82
83@NgModule({
84 imports: [
85 CommonModule,
86 FormsModule,
Radek Krejci80e003e2017-09-21 14:20:20 +020087 ReactiveFormsModule,
Radek Krejcid23f0df2017-08-31 16:34:49 +020088 HttpModule,
89 NgbModule.forRoot(),
Radek Krejci49904942018-01-29 13:32:11 +010090 RouterModule.forChild(routes),
91 MatProgressSpinnerModule,
92 MatProgressBarModule,
Radek Krejcid23f0df2017-08-31 16:34:49 +020093 ],
94 declarations: [
95 NetopeerComponent,
96 DashboardComponent,
97 InventoryComponent,
98 InventorySchemasComponent,
99 InventoryDevicesComponent,
100 ConfigComponent,
Radek Krejci49904942018-01-29 13:32:11 +0100101 LoadingComponent,
Radek Krejci6e772b22018-01-25 13:28:57 +0100102 CheckLeafValue,
103 TreeScrollTo,
104 TreeIndent,
Radek Krejci9b41f5b2018-01-31 14:17:50 +0100105 TreeCreate,
Radek Krejcia1339602017-11-02 13:52:38 +0100106 TreeView,
Radek Krejcid23f0df2017-08-31 16:34:49 +0200107 YANGComponent,
108 MonitoringComponent,
109 PluginsComponent
110 ],
Radek Krejci95bd14c2017-09-21 14:24:13 +0200111 providers: [
Radek Krejci6be087d2018-02-14 08:53:20 +0100112 SessionsService,
113 SchemasService
Radek Krejci95bd14c2017-09-21 14:24:13 +0200114 ],
Radek Krejcid23f0df2017-08-31 16:34:49 +0200115 entryComponents : [
116 NetopeerComponent
117 ]
118})
119export class NetopeerModule { }