From 5bdfaeccb81077bbfd2e97d26507b6eadeda606a Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sat, 30 Sep 2017 23:12:21 +0100 Subject: [PATCH] #1513 fixed the landing page and also the reverse proxy images --- .../app/landingpage/landingpage.component.html | 2 +- .../app/landingpage/landingpage.component.ts | 14 +++++++++++--- src/Ombi/ClientApp/app/login/login.component.html | 2 +- src/Ombi/ClientApp/app/login/login.component.ts | 12 +++++++++--- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/Ombi/ClientApp/app/landingpage/landingpage.component.html b/src/Ombi/ClientApp/app/landingpage/landingpage.component.html index fc155eeab..2678f4bb9 100644 --- a/src/Ombi/ClientApp/app/landingpage/landingpage.component.html +++ b/src/Ombi/ClientApp/app/landingpage/landingpage.component.html @@ -8,7 +8,7 @@
- +
diff --git a/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts b/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts index f5d13420b..0cedce50e 100644 --- a/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts +++ b/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts @@ -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; }); diff --git a/src/Ombi/ClientApp/app/login/login.component.html b/src/Ombi/ClientApp/app/login/login.component.html index 3d8d08d22..afdbe90a5 100644 --- a/src/Ombi/ClientApp/app/login/login.component.html +++ b/src/Ombi/ClientApp/app/login/login.component.html @@ -8,7 +8,7 @@ include the remember me checkbox
-
+

diff --git a/src/Ombi/ClientApp/app/login/login.component.ts b/src/Ombi/ClientApp/app/login/login.component.ts index 1e2bcef26..a71ea04ea 100644 --- a/src/Ombi/ClientApp/app/login/login.component.ts +++ b/src/Ombi/ClientApp/app/login/login.component.ts @@ -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) {