]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts
import ceph pacific 16.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / app.module.ts
1 import { APP_BASE_HREF } from '@angular/common';
2 import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
3 import { ErrorHandler, NgModule } from '@angular/core';
4 import { BrowserModule } from '@angular/platform-browser';
5 import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
6
7 import { ToastrModule } from 'ngx-toastr';
8
9 import { AppRoutingModule } from './app-routing.module';
10 import { AppComponent } from './app.component';
11 import { CephModule } from './ceph/ceph.module';
12 import { CoreModule } from './core/core.module';
13 import { ApiInterceptorService } from './shared/services/api-interceptor.service';
14 import { JsErrorHandler } from './shared/services/js-error-handler.service';
15 import { SharedModule } from './shared/shared.module';
16
17 @NgModule({
18 declarations: [AppComponent],
19 imports: [
20 HttpClientModule,
21 BrowserModule,
22 BrowserAnimationsModule,
23 ToastrModule.forRoot({
24 positionClass: 'toast-top-right',
25 preventDuplicates: true,
26 enableHtml: true
27 }),
28 AppRoutingModule,
29 CoreModule,
30 SharedModule,
31 CephModule
32 ],
33 exports: [SharedModule],
34 providers: [
35 {
36 provide: ErrorHandler,
37 useClass: JsErrorHandler
38 },
39 {
40 provide: HTTP_INTERCEPTORS,
41 useClass: ApiInterceptorService,
42 multi: true
43 },
44 {
45 provide: APP_BASE_HREF,
46 useValue: '/' + (window.location.pathname.split('/', 1)[1] || '')
47 }
48 ],
49 bootstrap: [AppComponent]
50 })
51 export class AppModule {}