2020-11-02 08:29:52 +01:00
|
|
|
|
|
|
|
import { NgModule, Injectable, APP_INITIALIZER } from '@angular/core';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
|
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
|
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
|
|
import { HttpClientModule, HttpInterceptor, HttpHandler, HttpRequest, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
|
|
import { MaterialModule } from './material/material.module';
|
2021-01-12 19:29:00 +01:00
|
|
|
import { QRCodeModule } from 'angularx-qrcode';
|
2020-11-02 08:29:52 +01:00
|
|
|
|
|
|
|
import { I18nPipe } from './utils/i18n.pipe';
|
2021-01-12 19:29:00 +01:00
|
|
|
import { HomeComponent, ImprintComponent, PrivacyPolicyComponent } from './pages/home/home.component';
|
|
|
|
import { HomeClubComponent } from './pages/home/club/home-club.component';
|
|
|
|
import { HomeGeneralComponent } from './pages/home/general/home-general.component';
|
|
|
|
import { HomePrivacyComponent } from './pages/home/privacy/home-privacy.component';
|
|
|
|
import { HomeServicesComponent } from './pages/home/services/home-services.component';
|
2020-11-02 08:29:52 +01:00
|
|
|
import { AccountComponent } from './pages/account/account.component';
|
|
|
|
import { AppsComponent } from './pages/apps/apps.component';
|
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { LoginComponent } from './pages/login/login.component';
|
2021-01-12 19:29:00 +01:00
|
|
|
import { LoginTotpComponent } from './pages/login-totp/login-totp.component';
|
2020-11-02 08:29:52 +01:00
|
|
|
import { FormLoginComponent } from './pages/form-login/form-login.component';
|
2021-01-12 19:29:00 +01:00
|
|
|
import { FormLoginTotpComponent } from './pages/form-login-totp/form-login-totp.component';
|
2020-11-02 08:29:52 +01:00
|
|
|
import { TokensComponent } from './pages/tokens/tokens.component';
|
|
|
|
import { PermissionsComponent } from './ui/permissions/permissions.component';
|
|
|
|
import { QuotasComponent } from './ui/quotas/quotas.component';
|
2021-01-12 19:29:00 +01:00
|
|
|
import { SecurityComponent, SecurityTotpDialog } from './pages/account/security/security.component';
|
2020-11-02 08:29:52 +01:00
|
|
|
import { VoucherComponent } from './pages/account/voucher/voucher.component';
|
|
|
|
import { VoucherDialog } from './pages/account/voucher/voucher.component';
|
|
|
|
import { InfoComponent } from './pages/account/info/info.component';
|
|
|
|
import { PasswordComponent } from './pages/password/password.component';
|
2021-01-12 19:29:00 +01:00
|
|
|
import { PasswordResetComponent } from './pages/password-reset/password-reset.component';
|
|
|
|
import { RegisterComponent, RegisterDialog } from './pages/register/register.component';
|
2020-11-02 08:29:52 +01:00
|
|
|
import { UsernameDialog } from './pages/register/username-dialog/username.dialog';
|
|
|
|
import { UnavailableComponent } from './pages/unavailable/unavailable.component';
|
|
|
|
import { NotfoundComponent } from './pages/notfound/notfound.component';
|
|
|
|
import { HtmlComponent } from './utils/html/html.component';
|
|
|
|
|
|
|
|
|
|
|
|
import { I18nService } from './services/i18n.service';
|
|
|
|
|
|
|
|
|
|
|
|
export function init_app(i18n: I18nService) {
|
2021-01-12 19:29:00 +01:00
|
|
|
return () => i18n.fetch(i18n.getLocale()).then(response => { }, error => { });
|
2020-11-02 08:29:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class XhrInterceptor implements HttpInterceptor {
|
|
|
|
|
|
|
|
intercept(req: HttpRequest<any>, next: HttpHandler) {
|
|
|
|
const xhr = req.clone({
|
|
|
|
headers: req.headers.set('X-Requested-With', 'XMLHttpRequest').set('Content-Type', 'application/json;charset=UTF-8'), withCredentials: true
|
|
|
|
});
|
|
|
|
return next.handle(xhr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
declarations: [
|
|
|
|
I18nPipe,
|
|
|
|
AppComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
HomeComponent, ImprintComponent, PrivacyPolicyComponent,
|
|
|
|
HomeClubComponent,
|
|
|
|
HomeGeneralComponent,
|
|
|
|
HomePrivacyComponent,
|
|
|
|
HomeServicesComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
AccountComponent,
|
|
|
|
LoginComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
LoginTotpComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
FormLoginComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
FormLoginTotpComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
TokensComponent,
|
|
|
|
AppsComponent,
|
|
|
|
PermissionsComponent,
|
|
|
|
QuotasComponent,
|
|
|
|
SecurityComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
SecurityTotpDialog,
|
2020-11-02 08:29:52 +01:00
|
|
|
VoucherComponent,
|
|
|
|
VoucherDialog,
|
|
|
|
InfoComponent,
|
|
|
|
PasswordComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
PasswordResetComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
RegisterComponent,
|
|
|
|
RegisterDialog,
|
|
|
|
UsernameDialog,
|
|
|
|
UnavailableComponent,
|
|
|
|
NotfoundComponent,
|
|
|
|
HtmlComponent
|
|
|
|
],
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
AppRoutingModule,
|
|
|
|
BrowserAnimationsModule,
|
|
|
|
MaterialModule,
|
|
|
|
HttpClientModule,
|
|
|
|
FormsModule,
|
|
|
|
ReactiveFormsModule,
|
2021-01-12 19:29:00 +01:00
|
|
|
QRCodeModule,
|
2020-11-02 08:29:52 +01:00
|
|
|
],
|
|
|
|
exports: [MaterialModule],
|
|
|
|
providers: [{ provide: APP_INITIALIZER, useFactory: init_app, deps: [I18nService], multi: true }, { provide: HTTP_INTERCEPTORS, useClass: XhrInterceptor, multi: true }],
|
|
|
|
bootstrap: [AppComponent],
|
|
|
|
})
|
|
|
|
export class AppModule {
|
|
|
|
}
|