diff --git a/src/frontend/app/administration/sendmail/sendmail-administration.component.html b/src/frontend/app/administration/sendmail/sendmail-administration.component.html new file mode 100644 index 0000000000000000000000000000000000000000..e821c30b7c448270ac48db777bc70f0e8e58cd9a --- /dev/null +++ b/src/frontend/app/administration/sendmail/sendmail-administration.component.html @@ -0,0 +1,36 @@ +<div class="admin-container" [class.admin-is-mobile]="mobileQuery.matches"> + <mat-sidenav-container autosize class="admin-sidenav-container" > + <mat-sidenav #snav [mode]="mobileQuery.matches ? 'over' : 'side'" [fixedInViewport]="mobileQuery.matches" fixedTopGap="56" + [opened]="mobileQuery.matches ? false : true"> + <menu-shortcut></menu-shortcut> + <menu-nav></menu-nav> + </mat-sidenav> + <mat-sidenav-content> + <div *ngIf="loading" style="display:flex;height:100%;"> + <mat-spinner style="margin:auto;"></mat-spinner> + </div> + <mat-card *ngIf="!loading" class="card-app-content"> + <mat-tab-group> + <mat-tab label="{{lang.informations}}"> + <form (ngSubmit)="onSubmit()" #passwordForm="ngForm"> + <div class="form-group"> + <div class="col-md-12"> + <mat-form-field> + <input matInput placeholder="{{lang.host}}"> + </mat-form-field> + </div> + </div> + <div class="col-md-12 text-center" style="padding:10px;"> + <button mat-raised-button type="submit" color="primary">{{lang.validate}}</button> + <button mat-raised-button type="button" color="default" (click)="cancelModification()">{{lang.cancel}}</button> + </div> + </form> + </mat-tab> + </mat-tab-group> + </mat-card> + </mat-sidenav-content> + <mat-sidenav #snav2 [mode]="mobileQuery.matches ? 'over' : 'side'" [fixedInViewport]="mobileQuery.matches" fixedTopGap="56" + position='end' [opened]="mobileQuery.matches ? false : false" style="overflow-x:hidden;max-width:500px;"> + </mat-sidenav> + </mat-sidenav-container> +</div> \ No newline at end of file diff --git a/src/frontend/app/administration/sendmail/sendmail-administration.component.ts b/src/frontend/app/administration/sendmail/sendmail-administration.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf56f7150ba28f3daa79bb7771ce35c5a1080ce2 --- /dev/null +++ b/src/frontend/app/administration/sendmail/sendmail-administration.component.ts @@ -0,0 +1,73 @@ +import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { MediaMatcher } from '@angular/cdk/layout'; +import { HttpClient } from '@angular/common/http'; +import { LANG } from '../../translate.component'; +import { MatSidenav } from '@angular/material'; +import { NotificationService } from '../../notification.service'; +import { HeaderService } from '../../../service/header.service'; + +declare function $j(selector: any): any; + +declare var angularGlobals: any; + + +@Component({ + templateUrl: "sendmail-administration.component.html", + providers: [NotificationService] +}) +export class SendmailAdministrationComponent implements OnInit { + + @ViewChild('snav') public sidenavLeft : MatSidenav; + @ViewChild('snav2') public sidenavRight : MatSidenav; + + mobileQuery : MediaQueryList; + private _mobileQueryListener : () => void; + + coreUrl : string; + lang : any = LANG; + loading : boolean = false; + + sendmail: any = { + 'host': '', + 'SMTPAuth': false, + 'username': '', + 'password': '', + 'SMTPSecure': 'ssl', //tls, ssl, starttls + 'port': '', + + }; + sendmailClone: any = {}; + + + constructor(changeDetectorRef: ChangeDetectorRef, media: MediaMatcher, public http: HttpClient, private notify: NotificationService, private headerService: HeaderService) { + $j("link[href='merged_css.php']").remove(); + this.mobileQuery = media.matchMedia('(max-width: 768px)'); + this._mobileQueryListener = () => changeDetectorRef.detectChanges(); + this.mobileQuery.addListener(this._mobileQueryListener); + } + + ngOnDestroy(): void { + this.mobileQuery.removeListener(this._mobileQueryListener); + } + + ngOnInit(): void { + this.headerService.headerMessage = '???'; + window['MainHeaderComponent'].setSnav(this.sidenavLeft); + window['MainHeaderComponent'].setSnavRight(null); + + this.loading = true; + this.coreUrl = angularGlobals.coreUrl; + + // this.http.get(this.coreUrl + 'rest/sendmail') + // .subscribe((data: any) => { + + // }, (err) => { + // this.notify.error(err.error.errors); + // }); + this.loading = false; + } + + cancelModification() { + this.sendmail = JSON.parse(JSON.stringify(this.sendmailClone)); + } +}