mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
lots of changes, got the login page working !wip
This commit is contained in:
parent
f7cc7d9e35
commit
f44eba5e0c
12 changed files with 97 additions and 55 deletions
|
@ -165,7 +165,7 @@
|
||||||
</nav> -->
|
</nav> -->
|
||||||
|
|
||||||
|
|
||||||
<app-my-nav [showNav]="showNav"></app-my-nav>
|
<app-my-nav [showNav]="showNav" [loggedIn]="user != undefined" [username]="user.name" (logoutClick)="logOut();"></app-my-nav>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -19,7 +19,7 @@ import { ButtonModule, CaptchaModule, ConfirmationService, ConfirmDialogModule,
|
||||||
TooltipModule } from "primeng/primeng";
|
TooltipModule } from "primeng/primeng";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MatButtonModule, MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule, MatAutocompleteModule} from '@angular/material';
|
MatButtonModule, MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule, MatAutocompleteModule, MatCheckboxModule} from '@angular/material';
|
||||||
import { MatCardModule, MatInputModule, MatTabsModule } from "@angular/material";
|
import { MatCardModule, MatInputModule, MatTabsModule } from "@angular/material";
|
||||||
|
|
||||||
import { MDBBootstrapModule, CardsFreeModule, NavbarModule } from "angular-bootstrap-md";
|
import { MDBBootstrapModule, CardsFreeModule, NavbarModule } from "angular-bootstrap-md";
|
||||||
|
@ -118,6 +118,7 @@ export function JwtTokenGetter() {
|
||||||
OverlayPanelModule,
|
OverlayPanelModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
CardsFreeModule,
|
CardsFreeModule,
|
||||||
|
MatCheckboxModule,
|
||||||
MDBBootstrapModule.forRoot(),
|
MDBBootstrapModule.forRoot(),
|
||||||
JwtModule.forRoot({
|
JwtModule.forRoot({
|
||||||
config: {
|
config: {
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
<mat-card>
|
<mat-card>
|
||||||
|
|
||||||
<a *ngIf="result.url" href="{{result.url}}" target="_blank">
|
<a [routerLink]="result.type === RequestType.movie ? '/details/movie/' + result.id : '/details/tv/' + result.id">
|
||||||
<img mat-card-image src="{{result.posterPath}}" class="card-poster" alt="{{result.title}}">
|
<img mat-card-image src="{{result.posterPath}}" class="card-poster" alt="{{result.title}}">
|
||||||
</a>
|
</a>
|
||||||
<img *ngIf="!result.url" mat-card-image src="{{result.posterPath}}" class="card-poster" alt="{{result.title}}">
|
|
||||||
|
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
|
|
||||||
<h5 *ngIf="result.title.length <= 10">{{result.title}}</h5>
|
<h5 *ngIf="result.title.length <= 10">{{result.title}}</h5>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { SearchService } from "../../services";
|
||||||
export class DiscoverCardComponent implements OnInit {
|
export class DiscoverCardComponent implements OnInit {
|
||||||
|
|
||||||
@Input() public result: IDiscoverCardResult;
|
@Input() public result: IDiscoverCardResult;
|
||||||
|
public RequestType = RequestType;
|
||||||
|
|
||||||
constructor(private searchService: SearchService) { }
|
constructor(private searchService: SearchService) { }
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@ import { SearchService } from "../services";
|
||||||
import { SharedModule } from "../shared/shared.module";
|
import { SharedModule } from "../shared/shared.module";
|
||||||
import { DiscoverComponent } from "./discover.component";
|
import { DiscoverComponent } from "./discover.component";
|
||||||
import { DiscoverCardComponent } from "./card/discover-card.component";
|
import { DiscoverCardComponent } from "./card/discover-card.component";
|
||||||
|
import { AuthGuard } from "../auth/auth.guard";
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: "", component: DiscoverComponent },
|
{ path: "", component: DiscoverComponent, canActivate: [AuthGuard] },
|
||||||
{ path: "discover", component: DiscoverComponent },
|
|
||||||
];
|
];
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|
|
@ -1,14 +1,9 @@
|
||||||
<!--
|
<div *ngIf="form && customizationSettings && authenticationSettings">
|
||||||
you can substitue the span of reauth email for a input with the email and
|
|
||||||
include the remember me checkbox
|
|
||||||
-->
|
|
||||||
<div *ngIf="form && customizationSettings && authenticationSettings">
|
|
||||||
|
|
||||||
<div *ngIf="background" @fadeInOut class="bg" [style.background-image]="background"></div>
|
<!-- <div *ngIf="background" @fadeInOut class="bg" [style.background-image]="background"></div> --> <!--TODO TURN BACK ON-->
|
||||||
<div class="container" id="login">
|
<div class="container" id="login">
|
||||||
<div class="card card-container">
|
<div class="card card-container">
|
||||||
|
|
||||||
<!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> -->
|
|
||||||
<div *ngIf="!customizationSettings.logo">
|
<div *ngIf="!customizationSettings.logo">
|
||||||
<img id="profile-img" class="profile-img-card" src="{{baseUrl}}/images/logo.png" />
|
<img id="profile-img" class="profile-img-card" src="{{baseUrl}}/images/logo.png" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,36 +16,42 @@ include the remember me checkbox
|
||||||
<form *ngIf="authenticationSettings" class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
|
<form *ngIf="authenticationSettings" class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
|
||||||
|
|
||||||
|
|
||||||
<input type="email" id="inputEmail" class="form-control" formControlName="username" [attr.placeholder]="'Login.UsernamePlaceholder' | translate"
|
<mat-form-field class="full-width">
|
||||||
autofocus>
|
<input type="text" matInput placeholder="{{'Login.UsernamePlaceholder' | translate}}"
|
||||||
<input *ngIf="!authenticationSettings.allowNoPassword" type="password" id="inputPassword" class="form-control" formControlName="password"
|
formControlName="username" />
|
||||||
[attr.placeholder]="'Login.PasswordPlaceholder' | translate">
|
<mat-error *ngIf="form.get('username').hasError('required')">
|
||||||
<div class="form-group">
|
{{'Login.UsernamePlaceholder' | translate}} is <strong>required</strong></mat-error>
|
||||||
<div class="checkbox">
|
</mat-form-field>
|
||||||
<input type="checkbox" id="RememberMe" formControlName="rememberMe">
|
|
||||||
|
|
||||||
<label for="RememberMe" [translate]="'Login.RememberMe'"></label>
|
<mat-form-field class="full-width">
|
||||||
|
<input type="password" matInput placeholder="{{'Login.PasswordPlaceholder' | translate}}"
|
||||||
|
formControlName="password" />
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-checkbox class="white-checkbox" formControlName="rememberMe">{{'Login.RememberMe' | translate}}</mat-checkbox>
|
||||||
|
|
||||||
|
<!-- <button class="btn btn-success" type="submit" data-test='signinbtn' [translate]="'Login.SignInButton'"></button> -->
|
||||||
|
|
||||||
|
<button mat-raised-button color="accent" type="submit">{{'Login.SignInButton' | translate}}</button>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button class="btn btn-success" type="submit" data-test='signinbtn' [translate]="'Login.SignInButton'"></button>
|
|
||||||
<a [routerLink]="['/reset']" class="forgot-password col-md-12">
|
<a [routerLink]="['/reset']" class="forgot-password col-md-12">
|
||||||
<b [translate]="'Login.ForgottenPassword'"></b>
|
<b [translate]="'Login.ForgottenPassword'"></b>
|
||||||
</a>
|
</a>
|
||||||
</form>
|
</form>
|
||||||
<!-- /form -->
|
<!-- /form -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main OAuth Flow -->
|
<!-- Main OAuth Flow -->
|
||||||
<div *ngIf="authenticationSettings.enableOAuth && !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>
|
||||||
|
</div>
|
||||||
|
<div class="form-signin">
|
||||||
|
<button class="btn btn-primary" type="button" (click)="oauth()">
|
||||||
|
Sign In With Plex</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-signin">
|
|
||||||
<button class="btn btn-primary" type="button" (click)="oauth()">
|
|
||||||
Sign In With Plex</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /card-container -->
|
<!-- /card-container -->
|
||||||
|
|
|
@ -35,7 +35,7 @@ div.bg {
|
||||||
.card-container.card {
|
.card-container.card {
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
padding: 45px 45px;
|
padding: 45px 45px;
|
||||||
background-color: rgba(0,0,0, 0.0);
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
border-radius: 5%;
|
border-radius: 5%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
@ -44,8 +44,15 @@ div.bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::ng-deep input.mat-input-element {
|
||||||
|
color: white; // choose the color you want
|
||||||
|
}
|
||||||
|
::ng-deep label.mat-input-placeholder {
|
||||||
|
color: #fff; // choose the color you want
|
||||||
|
}
|
||||||
|
.white-checkbox {
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
@ -200,3 +207,8 @@ div.bg {
|
||||||
::-ms-input-placeholder { /* Microsoft Edge */
|
::-ms-input-placeholder { /* Microsoft Edge */
|
||||||
color: $placeholder-colour;
|
color: $placeholder-colour;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.full-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
|
@ -74,7 +74,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (authService.loggedIn()) {
|
if (authService.loggedIn()) {
|
||||||
this.router.navigate(["search"]);
|
this.router.navigate(["/"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ export class LoginComponent implements OnDestroy, OnInit {
|
||||||
|
|
||||||
if (this.authService.loggedIn()) {
|
if (this.authService.loggedIn()) {
|
||||||
this.ngOnDestroy();
|
this.ngOnDestroy();
|
||||||
this.router.navigate(["search"]);
|
this.router.navigate(["/"]);
|
||||||
} else {
|
} else {
|
||||||
this.notify.error(this.errorBody);
|
this.notify.error(this.errorBody);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,23 @@
|
||||||
<mat-sidenav-container class="sidenav-container">
|
<mat-sidenav-container *ngIf="isLoggedIn()" class="sidenav-container">
|
||||||
<mat-sidenav #drawer class="sidenav" fixedInViewport="true" [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
|
<mat-sidenav #drawer class="sidenav" fixedInViewport="true" [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
|
||||||
[mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)">
|
[mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)">
|
||||||
<mat-toolbar>Ombi</mat-toolbar>
|
<mat-toolbar>Ombi</mat-toolbar>
|
||||||
<mat-nav-list>
|
<mat-nav-list>
|
||||||
<a mat-list-item [routerLinkActive]="['active']" routerLink="/discover">Discover</a>
|
<a mat-list-item routerLink="/discover">
|
||||||
<a mat-list-item [routerLinkActive]="['active']" routerLink="/search">Search</a>
|
<mat-icon aria-label="Side nav toggle icon">find_replace</mat-icon>
|
||||||
<a mat-list-item [routerLinkActive]="['active']" routerLink="/requests">Requests</a>
|
Discover</a>
|
||||||
<a mat-list-item [routerLinkActive]="['active']" routerLink="/settings">Settings</a>
|
<a mat-list-item routerLink="/search">
|
||||||
|
<mat-icon aria-label="Side nav toggle icon">search</mat-icon> Search</a>
|
||||||
|
<a mat-list-item routerLink="/requests">
|
||||||
|
<mat-icon aria-label="Side nav toggle icon">list</mat-icon> Requests</a>
|
||||||
|
<a mat-list-item routerLink="/Settings/About">
|
||||||
|
<mat-icon aria-label="Side nav toggle icon">settings</mat-icon> Settings</a>
|
||||||
|
|
||||||
|
<a mat-list-item aria-label="Toggle sidenav" (click)="logOut();" *ngIf="loggedIn">
|
||||||
|
<mat-icon aria-label="Side nav toggle icon">exit_to_app</mat-icon>
|
||||||
|
{{ 'NavigationBar.Logout' | translate }}
|
||||||
|
</a>
|
||||||
|
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
</mat-sidenav>
|
</mat-sidenav>
|
||||||
<mat-sidenav-content>
|
<mat-sidenav-content>
|
||||||
|
@ -25,10 +36,13 @@
|
||||||
</mat-toolbar>
|
</mat-toolbar>
|
||||||
|
|
||||||
<!-- Page -->
|
<!-- Page -->
|
||||||
<div [ngClass]="{'container top-spacing': showNav}">
|
<div class="container top-spacing">
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</mat-sidenav-content>
|
</mat-sidenav-content>
|
||||||
</mat-sidenav-container>
|
</mat-sidenav-container>
|
||||||
|
|
||||||
|
<div *ngIf="!isLoggedIn();">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
|
@ -1,7 +1,7 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||||
import { Observable, Subject } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map, debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -16,8 +16,19 @@ export class MyNavComponent {
|
||||||
map(result => result.matches)
|
map(result => result.matches)
|
||||||
);
|
);
|
||||||
|
|
||||||
@Input() public showNav: boolean;
|
@Input() public showNav: boolean;
|
||||||
|
@Input() public loggedIn: boolean;
|
||||||
|
@Input() public username: string;
|
||||||
|
@Output() public logoutClick = new EventEmitter();
|
||||||
|
|
||||||
constructor(private breakpointObserver: BreakpointObserver) {
|
constructor(private breakpointObserver: BreakpointObserver) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public logOut() {
|
||||||
|
this.logoutClick.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public isLoggedIn(): boolean {
|
||||||
|
return this.loggedIn;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { InputSwitchModule, SidebarModule } from "primeng/primeng";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MatButtonModule, MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule, MatTooltipModule} from '@angular/material';
|
MatButtonModule, MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule, MatTooltipModule} from '@angular/material';
|
||||||
import { MatCardModule, MatInputModule, MatTabsModule, MatAutocompleteModule } from "@angular/material";
|
import { MatCardModule, MatInputModule, MatTabsModule, MatAutocompleteModule, MatCheckboxModule } from "@angular/material";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
|
@ -34,6 +34,7 @@ import {
|
||||||
MatSidenavModule,
|
MatSidenavModule,
|
||||||
MatListModule,
|
MatListModule,
|
||||||
MatToolbarModule,
|
MatToolbarModule,
|
||||||
|
MatCheckboxModule,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
|
@ -54,6 +55,7 @@ import {
|
||||||
MatToolbarModule,
|
MatToolbarModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatAutocompleteModule,
|
MatAutocompleteModule,
|
||||||
|
MatCheckboxModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class SharedModule {}
|
export class SharedModule {}
|
||||||
|
|
|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.HttpOverrides;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.SpaServices.AngularCli;
|
||||||
using Microsoft.AspNetCore.SpaServices.Webpack;
|
using Microsoft.AspNetCore.SpaServices.Webpack;
|
||||||
using Microsoft.AspNetCore.StaticFiles;
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
|
@ -252,6 +253,7 @@ namespace Ombi
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment())
|
||||||
{
|
{
|
||||||
spa.UseProxyToSpaDevelopmentServer("http://localhost:3578");
|
spa.UseProxyToSpaDevelopmentServer("http://localhost:3578");
|
||||||
|
//spa.UseAngularCliServer("start");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue