moved the Plex OAuth setting to the Authentication Settings !wip

pull/2194/head
Jamie 7 years ago
parent d80c50a40a
commit 73340d4fb6

@ -12,5 +12,6 @@ namespace Ombi.Settings.Settings.Models
public bool RequireLowercase { get; set; } public bool RequireLowercase { get; set; }
public bool RequireNonAlphanumeric { get; set; } public bool RequireNonAlphanumeric { get; set; }
public bool RequireUppercase { get; set; } public bool RequireUppercase { get; set; }
public bool EnableOAuth { get; set; } // Plex OAuth
} }
} }

@ -6,7 +6,6 @@ namespace Ombi.Core.Settings.Models.External
public sealed class PlexSettings : Ombi.Settings.Settings.Models.Settings public sealed class PlexSettings : Ombi.Settings.Settings.Models.Settings
{ {
public bool Enable { get; set; } public bool Enable { get; set; }
public bool EnableOAuth { get; set; }
public List<PlexServers> Servers { get; set; } public List<PlexServers> Servers { get; set; }
} }

@ -43,7 +43,6 @@ export interface IEmbyServer extends IExternalSettings {
export interface IPlexSettings extends ISettings { export interface IPlexSettings extends ISettings {
enable: boolean; enable: boolean;
enableOAuth: boolean;
servers: IPlexServer[]; servers: IPlexServer[];
} }
@ -146,6 +145,7 @@ export interface IAuthenticationSettings extends ISettings {
requiredLowercase: boolean; requiredLowercase: boolean;
requireNonAlphanumeric: boolean; requireNonAlphanumeric: boolean;
requireUppercase: boolean; requireUppercase: boolean;
enableOAuth: boolean;
} }
export interface IUserManagementSettings extends ISettings { export interface IUserManagementSettings extends ISettings {

@ -17,7 +17,7 @@ include the remember me checkbox
</div> </div>
<p id="profile-name" class="profile-name-card"></p> <p id="profile-name" class="profile-name-card"></p>
<div *ngIf="!plexEnabled || loginWithOmbi"> <div *ngIf="!authenticationSettings.enableOAuth || loginWithOmbi">
<form *ngIf="authenticationSettings" class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)"> <form *ngIf="authenticationSettings" class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
@ -41,7 +41,7 @@ include the remember me checkbox
<!-- /form --> <!-- /form -->
</div> </div>
<!-- Main OAuth Flow --> <!-- Main OAuth Flow -->
<div *ngIf="plexEnabled && !loginWithOmbi"> <div *ngIf="authenticationSettings.enableOAuth && !loginWithOmbi">
<div class="form-signin"> <div class="form-signin">
<button class="btn btn-success" type="button" (click)="loginWithOmbi = true"> <button class="btn btn-success" type="button" (click)="loginWithOmbi = true">
Sign In With {{appName}}</button> Sign In With {{appName}}</button>

@ -79,7 +79,6 @@ export class LoginComponent implements OnDestroy, OnInit {
public ngOnInit() { public ngOnInit() {
this.settingsService.getAuthentication().subscribe(x => this.authenticationSettings = x); this.settingsService.getAuthentication().subscribe(x => this.authenticationSettings = x);
this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x); this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x);
this.settingsService.getStatusPlex().subscribe(x => this.plexEnabled = x);
this.images.getRandomBackground().subscribe(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 + ")"); 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 + ")");
}); });

@ -71,10 +71,6 @@ export class SettingsService extends ServiceHelpers {
return this.http.get<IPlexSettings>(`${this.url}/Plex/`, {headers: this.headers}); return this.http.get<IPlexSettings>(`${this.url}/Plex/`, {headers: this.headers});
} }
public getStatusPlex(): Observable<boolean> {
return this.http.get<boolean>(`${this.url}/Plexstatus/`, {headers: this.headers});
}
public savePlex(settings: IPlexSettings): Observable<boolean> { public savePlex(settings: IPlexSettings): Observable<boolean> {
return this.http.post<boolean>(`${this.url}/Plex/`, JSON.stringify(settings), {headers: this.headers}); return this.http.post<boolean>(`${this.url}/Plex/`, JSON.stringify(settings), {headers: this.headers});
} }

@ -14,6 +14,13 @@
</div> </div>
</div> </div>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" id="enableOAuth" name="enableOAuth" formControlName="enableOAuth">
<label for="enableOAuth" >Enable Plex OAuth</label>
</div>
</div>
<!-- <hr/> <!-- <hr/>
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="checkbox">

@ -24,6 +24,7 @@ export class AuthenticationComponent implements OnInit {
requiredLowercase: [x.requiredLowercase], requiredLowercase: [x.requiredLowercase],
requireNonAlphanumeric: [x.requireNonAlphanumeric], requireNonAlphanumeric: [x.requireNonAlphanumeric],
requireUppercase: [x.requireUppercase], requireUppercase: [x.requireUppercase],
enableOAuth: [x.enableOAuth],
}); });
}); });
} }

@ -17,12 +17,6 @@
<label for="enable">Enable</label> <label for="enable">Enable</label>
</div> </div>
</div> </div>
<div class="form-group col-md-3">
<div class="checkbox">
<input type="checkbox" id="enableOAuth" [(ngModel)]="settings.enableOAuth" [checked]="settings.enableOAuth">
<label for="enableOAuth">Enable OAuth</label>
</div>
</div>
<div class="col-md-2 col-md-push-7"> <div class="col-md-2 col-md-push-7">
<button type="button" (click)="addTab()" class="btn btn-success-outline">Add Server</button> <button type="button" (click)="addTab()" class="btn btn-success-outline">Add Server</button>
</div> </div>

@ -147,16 +147,6 @@ namespace Ombi.Controllers
return s; return s;
} }
[HttpGet("plexstatus")]
[AllowAnonymous]
public async Task<bool> PlexStatusSettings()
{
var s = await Get<PlexSettings>();
return s.Enable && s.EnableOAuth;
}
/// <summary> /// <summary>
/// Save the Plex settings. /// Save the Plex settings.
/// </summary> /// </summary>

Loading…
Cancel
Save