diff --git a/src/Ombi/ClientApp/src/app/login/login.component.html b/src/Ombi/ClientApp/src/app/login/login.component.html index 5742bcc9d..d4f8499d8 100644 --- a/src/Ombi/ClientApp/src/app/login/login.component.html +++ b/src/Ombi/ClientApp/src/app/login/login.component.html @@ -20,7 +20,7 @@ - {{'Login.RememberMe' | translate}} + {{'Login.RememberMe' | translate}} diff --git a/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.html b/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.html index 7e6710171..ea3ec21c4 100644 --- a/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.html +++ b/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.html @@ -1,27 +1,12 @@  - -
-
-
-

Create the Admin account

This account will be used to configure your settings and also manage all of the requests. -
-
- - -
-
-
- - -
+
+ + + +
+ + +
-
-
- -
-
-
-
-
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts b/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts index 86d4bc9b7..cabe30426 100644 --- a/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts @@ -1,21 +1,25 @@ -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit, Input } from "@angular/core"; import { Router } from "@angular/router"; import { PlatformLocation } from "@angular/common"; import { IdentityService } from "../../services"; import { NotificationService } from "../../services"; +import { ICreateWizardUser } from "../../interfaces"; @Component({ + selector: "wizard-local-admin", templateUrl: "./createadmin.component.html", }) export class CreateAdminComponent implements OnInit { + @Input() user: ICreateWizardUser; + public username: string; public password: string; public baseUrl: string; + - constructor(private identityService: IdentityService, private notificationService: NotificationService, - private router: Router, private location: PlatformLocation) { } + constructor(private location: PlatformLocation) { } public ngOnInit(): void { const base = this.location.getBaseHrefFromDOM(); @@ -24,15 +28,4 @@ export class CreateAdminComponent implements OnInit { } } - public createUser() { - 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) { - this.notificationService.error(x.errors[0]); - } - } - }); - } } diff --git a/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.html b/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.html index c43aa7c6f..52d7e3045 100644 --- a/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.html +++ b/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.html @@ -1,43 +1,31 @@  - -
-
-
-

Emby Authentication

-
-
- + + +
-
-
- +
-
- -
+ + +
-
-
- -
+
+ Enable SSL
-
- -
- -
+
+ + + +
-
-
-
-
\ No newline at end of file +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts b/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts index f22fa915b..570782e8c 100644 --- a/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts @@ -8,6 +8,7 @@ import { PlatformLocation } from "@angular/common"; import { IEmbySettings } from "../../interfaces"; @Component({ + selector: "wizard-emby", templateUrl: "./emby.component.html", }) export class EmbyComponent implements OnInit { @@ -52,7 +53,8 @@ export class EmbyComponent implements OnInit { this.notificationService.error("Username or password was incorrect. Could not authenticate with Emby."); return; } - this.router.navigate(["Wizard/CreateAdmin"]); + + this.notificationService.success("Done! Please press next"); }); } } diff --git a/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.html b/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.html index 611c78dbf..4a120f790 100644 --- a/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.html +++ b/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.html @@ -1,34 +1,24 @@ - - -
-
-
-

Plex Authentication

-
- +
- -
-
-
- -
+ + +
-Please note we do not store this information, we only store your Plex Authorization Token that will allow Ombi to view your media and friends +
+ + + +
+
+Please note we do not store this information, we only store your Plex Authorization Token that will allow Ombi to view your media and users
- +

OR

