2020-11-02 08:29:52 +01:00
|
|
|
|
2021-03-11 19:52:37 +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';
|
|
|
|
import {QRCodeModule} from 'angularx-qrcode';
|
2021-07-29 17:41:25 +02:00
|
|
|
import {DatePipe} from '@angular/common';
|
2020-11-02 08:29:52 +01:00
|
|
|
|
2021-06-05 19:49:20 +02:00
|
|
|
|
2021-07-29 17:41:25 +02:00
|
|
|
import {AutofocusDirective} from './material/autofocus';
|
2021-06-05 19:49:20 +02:00
|
|
|
|
2021-03-11 19:52:37 +01:00
|
|
|
import {I18nPipe} from './utils/i18n.pipe';
|
2021-03-13 10:08:54 +01:00
|
|
|
import {ImprintComponent, PrivacyPolicyComponent, TermsOfServiceComponent} from './pages/general/general.component';
|
2021-03-11 19:52:37 +01:00
|
|
|
import {AccountComponent} from './pages/account/account.component';
|
2021-03-13 09:47:25 +01:00
|
|
|
import {ServicesComponent} from './pages/services/services.component';
|
2021-03-11 19:52:37 +01:00
|
|
|
import {AppComponent} from './app.component';
|
|
|
|
import {LoginComponent} from './pages/login/login.component';
|
|
|
|
import {FormLoginComponent} from './pages/form-login/form-login.component';
|
2021-07-22 18:45:04 +02:00
|
|
|
import {FormLogin2FAComponent} from './pages/form-login-2fa/form-login-2fa.component';
|
2021-03-11 19:52:37 +01:00
|
|
|
import {TokensComponent} from './pages/tokens/tokens.component';
|
2021-05-06 21:26:57 +02:00
|
|
|
import {InvitesComponent} from './pages/invites/invites.component';
|
2021-03-11 19:52:37 +01:00
|
|
|
import {PermissionsComponent} from './ui/permissions/permissions.component';
|
|
|
|
import {ProfileFieldDialog, ProfileFieldsComponent, ProfileFieldBlob} from './ui/profilefields/profilefields.component';
|
2021-05-30 17:02:07 +02:00
|
|
|
import {ProfileFieldPgpBlob} from './ui/profilefields/binary/pgp/profilefield.pgp-blob';
|
2021-03-11 19:52:37 +01:00
|
|
|
import {QuotasComponent} from './ui/quotas/quotas.component';
|
|
|
|
import {SecurityComponent, SecurityTotpDialog} from './pages/account/security/security.component';
|
|
|
|
import {VoucherComponent} from './pages/account/voucher/voucher.component';
|
|
|
|
import {VoucherDialog} from './pages/account/voucher/voucher.component';
|
|
|
|
import {InfoComponent} from './pages/account/info/info.component';
|
2021-03-30 15:14:07 +02:00
|
|
|
import {AliasesComponent} from './pages/account/aliases/aliases.component';
|
2021-04-08 09:45:50 +02:00
|
|
|
import {DomainsComponent} from './pages/account/domains/domains.component';
|
2021-03-11 19:52:37 +01:00
|
|
|
import {ProfileComponent} from './pages/account/profile/profile.component';
|
|
|
|
import {PasswordComponent} from './pages/password/password.component';
|
|
|
|
import {PasswordResetComponent} from './pages/password-reset/password-reset.component';
|
|
|
|
import {RegisterComponent, RegisterDialog} from './pages/register/register.component';
|
|
|
|
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';
|
2021-03-18 15:12:30 +01:00
|
|
|
import {ConfirmDialog} from './ui/confirm/confirm.component'
|
|
|
|
import {UserComponent} from './pages/user/user.component'
|
2021-04-16 08:57:53 +02:00
|
|
|
import {JitsiComponent, JitsiShareDialog} from './pages/jitsi/jitsi.component'
|
2021-07-29 17:41:25 +02:00
|
|
|
import {ParteyTimeslotsComponent, ParteyTimeslotDialog} from './pages/partey/timeslots/timeslots.compontent'
|
2021-08-16 19:06:12 +02:00
|
|
|
import {UrlShortenerComponent, UrlShortenerPasswordComponent, UrlShortenerShareDialog, UrlShortenerEditDialog} from './pages/urlshortener/urlshortener.component'
|
2020-11-02 08:29:52 +01:00
|
|
|
|
|
|
|
|
2021-03-11 19:52:37 +01:00
|
|
|
import {I18nService} from './services/i18n.service';
|
2021-07-29 17:41:25 +02:00
|
|
|
import {MinetestAccountsComponent} from './pages/minetest/accounts/accounts.component';
|
2020-11-02 08:29:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
export function init_app(i18n: I18nService) {
|
2021-03-18 15:12:30 +01:00
|
|
|
return () => i18n.fetch().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: [
|
2021-06-05 19:49:20 +02:00
|
|
|
AutofocusDirective,
|
2020-11-02 08:29:52 +01:00
|
|
|
I18nPipe,
|
|
|
|
AppComponent,
|
2021-03-13 10:08:54 +01:00
|
|
|
ImprintComponent, PrivacyPolicyComponent, TermsOfServiceComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
AccountComponent,
|
|
|
|
LoginComponent,
|
|
|
|
FormLoginComponent,
|
2021-07-22 18:45:04 +02:00
|
|
|
FormLogin2FAComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
TokensComponent,
|
2021-05-06 21:26:57 +02:00
|
|
|
InvitesComponent,
|
2021-03-13 09:47:25 +01:00
|
|
|
ServicesComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
PermissionsComponent,
|
2021-05-30 17:02:07 +02:00
|
|
|
ProfileFieldsComponent, ProfileFieldDialog, ProfileFieldBlob, ProfileFieldPgpBlob,
|
2020-11-02 08:29:52 +01:00
|
|
|
QuotasComponent,
|
|
|
|
SecurityComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
SecurityTotpDialog,
|
2020-11-02 08:29:52 +01:00
|
|
|
VoucherComponent,
|
|
|
|
VoucherDialog,
|
|
|
|
InfoComponent,
|
2021-03-30 15:14:07 +02:00
|
|
|
AliasesComponent,
|
2021-04-08 09:45:50 +02:00
|
|
|
DomainsComponent,
|
2021-03-11 19:52:37 +01:00
|
|
|
ProfileComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
PasswordComponent,
|
2021-01-12 19:29:00 +01:00
|
|
|
PasswordResetComponent,
|
2020-11-02 08:29:52 +01:00
|
|
|
RegisterComponent,
|
|
|
|
RegisterDialog,
|
|
|
|
UsernameDialog,
|
|
|
|
UnavailableComponent,
|
|
|
|
NotfoundComponent,
|
2021-03-18 15:12:30 +01:00
|
|
|
HtmlComponent,
|
|
|
|
ConfirmDialog,
|
2021-04-16 08:57:53 +02:00
|
|
|
UserComponent,
|
2021-06-05 19:49:20 +02:00
|
|
|
JitsiComponent, JitsiShareDialog,
|
2021-07-29 17:41:25 +02:00
|
|
|
ParteyTimeslotsComponent, ParteyTimeslotDialog,
|
|
|
|
MinetestAccountsComponent,
|
2021-08-16 19:06:12 +02:00
|
|
|
UrlShortenerComponent, UrlShortenerShareDialog, UrlShortenerEditDialog, UrlShortenerPasswordComponent
|
2020-11-02 08:29:52 +01:00
|
|
|
],
|
|
|
|
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],
|
2021-04-16 15:41:09 +02:00
|
|
|
providers: [{provide: APP_INITIALIZER, useFactory: init_app, deps: [I18nService], multi: true}, {provide: HTTP_INTERCEPTORS, useClass: XhrInterceptor, multi: true}, DatePipe],
|
2020-11-02 08:29:52 +01:00
|
|
|
bootstrap: [AppComponent],
|
|
|
|
})
|
|
|
|
export class AppModule {
|
|
|
|
}
|