#1513 fixed the landing page and also the reverse proxy images

pull/1529/head
tidusjar 7 years ago
parent cd5cc1fe26
commit 5bdfaeccb8

@ -8,7 +8,7 @@
<img [src]="customizationSettings.logo" style="width:100%"/>
</div>
<div *ngIf="!customizationSettings.logo">
<img src="/images/logo.png" style="width:100%" />
<img src="{{baseUrl}}/images/logo.png" style="width:100%" />
</div>
</div>
</div>

@ -1,4 +1,6 @@
import { Component, OnInit } from "@angular/core";
import { PlatformLocation } from "@angular/common";
import { Component, OnInit } from "@angular/core";
import { IMediaServerStatus } from "../interfaces";
import { ICustomizationSettings, ILandingPageSettings } from "../interfaces";
import { LandingPageService } from "../services";
@ -17,18 +19,24 @@ export class LandingPageComponent implements OnInit {
public landingPageSettings: ILandingPageSettings;
public background: any;
public mediaServerStatus: IMediaServerStatus;
public baseUrl: string;
constructor(private settingsService: SettingsService,
private images: ImageService, private sanitizer: DomSanitizer, private landingPageService: LandingPageService) { }
private images: ImageService, private sanitizer: DomSanitizer, private landingPageService: LandingPageService,
private location: PlatformLocation) { }
public ngOnInit() {
this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x);
this.settingsService.getLandingPage().subscribe(x => this.landingPageSettings = x);
this.images.getRandomBackground().subscribe(x => {
this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%), url(" + x.url + ")");
});
const base = this.location.getBaseHrefFromDOM();
if (base.length > 1) {
this.baseUrl = base;
}
this.landingPageService.getServerStatus().subscribe(x => {
this.mediaServerStatus = x;
});

@ -8,7 +8,7 @@ include the remember me checkbox
<div class="container" id="login">
<div class="card card-container">
<!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> -->
<div *ngIf="!customizationSettings.logo"><img id="profile-img" class="profile-img-card" src="/images/ms-icon-150x150.png" /></div>
<div *ngIf="!customizationSettings.logo"><img id="profile-img" class="profile-img-card" src="{{baseUrl}}/images/ms-icon-150x150.png" /></div>
<div *ngIf="customizationSettings.logo"><img id="profile-img" class="center" [src]="customizationSettings.logo" /></div>
<p id="profile-name" class="profile-name-card"></p>

@ -2,6 +2,7 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router";
import { PlatformLocation } from "@angular/common";
import { AuthService } from "../auth/auth.service";
import { ICustomizationSettings } from "../interfaces";
import { NotificationService } from "../services";
@ -21,14 +22,15 @@ export class LoginComponent implements OnInit {
public customizationSettings: ICustomizationSettings;
public background: any;
public landingFlag: boolean;
public baseUrl: string;
constructor(private authService: AuthService, private router: Router, private notify: NotificationService, private status: StatusService,
private fb: FormBuilder, private settingsService: SettingsService, private images: ImageService, private sanitizer: DomSanitizer,
private route: ActivatedRoute) {
private route: ActivatedRoute, private location: PlatformLocation) {
this.route.params
.subscribe(params => {
.subscribe((params: any) => {
this.landingFlag = params.landing;
if (this.landingFlag === false) {
if (!this.landingFlag) {
this.settingsService.getLandingPage().subscribe(x => {
if (x.enabled && !this.landingFlag) {
this.router.navigate(["landingpage"]);
@ -55,6 +57,10 @@ export class LoginComponent implements OnInit {
this.images.getRandomBackground().subscribe(x => {
this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%),url(" + x.url + ")");
});
const base = this.location.getBaseHrefFromDOM();
if (base.length > 1) {
this.baseUrl = base;
}
}
public onSubmit(form: FormGroup) {

Loading…
Cancel
Save