-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.module.ts
executable file
·101 lines (95 loc) · 3.51 KB
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import { NgModule } from '@angular/core';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule as NgRouterModule } from '@angular/router';
import { UpgradeModule as NgUpgradeModule } from '@angular/upgrade/static';
import { CoreModule, RouterModule, HOOK_ONCE_ROUTE, ViewContext} from '@c8y/ngx-components';
import { AssetsNavigatorModule } from '@c8y/ngx-components/assets-navigator';
import { DeviceGridExampleModule } from '@c8y/ngx-components/device-grid-example';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { DeviceProfileModule } from '@c8y/ngx-components/device-profile';
import { OperationsModule, SingleOperationDetailsModule} from '@c8y/ngx-components/operations';
import { ImpactProtocolModule } from '@c8y/ngx-components/protocol-impact';
import { OpcuaProtocolModule } from '@c8y/ngx-components/protocol-opcua';
import { RepositoryModule } from '@c8y/ngx-components/repository';
import { TrustedCertificatesModule } from '@c8y/ngx-components/trusted-certificates';
import { BinaryFileDownloadModule } from '@c8y/ngx-components/binary-file-download';
import { LoraProtocolModule } from '@c8y/ngx-components/protocol-lora';
import { DockerComponent } from './components/docker-comp/docker.component';
import { AnalyticsComponent } from './components/analytics/analytics.component';
import { AnalyticsEPLComponent } from './components/analytics/apamaepl/apamaepl.component';
import { AnalyticsBuilderComponent } from './components/analytics/analyticsbuilder/apamaAB.component';
import { DockerGuard } from './components/helper/docker.guard';
import { AnalyticsGuard } from './components/helper/analytics.guard';
import {
DashboardUpgradeModule,
HybridAppModule,
UpgradeModule,
UPGRADE_ROUTES
} from '@c8y/ngx-components/upgrade';
@NgModule({
imports: [
// Upgrade module must be the first
UpgradeModule,
BrowserAnimationsModule,
RouterModule.forRoot(),
NgRouterModule.forRoot([
...UPGRADE_ROUTES
], { enableTracing: false, useHash: true }),
CoreModule.forRoot(),
AssetsNavigatorModule.config({
smartGroups: true
}),
OpcuaProtocolModule,
ImpactProtocolModule,
BsDropdownModule,
TrustedCertificatesModule,
DeviceGridExampleModule,
OperationsModule,
NgUpgradeModule,
DashboardUpgradeModule,
RepositoryModule,
DeviceProfileModule,
LoraProtocolModule,
BinaryFileDownloadModule,
SingleOperationDetailsModule
],
declarations: [
AnalyticsComponent,
DockerComponent,
AnalyticsEPLComponent,
AnalyticsBuilderComponent
],
entryComponents: [
AnalyticsComponent,
DockerComponent
],
providers: [
DockerGuard,
AnalyticsGuard,
{
provide: HOOK_ONCE_ROUTE, // 1.
useValue: [{ // 2.
context: ViewContext.Device, // 3.
path: 'analytics', // 4.
component: AnalyticsComponent, // 5.
label: 'Analytics', // 6.
priority: 100,
icon: 'diamond',
canActivate: [AnalyticsGuard]
},{
context: ViewContext.Device, // 3.
path: 'docker', // 4.
component: DockerComponent, // 5.
label: 'Docker', // 6.
priority: 100,
icon: 'cubes',
canActivate: [DockerGuard]
}],
multi: true
}]
})
export class AppModule extends HybridAppModule {
constructor(protected upgrade: NgUpgradeModule) {
super();
}
}