From 0fcea2881b550e5476a4b05668915d3831a0451e Mon Sep 17 00:00:00 2001 From: TidusJar Date: Tue, 18 Dec 2018 10:04:14 +0000 Subject: [PATCH] Fixed #2678 --- .../createadmin/createadmin.component.html | 2 +- .../createadmin/createadmin.component.ts | 19 ++++++-- .../app/wizard/emby/emby.component.html | 2 +- .../app/wizard/emby/emby.component.ts | 9 +++- .../mediaserver/mediaserver.component.html | 48 +++++++++++-------- .../mediaserver/mediaserver.component.scss | 12 +++++ .../mediaserver/mediaserver.component.ts | 24 +++++----- .../app/wizard/plex/plex.component.html | 2 +- .../app/wizard/plex/plex.component.ts | 9 +++- .../app/wizard/plex/plexoauth.component.html | 2 +- .../app/wizard/plex/plexoauth.component.ts | 9 +++- .../app/wizard/welcome/welcome.component.html | 2 +- .../app/wizard/welcome/welcome.component.ts | 17 +++++-- 13 files changed, 108 insertions(+), 49 deletions(-) create mode 100644 src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.scss diff --git a/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.html b/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.html index 2a7facaa5..7e6710171 100644 --- a/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.html +++ b/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.html @@ -1,5 +1,5 @@  - +
diff --git a/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts b/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts index ee5514fcb..86d4bc9b7 100644 --- a/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts +++ b/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts @@ -1,26 +1,35 @@ -import { Component } from "@angular/core"; +import { Component, OnInit } from "@angular/core"; import { Router } from "@angular/router"; +import { PlatformLocation } from "@angular/common"; import { IdentityService } from "../../services"; import { NotificationService } from "../../services"; @Component({ templateUrl: "./createadmin.component.html", }) -export class CreateAdminComponent { +export class CreateAdminComponent implements OnInit { public username: string; public password: string; + public baseUrl: string; constructor(private identityService: IdentityService, private notificationService: NotificationService, - private router: Router) { } + private router: Router, private location: PlatformLocation) { } + + public ngOnInit(): void { + const base = this.location.getBaseHrefFromDOM(); + if (base.length > 1) { + this.baseUrl = base; + } + } public createUser() { - this.identityService.createWizardUser({username: this.username, password: this.password, usePlexAdminAccount: false}).subscribe(x => { + this.identityService.createWizardUser({ username: this.username, password: this.password, usePlexAdminAccount: false }).subscribe(x => { if (x.result) { this.router.navigate(["login"]); } else { - if(x.errors.length > 0) { + if (x.errors.length > 0) { this.notificationService.error(x.errors[0]); } } diff --git a/src/Ombi/ClientApp/app/wizard/emby/emby.component.html b/src/Ombi/ClientApp/app/wizard/emby/emby.component.html index 98f11cbcd..c43aa7c6f 100644 --- a/src/Ombi/ClientApp/app/wizard/emby/emby.component.html +++ b/src/Ombi/ClientApp/app/wizard/emby/emby.component.html @@ -1,5 +1,5 @@  - +
diff --git a/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts b/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts index 7b7c06ed5..d7114e489 100644 --- a/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts +++ b/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts @@ -4,6 +4,7 @@ import { Router } from "@angular/router"; import { EmbyService } from "../../services"; import { NotificationService } from "../../services"; +import { PlatformLocation } from "@angular/common"; import { IEmbySettings } from "../../interfaces"; @Component({ @@ -12,13 +13,19 @@ import { IEmbySettings } from "../../interfaces"; export class EmbyComponent implements OnInit { public embySettings: IEmbySettings; + public baseUrl: string; constructor(private embyService: EmbyService, private router: Router, - private notificationService: NotificationService) { + private notificationService: NotificationService, + private location: PlatformLocation) { } public ngOnInit() { + const base = this.location.getBaseHrefFromDOM(); + if (base.length > 1) { + this.baseUrl = base; + } this.embySettings = { servers: [], id: 0, diff --git a/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.html b/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.html index e6768328e..22e8fdeb8 100644 --- a/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.html +++ b/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.html @@ -1,29 +1,37 @@ - - +
-
+

Please choose your media server

-
-
- - - +
+
+
+ + + +
-
- - - +
+
+ + + +
-
- +
+
+
If you do not yet want to setup a media server you can use the + skip below. You can later setup your media servers via the settings.
+
+ +
+
-
-
- - +
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.scss b/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.scss new file mode 100644 index 000000000..824b275c0 --- /dev/null +++ b/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.scss @@ -0,0 +1,12 @@ + +.vr { + border-right: 1px solid rgba(0, 0, 0, 0.2); + height: 100%; +} + +.top-spacing { + margin-top:10%; +} +.small-top-spacing { + margin-top:5%; +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.ts b/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.ts index 5e2c7ff94..84958152e 100644 --- a/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.ts +++ b/src/Ombi/ClientApp/app/wizard/mediaserver/mediaserver.component.ts @@ -1,21 +1,19 @@ -import { Component } from "@angular/core"; -import { Router } from "@angular/router"; +import { PlatformLocation } from "@angular/common"; +import { Component, OnInit } from "@angular/core"; @Component({ templateUrl: "./mediaserver.component.html", + styleUrls: ["./mediaserver.component.scss"], }) -export class MediaServerComponent { - constructor(private router: Router) { } +export class MediaServerComponent implements OnInit { - public plex() { - this.router.navigate(["Wizard/Plex"]); - } - - public emby() { - this.router.navigate(["Wizard/Emby"]); - } + public baseUrl: string; + constructor(private location: PlatformLocation) { } - public skip() { - this.router.navigate(["Wizard/CreateAdmin"]); + public ngOnInit(): void { + const base = this.location.getBaseHrefFromDOM(); + if (base.length > 1) { + this.baseUrl = base; + } } } diff --git a/src/Ombi/ClientApp/app/wizard/plex/plex.component.html b/src/Ombi/ClientApp/app/wizard/plex/plex.component.html index a48c0f73e..611c78dbf 100644 --- a/src/Ombi/ClientApp/app/wizard/plex/plex.component.html +++ b/src/Ombi/ClientApp/app/wizard/plex/plex.component.html @@ -1,5 +1,5 @@  - +
diff --git a/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts b/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts index d3ee8efa6..b8be259aa 100644 --- a/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts +++ b/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { Router } from "@angular/router"; +import { PlatformLocation } from "@angular/common"; import { PlexService, PlexTvService, SettingsService } from "../../services"; import { IdentityService, NotificationService } from "../../services"; @@ -11,15 +12,21 @@ export class PlexComponent implements OnInit { public login: string; public password: string; + public baseUrl: string; private clientId: string; constructor(private plexService: PlexService, private router: Router, private notificationService: NotificationService, private identityService: IdentityService, private plexTv: PlexTvService, - private settingsService: SettingsService) { } + private settingsService: SettingsService, + private location: PlatformLocation) { } public ngOnInit(): void { + const base = this.location.getBaseHrefFromDOM(); + if (base.length > 1) { + this.baseUrl = base; + } this.settingsService.getClientId().subscribe(x => this.clientId = x); } diff --git a/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.html b/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.html index d60f1d1f0..8c923a596 100644 --- a/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.html +++ b/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.html @@ -1,5 +1,5 @@  - +
diff --git a/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.ts b/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.ts index d6ec14a8f..6b09915a4 100644 --- a/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.ts +++ b/src/Ombi/ClientApp/app/wizard/plex/plexoauth.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute, Router } from "@angular/router"; +import { PlatformLocation } from "@angular/common"; import { AuthService } from "../../auth/auth.service"; import { IdentityService, PlexOAuthService } from "../../services"; @@ -9,12 +10,14 @@ import { IdentityService, PlexOAuthService } from "../../services"; }) export class PlexOAuthComponent implements OnInit { public pinId: number; + public baseUrl: string; constructor(private route: ActivatedRoute, private plexOauth: PlexOAuthService, private identityService: IdentityService, private router: Router, - private auth: AuthService) { + private auth: AuthService, + private location: PlatformLocation) { this.route.params .subscribe((params: any) => { @@ -23,6 +26,10 @@ export class PlexOAuthComponent implements OnInit { } public ngOnInit(): void { + const base = this.location.getBaseHrefFromDOM(); + if (base.length > 1) { + this.baseUrl = base; + } this.plexOauth.oAuth(this.pinId).subscribe(x => { if (!x.accessToken) { return; diff --git a/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.html b/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.html index 8207583b6..c278593ac 100644 --- a/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.html +++ b/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.html @@ -1,5 +1,5 @@  - +
diff --git a/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.ts b/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.ts index c01c6886a..332a74525 100644 --- a/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.ts +++ b/src/Ombi/ClientApp/app/wizard/welcome/welcome.component.ts @@ -1,11 +1,22 @@ -import { Component } from "@angular/core"; +import { PlatformLocation } from "@angular/common"; +import { Component, OnInit } from "@angular/core"; import { Router } from "@angular/router"; @Component({ templateUrl: "./welcome.component.html", }) -export class WelcomeComponent { - constructor(private router: Router) { } +export class WelcomeComponent implements OnInit { + + public baseUrl: string; + + constructor(private router: Router, private location: PlatformLocation) { } + + public ngOnInit(): void { + const base = this.location.getBaseHrefFromDOM(); + if (base.length > 1) { + this.baseUrl = base; + } + } public next() { this.router.navigate(["Wizard/MediaServer"]);