mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
fix(wizard): 🐛 Stop access to the wizard when you have already setup ombi (#4866)
This commit is contained in:
parent
c08805494c
commit
353de981a4
4 changed files with 20 additions and 5 deletions
3
src/Ombi/.vscode/settings.json
vendored
3
src/Ombi/.vscode/settings.json
vendored
|
@ -24,7 +24,8 @@
|
||||||
"details",
|
"details",
|
||||||
"requests",
|
"requests",
|
||||||
"sonarr",
|
"sonarr",
|
||||||
"plex"
|
"plex",
|
||||||
|
"wizard"
|
||||||
],
|
],
|
||||||
"rpc.enabled": true
|
"rpc.enabled": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,8 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
|
|
||||||
if (authService.loggedIn()) {
|
if (authService.loggedIn()) {
|
||||||
this.loadStores();
|
this.loadStores();
|
||||||
|
|
||||||
|
this.router.navigate(["/"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,11 @@ export class StatusService extends ServiceHelpers {
|
||||||
constructor(http: HttpClient, @Inject(APP_BASE_HREF) href:string) {
|
constructor(http: HttpClient, @Inject(APP_BASE_HREF) href:string) {
|
||||||
super(http, "/api/v1/status/", href);
|
super(http, "/api/v1/status/", href);
|
||||||
}
|
}
|
||||||
public getWizardStatus(): Observable<any> {
|
public getWizardStatus(): Observable<WizardResult> {
|
||||||
return this.http.get(`${this.url}Wizard/`, {headers: this.headers});
|
return this.http.get<WizardResult>(`${this.url}Wizard/`, {headers: this.headers});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface WizardResult {
|
||||||
|
result: boolean;
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, OnInit, ViewChild } from "@angular/core";
|
import { Component, OnInit, ViewChild } from "@angular/core";
|
||||||
import { IdentityService, NotificationService, SettingsService } from "../../services";
|
import { IdentityService, NotificationService, SettingsService, StatusService } from "../../services";
|
||||||
|
|
||||||
import { CustomizationFacade } from "../../state/customization/customization.facade";
|
import { CustomizationFacade } from "../../state/customization/customization.facade";
|
||||||
import { ICreateWizardUser } from "../../interfaces";
|
import { ICreateWizardUser } from "../../interfaces";
|
||||||
|
@ -7,6 +7,7 @@ import { IOmbiConfigModel } from "../models/OmbiConfigModel";
|
||||||
import { MatStepper } from'@angular/material/stepper';
|
import { MatStepper } from'@angular/material/stepper';
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { WizardService } from "../services/wizard.service";
|
import { WizardService } from "../services/wizard.service";
|
||||||
|
import { Observable, take } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./welcome.component.html",
|
templateUrl: "./welcome.component.html",
|
||||||
|
@ -20,9 +21,16 @@ export class WelcomeComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private router: Router, private identityService: IdentityService,
|
constructor(private router: Router, private identityService: IdentityService,
|
||||||
private notificationService: NotificationService, private WizardService: WizardService,
|
private notificationService: NotificationService, private WizardService: WizardService,
|
||||||
private settingsService: SettingsService, private customizationFacade: CustomizationFacade) { }
|
private settingsService: SettingsService, private customizationFacade: CustomizationFacade,
|
||||||
|
private status: StatusService) { }
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
|
this.status.getWizardStatus().pipe(take(1))
|
||||||
|
.subscribe(x => {
|
||||||
|
if (x.result) {
|
||||||
|
this.router.navigate(["login"]);
|
||||||
|
}
|
||||||
|
});
|
||||||
this.localUser = {
|
this.localUser = {
|
||||||
password:"",
|
password:"",
|
||||||
username:"",
|
username:"",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue