gns3-web-ui/src/app/app.module.ts

162 lines
5.9 KiB
TypeScript
Raw Normal View History

import * as Raven from 'raven-js';
2017-09-25 11:07:52 +00:00
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';
2017-09-25 11:07:52 +00:00
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';
2017-11-27 10:55:20 +00:00
import { CdkTableModule } from "@angular/cdk/table";
2018-01-03 13:26:35 +00:00
import { HttpClientModule } from '@angular/common/http';
2017-09-25 11:07:52 +00:00
2017-10-31 13:44:47 +00:00
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {
MatButtonModule,
MatCardModule,
MatMenuModule,
MatToolbarModule,
MatIconModule,
MatFormFieldModule,
MatInputModule,
MatTableModule,
2017-12-04 13:52:34 +00:00
MatDialogModule,
MatProgressBarModule,
MatProgressSpinnerModule,
MatSnackBarModule
2017-10-31 13:44:47 +00:00
} from '@angular/material';
2017-11-27 10:55:20 +00:00
import { D3Service } from 'd3-ng2-service';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { HotkeyModule } from 'angular2-hotkeys';
2017-11-27 10:55:20 +00:00
import { AppRoutingModule } from './app-routing.module';
import { VersionService } from './shared/services/version.service';
import { ProjectService } from './shared/services/project.service';
import { SymbolService } from "./shared/services/symbol.service";
import { ServerService } from "./shared/services/server.service";
import { IndexedDbService } from "./shared/services/indexed-db.service";
import { HttpServer } from "./shared/services/http-server.service";
import { SnapshotService } from "./shared/services/snapshot.service";
import { ProgressDialogService } from "./shared/progress-dialog/progress-dialog.service";
2017-11-30 07:59:52 +00:00
import { NodeService } from "./shared/services/node.service";
2017-11-30 09:27:41 +00:00
import { ApplianceService } from "./shared/services/appliance.service";
2017-12-04 13:52:34 +00:00
import { LinkService } from "./shared/services/link.service";
2017-11-27 10:55:20 +00:00
import { ProjectsComponent } from './projects/projects.component';
import { DefaultLayoutComponent } from './default-layout/default-layout.component';
2017-11-27 10:08:15 +00:00
import { ProgressDialogComponent } from './shared/progress-dialog/progress-dialog.component';
2017-11-27 10:55:20 +00:00
import { AppComponent } from './app.component';
2017-11-27 10:55:20 +00:00
import { CreateSnapshotDialogComponent, ProjectMapComponent } from './project-map/project-map.component';
import { ServersComponent, AddServerDialogComponent } from './servers/servers.component';
2017-11-29 12:19:53 +00:00
import { NodeContextMenuComponent } from './shared/node-context-menu/node-context-menu.component';
2017-11-29 15:07:53 +00:00
import { StartNodeActionComponent } from './shared/node-context-menu/actions/start-node-action/start-node-action.component';
2017-11-30 07:59:52 +00:00
import { StopNodeActionComponent } from './shared/node-context-menu/actions/stop-node-action/stop-node-action.component';
2017-11-30 09:27:41 +00:00
import { ApplianceComponent } from './appliance/appliance.component';
import { ApplianceListDialogComponent } from './appliance/appliance-list-dialog/appliance-list-dialog.component';
2017-12-01 13:07:19 +00:00
import { NodeSelectInterfaceComponent } from './shared/node-select-interface/node-select-interface.component';
2018-01-03 15:46:15 +00:00
import { CartographyModule } from './cartography/cartography.module';
import { ToasterService } from './shared/services/toaster.service';
2018-03-27 15:21:50 +00:00
import { ProjectWebServiceHandler } from "./shared/handlers/project-web-service-handler";
import { LinksDataSource } from "./cartography/shared/datasources/links-datasource";
import { NodesDataSource } from "./cartography/shared/datasources/nodes-datasource";
import { SymbolsDataSource } from "./cartography/shared/datasources/symbols-datasource";
import { SelectionManager } from "./cartography/shared/managers/selection-manager";
import { InRectangleHelper } from "./cartography/map/helpers/in-rectangle-helper";
import { DrawingsDataSource } from "./cartography/shared/datasources/drawings-datasource";
2018-03-29 10:36:35 +00:00
import { MoveLayerDownActionComponent } from './shared/node-context-menu/actions/move-layer-down-action/move-layer-down-action.component';
import { MoveLayerUpActionComponent } from './shared/node-context-menu/actions/move-layer-up-action/move-layer-up-action.component';
import { ProjectMapShortcutsComponent } from './project-map/project-map-shortcuts/project-map-shortcuts.component';
2017-11-27 10:55:20 +00:00
2018-03-30 10:48:27 +00:00
import { environment } from "../environments/environment";
Raven
.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726')
.install();
export class RavenErrorHandler implements ErrorHandler {
handleError(err:any) : void {
console.error(err.originalError || err);
2018-03-30 10:48:27 +00:00
if (environment.production) {
Raven.captureException(err.originalError || err);
}
}
}
2017-10-31 13:44:47 +00:00
2017-09-25 11:07:52 +00:00
@NgModule({
declarations: [
AppComponent,
ProjectMapComponent,
ServersComponent,
2017-10-31 13:44:47 +00:00
AddServerDialogComponent,
2017-11-23 12:18:23 +00:00
CreateSnapshotDialogComponent,
2017-09-25 11:07:52 +00:00
ProjectsComponent,
DefaultLayoutComponent,
2017-11-27 10:08:15 +00:00
ProgressDialogComponent,
2017-11-29 12:19:53 +00:00
NodeContextMenuComponent,
2017-11-29 15:07:53 +00:00
StartNodeActionComponent,
2017-11-30 07:59:52 +00:00
StopNodeActionComponent,
2017-11-30 09:27:41 +00:00
ApplianceComponent,
ApplianceListDialogComponent,
2017-12-01 13:07:19 +00:00
NodeSelectInterfaceComponent,
2018-03-29 10:36:35 +00:00
MoveLayerDownActionComponent,
MoveLayerUpActionComponent,
ProjectMapShortcutsComponent,
2017-09-25 11:07:52 +00:00
],
imports: [
NgbModule.forRoot(),
BrowserModule,
HttpModule,
2018-01-03 13:26:35 +00:00
HttpClientModule,
2017-09-25 11:07:52 +00:00
AppRoutingModule,
2017-10-31 13:44:47 +00:00
FormsModule,
BrowserAnimationsModule,
MatButtonModule,
MatMenuModule,
MatCardModule,
MatToolbarModule,
MatIconModule,
MatFormFieldModule,
MatInputModule,
MatTableModule,
MatDialogModule,
2017-11-27 10:08:15 +00:00
MatProgressBarModule,
2017-12-04 13:52:34 +00:00
MatProgressSpinnerModule,
MatSnackBarModule,
2018-01-03 15:46:15 +00:00
CdkTableModule,
CartographyModule,
HotkeyModule.forRoot()
2017-09-25 11:07:52 +00:00
],
providers: [
{ provide: ErrorHandler, useClass: RavenErrorHandler },
2017-09-25 11:07:52 +00:00
D3Service,
VersionService,
ProjectService,
SymbolService,
ServerService,
2017-11-30 09:27:41 +00:00
ApplianceService,
2017-11-29 15:07:53 +00:00
NodeService,
2017-12-04 11:25:13 +00:00
LinkService,
2017-09-25 11:07:52 +00:00
IndexedDbService,
HttpServer,
2017-11-27 10:08:15 +00:00
SnapshotService,
ProgressDialogService,
2018-03-19 14:09:22 +00:00
ToasterService,
ProjectWebServiceHandler,
LinksDataSource,
NodesDataSource,
2018-03-22 14:40:06 +00:00
SymbolsDataSource,
SelectionManager,
2018-03-27 15:21:50 +00:00
InRectangleHelper,
DrawingsDataSource
2017-09-25 11:07:52 +00:00
],
entryComponents: [
2017-11-23 12:18:23 +00:00
AddServerDialogComponent,
2017-11-27 10:08:15 +00:00
CreateSnapshotDialogComponent,
2017-11-30 09:27:41 +00:00
ProgressDialogComponent,
ApplianceListDialogComponent
2017-09-25 11:07:52 +00:00
],
bootstrap: [ AppComponent ]
})
export class AppModule { }