- +
- -
-
-
- - \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts b/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts index 076b93363..1ea7615f3 100644 --- a/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts @@ -8,6 +8,7 @@ import { IdentityService, NotificationService } from "../../services"; import { StorageService } from "../../shared/storage/storage-service"; @Component({ + selector: "wizard-plex", templateUrl: "./plex.component.html", }) export class PlexComponent implements OnInit, OnDestroy { diff --git a/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.html b/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.html index 054250ec7..416af7b09 100644 --- a/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.html +++ b/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.html @@ -1,18 +1,56 @@ 
- -
- -
-
-

Welcome to Ombi

-
- we are just going to run though the initial Ombi setup! - -
- Next -
+ + + +
+ Welcome +

Welcome to Ombi, this wizard will quickly take you through the inital setup!

+
+
-
-
-
+ + + + +
+ Plex + +
+ + +
+
+
+ + +
+ Emby + +
+ + +
+
+
+ + +
+ Create a local admin + +
+ + +
+
+
+ + + Done + All setup! Press Finish to continue and login to Ombi! +
+ + +
+
+
diff --git a/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts b/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts index 332a74525..805264f96 100644 --- a/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts @@ -1,6 +1,8 @@ import { PlatformLocation } from "@angular/common"; import { Component, OnInit } from "@angular/core"; import { Router } from "@angular/router"; +import { ICreateWizardUser } from "../../interfaces"; +import { IdentityService, NotificationService } from "../../services"; @Component({ templateUrl: "./welcome.component.html", @@ -8,17 +10,32 @@ import { Router } from "@angular/router"; export class WelcomeComponent implements OnInit { public baseUrl: string; - - constructor(private router: Router, private location: PlatformLocation) { } + public localUser: ICreateWizardUser; + + constructor(private router: Router, private location: PlatformLocation, + private identityService: IdentityService, private notificationService: NotificationService) { } - public ngOnInit(): void { + public ngOnInit(): void { + this.localUser = { + password:"", + username:"", + usePlexAdminAccount:false + } const base = this.location.getBaseHrefFromDOM(); if (base.length > 1) { this.baseUrl = base; } } - public next() { - this.router.navigate(["Wizard/MediaServer"]); + public createUser() { + this.identityService.createWizardUser(this.localUser).subscribe(x => { + if (x.result) { + this.router.navigate(["login"]); + } else { + if (x.errors.length > 0) { + this.notificationService.error(x.errors[0]); + } + } + }); } } diff --git a/src/Ombi/ClientApp/src/app/wizard/wizard.module.ts b/src/Ombi/ClientApp/src/app/wizard/wizard.module.ts index d9c056ba0..7efdbe504 100644 --- a/src/Ombi/ClientApp/src/app/wizard/wizard.module.ts +++ b/src/Ombi/ClientApp/src/app/wizard/wizard.module.ts @@ -1,6 +1,6 @@ import { CommonModule } from "@angular/common"; import { NgModule } from "@angular/core"; -import { FormsModule } from "@angular/forms"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; import { RouterModule, Routes } from "@angular/router"; import {ConfirmationService, ConfirmDialogModule } from "primeng/primeng"; @@ -17,6 +17,8 @@ import { PlexService } from "../services"; import { IdentityService } from "../services"; import { PlexOAuthService } from "../services"; +import { SharedModule } from "../shared/shared.module"; + const routes: Routes = [ { path: "", component: WelcomeComponent}, { path: "MediaServer", component: MediaServerComponent}, @@ -28,7 +30,10 @@ const routes: Routes = [ imports: [ CommonModule, FormsModule, + ReactiveFormsModule, ConfirmDialogModule, + SharedModule, + MatStepperModule, RouterModule.forChild(routes), ], declarations: [ @@ -46,7 +51,6 @@ const routes: Routes = [ IdentityService, EmbyService, ConfirmationService, - MatStepperModule, PlexOAuthService, ], diff --git a/src/Ombi/Controllers/V1/IdentityController.cs b/src/Ombi/Controllers/V1/IdentityController.cs index 3525faa21..6eb28e008 100644 --- a/src/Ombi/Controllers/V1/IdentityController.cs +++ b/src/Ombi/Controllers/V1/IdentityController.cs @@ -204,6 +204,11 @@ namespace Ombi.Controllers.V1 { _log.LogInformation("Added the Admin role"); } + + // Update the wizard flag + var settings = await OmbiSettings.GetSettingsAsync(); + settings.Wizard = true; + await OmbiSettings.SaveSettingsAsync(settings); } if (!result.Succeeded) { @@ -211,11 +216,6 @@ namespace Ombi.Controllers.V1 retVal.Errors.AddRange(result.Errors.Select(x => x.Description)); } - // Update the wizard flag - var settings = await OmbiSettings.GetSettingsAsync(); - settings.Wizard = true; - await OmbiSettings.SaveSettingsAsync(settings); - retVal.Result = result.Succeeded; return retVal; }