mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
New features
This commit is contained in:
commit
0f55c0450a
16 changed files with 117 additions and 57 deletions
|
@ -170,7 +170,17 @@
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<app-my-nav id="main-container dark" [showNav]="showNav" [isAdmin]="isAdmin" [applicationName]="applicationName" [applicationLogo]="customizationSettings?.logo" [username]="username" [email]="user?.email " (logoutClick)="logOut();">
|
<app-my-nav id="main-container dark"
|
||||||
|
[showNav]="showNav"
|
||||||
|
[isAdmin]="isAdmin"
|
||||||
|
[applicationName]="applicationName"
|
||||||
|
[applicationLogo]="customizationSettings?.logo"
|
||||||
|
[username]="username"
|
||||||
|
[email]="user?.email"
|
||||||
|
[accessToken]="accessToken"
|
||||||
|
[applicationUrl]="customizationSettings?.applicationUrl"
|
||||||
|
(logoutClick)="logOut();"
|
||||||
|
>
|
||||||
</app-my-nav>
|
</app-my-nav>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ export class AppComponent implements OnInit {
|
||||||
public applicationName: string = "Ombi"
|
public applicationName: string = "Ombi"
|
||||||
public isAdmin: boolean;
|
public isAdmin: boolean;
|
||||||
public username: string;
|
public username: string;
|
||||||
|
public accessToken: string;
|
||||||
|
|
||||||
private hubConnected: boolean;
|
private hubConnected: boolean;
|
||||||
|
|
||||||
|
@ -55,6 +56,7 @@ export class AppComponent implements OnInit {
|
||||||
if (this.authService.loggedIn()) {
|
if (this.authService.loggedIn()) {
|
||||||
this.user = this.authService.claims();
|
this.user = this.authService.claims();
|
||||||
this.username = this.user.name;
|
this.username = this.user.name;
|
||||||
|
this.identity.getAccessToken().subscribe(x => this.accessToken = x);
|
||||||
if (!this.hubConnected) {
|
if (!this.hubConnected) {
|
||||||
this.signalrNotification.initialize();
|
this.signalrNotification.initialize();
|
||||||
this.hubConnected = true;
|
this.hubConnected = true;
|
||||||
|
|
|
@ -69,10 +69,11 @@
|
||||||
<button *ngIf="!request.available" mat-raised-button color="warn" (click)="changeAvailability(request, true);">{{ 'Requests.MarkAvailable' | translate }}</button>
|
<button *ngIf="!request.available" mat-raised-button color="warn" (click)="changeAvailability(request, true);">{{ 'Requests.MarkAvailable' | translate }}</button>
|
||||||
<button *ngIf="request.available" mat-raised-button color="warn" (click)="changeAvailability(request, false);">{{ 'Requests.MarkUnavailable' | translate }}</button>
|
<button *ngIf="request.available" mat-raised-button color="warn" (click)="changeAvailability(request, false);">{{ 'Requests.MarkUnavailable' | translate }}</button>
|
||||||
<button *ngIf="!request.denied" mat-raised-button color="danger" (click)="deny(request);">{{ 'Requests.Deny' | translate }}</button>
|
<button *ngIf="!request.denied" mat-raised-button color="danger" (click)="deny(request);">{{ 'Requests.Deny' | translate }}</button>
|
||||||
<button mat-raised-button color="danger" (click)="delete(request);">{{ 'Requests.RequestPanel.Delete' | translate }}</button>
|
|
||||||
<button mat-raised-button color="accent" (click)="reProcessRequest(request);">{{ 'MediaDetails.ReProcessRequest' | translate }}</button>
|
<button mat-raised-button color="accent" (click)="reProcessRequest(request);">{{ 'MediaDetails.ReProcessRequest' | translate }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngIf="isAdmin || manageOwnRequests">
|
||||||
|
<button mat-raised-button color="danger" (click)="delete(request);">{{ 'Requests.RequestPanel.Delete' | translate }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { Component, Input } from "@angular/core";
|
import { Component, Input } from "@angular/core";
|
||||||
import { IChildRequests, RequestType } from "../../../../../interfaces";
|
import { IChildRequests, RequestType } from "../../../../../interfaces";
|
||||||
import { RequestService } from "../../../../../services/request.service";
|
|
||||||
import { MessageService } from "../../../../../services";
|
|
||||||
import { MatDialog } from "@angular/material/dialog";
|
|
||||||
import { DenyDialogComponent } from "../../../shared/deny-dialog/deny-dialog.component";
|
import { DenyDialogComponent } from "../../../shared/deny-dialog/deny-dialog.component";
|
||||||
|
import { MatDialog } from "@angular/material/dialog";
|
||||||
|
import { MessageService } from "../../../../../services";
|
||||||
|
import { RequestService } from "../../../../../services/request.service";
|
||||||
import { RequestServiceV2 } from "../../../../../services/requestV2.service";
|
import { RequestServiceV2 } from "../../../../../services/requestV2.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
@ -14,6 +15,7 @@ import { RequestServiceV2 } from "../../../../../services/requestV2.service";
|
||||||
export class TvRequestsPanelComponent {
|
export class TvRequestsPanelComponent {
|
||||||
@Input() public tvRequest: IChildRequests[];
|
@Input() public tvRequest: IChildRequests[];
|
||||||
@Input() public isAdmin: boolean;
|
@Input() public isAdmin: boolean;
|
||||||
|
@Input() public manageOwnRequests: boolean;
|
||||||
|
|
||||||
public displayedColumns: string[] = ['number', 'title', 'airDate', 'status'];
|
public displayedColumns: string[] = ['number', 'title', 'airDate', 'status'];
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
{{'Requests.Title' | translate}}
|
{{'Requests.Title' | translate}}
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
<tv-requests-panel [tvRequest]="tvRequest" [isAdmin]="isAdmin"></tv-requests-panel>
|
<tv-requests-panel [tvRequest]="tvRequest" [isAdmin]="isAdmin" [manageOwnRequests]="manageOwnRequests"></tv-requests-panel>
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
|
|
||||||
</mat-accordion>
|
</mat-accordion>
|
||||||
|
|
|
@ -27,6 +27,7 @@ export class TvDetailsComponent implements OnInit {
|
||||||
public showRequest: ITvRequests;
|
public showRequest: ITvRequests;
|
||||||
public fromSearch: boolean;
|
public fromSearch: boolean;
|
||||||
public isAdmin: boolean;
|
public isAdmin: boolean;
|
||||||
|
public manageOwnRequests: boolean;
|
||||||
public advancedOptions: IAdvancedData;
|
public advancedOptions: IAdvancedData;
|
||||||
public showAdvanced: boolean; // Set on the UI
|
public showAdvanced: boolean; // Set on the UI
|
||||||
public requestType = RequestType.tvShow;
|
public requestType = RequestType.tvShow;
|
||||||
|
@ -53,6 +54,7 @@ export class TvDetailsComponent implements OnInit {
|
||||||
|
|
||||||
this.issuesEnabled = this.settingsState.getIssue();
|
this.issuesEnabled = this.settingsState.getIssue();
|
||||||
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
||||||
|
this.manageOwnRequests = this.auth.hasRole('ManageOwnRequests');
|
||||||
|
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
this.showAdvanced = await this.sonarrService.isEnabled();
|
this.showAdvanced = await this.sonarrService.isEnabled();
|
||||||
|
|
|
@ -28,6 +28,13 @@
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<span mat-list-item >
|
||||||
|
<a mat-list-item [disableRipple]="true" id="nav-openMobile" [routerLinkActive]="'active-list-item'"
|
||||||
|
aria-label="Toggle sidenav" (click)="openMobileApp($event);">
|
||||||
|
<i class="fa-lg fas fa-mobile-alt icon-spacing"></i>
|
||||||
|
{{ 'NavigationBar.OpenMobileApp' | translate }}
|
||||||
|
</a></span>
|
||||||
|
|
||||||
<a mat-list-item [disableRipple]="true" class="menu-spacing" id="nav-logout" [routerLinkActive]="'active-list-item'"
|
<a mat-list-item [disableRipple]="true" class="menu-spacing" id="nav-logout" [routerLinkActive]="'active-list-item'"
|
||||||
aria-label="Toggle sidenav" (click)="logOut();">
|
aria-label="Toggle sidenav" (click)="logOut();">
|
||||||
<i class="fa-lg fas fa-sign-out-alt icon-spacing"></i>
|
<i class="fa-lg fas fa-sign-out-alt icon-spacing"></i>
|
||||||
|
|
|
@ -107,10 +107,21 @@
|
||||||
margin-right:5px;
|
margin-right:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#nav-openMobile {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
.profile-username{
|
.profile-username{
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 950px) {
|
||||||
|
#nav-openMobile {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-img img {
|
.profile-img img {
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
|
|
||||||
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
||||||
import { Observable } from 'rxjs';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { INavBar } from '../interfaces/ICommon';
|
|
||||||
import { StorageService } from '../shared/storage/storage-service';
|
|
||||||
import { SettingsService, SettingsStateService } from '../services';
|
|
||||||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
|
||||||
import { SearchFilter } from './SearchFilter';
|
|
||||||
import { Md5 } from 'ts-md5/dist/md5';
|
|
||||||
import { IUser, RequestType, UserType } from '../interfaces';
|
import { IUser, RequestType, UserType } from '../interfaces';
|
||||||
|
import { SettingsService, SettingsStateService } from '../services';
|
||||||
|
|
||||||
import { FilterService } from '../discover/services/filter-service';
|
import { FilterService } from '../discover/services/filter-service';
|
||||||
import { ILocalUser } from '../auth/IUserLogin';
|
import { ILocalUser } from '../auth/IUserLogin';
|
||||||
|
import { INavBar } from '../interfaces/ICommon';
|
||||||
|
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||||
|
import { Md5 } from 'ts-md5/dist/md5';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { SearchFilter } from './SearchFilter';
|
||||||
|
import { StorageService } from '../shared/storage/storage-service';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
export enum SearchFilterType {
|
export enum SearchFilterType {
|
||||||
Movie = 1,
|
Movie = 1,
|
||||||
|
@ -34,6 +35,8 @@ export class MyNavComponent implements OnInit {
|
||||||
@Input() public showNav: boolean;
|
@Input() public showNav: boolean;
|
||||||
@Input() public applicationName: string;
|
@Input() public applicationName: string;
|
||||||
@Input() public applicationLogo: string;
|
@Input() public applicationLogo: string;
|
||||||
|
@Input() public applicationUrl: string;
|
||||||
|
@Input() public accessToken: string;
|
||||||
@Input() public username: string;
|
@Input() public username: string;
|
||||||
@Input() public isAdmin: string;
|
@Input() public isAdmin: string;
|
||||||
@Input() public email: string;
|
@Input() public email: string;
|
||||||
|
@ -122,4 +125,12 @@ export class MyNavComponent implements OnInit {
|
||||||
var fallback = this.applicationLogo ? this.applicationLogo : 'https://raw.githubusercontent.com/Ombi-app/Ombi/gh-pages/img/android-chrome-512x512.png';
|
var fallback = this.applicationLogo ? this.applicationLogo : 'https://raw.githubusercontent.com/Ombi-app/Ombi/gh-pages/img/android-chrome-512x512.png';
|
||||||
return `https://www.gravatar.com/avatar/${this.emailHash}?d=${fallback}`;
|
return `https://www.gravatar.com/avatar/${this.emailHash}?d=${fallback}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public openMobileApp(event: any) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
const url = `ombi://${this.applicationUrl}|${this.accessToken}`;
|
||||||
|
window.location.assign(url);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
<th mat-header-cell *matHeaderCellDef> </th>
|
<th mat-header-cell *matHeaderCellDef> </th>
|
||||||
<td mat-cell *matCellDef="let element">
|
<td mat-cell *matCellDef="let element">
|
||||||
<button id="detailsButton{{element.id}}" mat-raised-button color="accent" [routerLink]="'/details/movie/' + element.theMovieDbId">{{ 'Requests.Details' | translate}}</button>
|
<button id="detailsButton{{element.id}}" mat-raised-button color="accent" [routerLink]="'/details/movie/' + element.theMovieDbId">{{ 'Requests.Details' | translate}}</button>
|
||||||
<button id="optionsButton{{element.id}}" mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin"> {{ 'Requests.Options' | translate}}</button>
|
<button id="optionsButton{{element.id}}" mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin || manageOwnRequests"> {{ 'Requests.Options' | translate}}</button>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
import { Component, AfterViewInit, ViewChild, EventEmitter, Output, ChangeDetectorRef, OnInit } from "@angular/core";
|
import { AfterViewInit, ChangeDetectorRef, Component, EventEmitter, OnInit, Output, ViewChild } from "@angular/core";
|
||||||
import { IMovieRequests, IRequestEngineResult, IRequestsViewModel } from "../../../interfaces";
|
import { IMovieRequests, IRequestEngineResult, IRequestsViewModel } from "../../../interfaces";
|
||||||
import { MatPaginator } from "@angular/material/paginator";
|
import { NotificationService, RequestService } from "../../../services";
|
||||||
import { MatSort } from "@angular/material/sort";
|
import { Observable, forkJoin, merge, of as observableOf } from 'rxjs';
|
||||||
import { merge, Observable, of as observableOf, forkJoin } from 'rxjs';
|
|
||||||
import { catchError, map, startWith, switchMap } from 'rxjs/operators';
|
import { catchError, map, startWith, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
import { RequestServiceV2 } from "../../../services/requestV2.service";
|
|
||||||
import { AuthService } from "../../../auth/auth.service";
|
import { AuthService } from "../../../auth/auth.service";
|
||||||
import { StorageService } from "../../../shared/storage/storage-service";
|
import { MatPaginator } from "@angular/material/paginator";
|
||||||
import { RequestFilterType } from "../../models/RequestFilterType";
|
import { MatSort } from "@angular/material/sort";
|
||||||
import { SelectionModel } from "@angular/cdk/collections";
|
|
||||||
import { NotificationService, RequestService } from "../../../services";
|
|
||||||
import { TranslateService } from "@ngx-translate/core";
|
|
||||||
import { MatTableDataSource } from "@angular/material/table";
|
import { MatTableDataSource } from "@angular/material/table";
|
||||||
|
import { RequestFilterType } from "../../models/RequestFilterType";
|
||||||
|
import { RequestServiceV2 } from "../../../services/requestV2.service";
|
||||||
|
import { SelectionModel } from "@angular/cdk/collections";
|
||||||
|
import { StorageService } from "../../../shared/storage/storage-service";
|
||||||
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./movies-grid.component.html",
|
templateUrl: "./movies-grid.component.html",
|
||||||
|
@ -26,6 +26,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
public displayedColumns: string[] = ['title', 'requestedUser.requestedBy', 'status', 'requestStatus','requestedDate', 'actions'];
|
public displayedColumns: string[] = ['title', 'requestedUser.requestedBy', 'status', 'requestStatus','requestedDate', 'actions'];
|
||||||
public gridCount: string = "15";
|
public gridCount: string = "15";
|
||||||
public isAdmin: boolean;
|
public isAdmin: boolean;
|
||||||
|
public manageOwnRequests: boolean;
|
||||||
public defaultSort: string = "requestedDate";
|
public defaultSort: string = "requestedDate";
|
||||||
public defaultOrder: string = "desc";
|
public defaultOrder: string = "desc";
|
||||||
public currentFilter: RequestFilterType = RequestFilterType.All;
|
public currentFilter: RequestFilterType = RequestFilterType.All;
|
||||||
|
@ -39,7 +40,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
private storageKeyGridCount = "Movie_DefaultGridCount";
|
private storageKeyGridCount = "Movie_DefaultGridCount";
|
||||||
private storageKeyCurrentFilter = "Movie_DefaultFilter";
|
private storageKeyCurrentFilter = "Movie_DefaultFilter";
|
||||||
|
|
||||||
@Output() public onOpenOptions = new EventEmitter<{ request: any, filter: any, onChange: any }>();
|
@Output() public onOpenOptions = new EventEmitter<{ request: any, filter: any, onChange: any, manageOwnRequests: boolean, isAdmin: boolean }>();
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
|
@ -53,6 +54,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
|
||||||
|
this.manageOwnRequests = this.auth.hasRole("ManageOwnRequests")
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin) {
|
||||||
this.displayedColumns.unshift('select');
|
this.displayedColumns.unshift('select');
|
||||||
}
|
}
|
||||||
|
@ -135,7 +137,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
||||||
this.ref.detectChanges();
|
this.ref.detectChanges();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onOpenOptions.emit({ request: request, filter: filter, onChange: onChange });
|
this.onOpenOptions.emit({ request: request, filter: filter, onChange: onChange, manageOwnRequests: this.manageOwnRequests, isAdmin: this.isAdmin });
|
||||||
}
|
}
|
||||||
|
|
||||||
public switchFilter(type: RequestFilterType) {
|
public switchFilter(type: RequestFilterType) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<mat-nav-list>
|
<mat-nav-list>
|
||||||
<a id="requestDelete" (click)="delete()" mat-list-item>
|
<a id="requestDelete" *ngIf="data.isAdmin || data.manageOwnRequests" (click)="delete()" mat-list-item>
|
||||||
<span mat-line>{{'Requests.RequestPanel.Delete' | translate}}</span>
|
<span mat-line>{{'Requests.RequestPanel.Delete' | translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
<a id="requestApprove" *ngIf="data.canApprove" (click)="approve()" mat-list-item>
|
<a id="requestApprove" *ngIf="data.canApprove && data.isAdmin" (click)="approve()" mat-list-item>
|
||||||
<span mat-line>{{'Requests.RequestPanel.Approve' | translate}}</span>
|
<span mat-line>{{'Requests.RequestPanel.Approve' | translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
<a id="requestChangeAvailability" *ngIf="data.type !== RequestType.tvShow" (click)="changeAvailability()" mat-list-item>
|
<a id="requestChangeAvailability" *ngIf="data.type !== RequestType.tvShow && data.isAdmin" (click)="changeAvailability()" mat-list-item>
|
||||||
<span mat-line>{{'Requests.RequestPanel.ChangeAvailability' | translate}}</span>
|
<span mat-line>{{'Requests.RequestPanel.ChangeAvailability' | translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
|
@ -1,8 +1,9 @@
|
||||||
import { Component, ViewChild } from "@angular/core";
|
import { Component, ViewChild } from "@angular/core";
|
||||||
|
|
||||||
import { MatBottomSheet } from "@angular/material/bottom-sheet";
|
import { MatBottomSheet } from "@angular/material/bottom-sheet";
|
||||||
|
import { MoviesGridComponent } from "./movies-grid/movies-grid.component";
|
||||||
import { RequestOptionsComponent } from "./options/request-options.component";
|
import { RequestOptionsComponent } from "./options/request-options.component";
|
||||||
import { UpdateType } from "../models/UpdateType";
|
import { UpdateType } from "../models/UpdateType";
|
||||||
import { MoviesGridComponent } from "./movies-grid/movies-grid.component";
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./requests-list.component.html",
|
templateUrl: "./requests-list.component.html",
|
||||||
|
@ -12,7 +13,7 @@ export class RequestsListComponent {
|
||||||
|
|
||||||
constructor(private bottomSheet: MatBottomSheet) { }
|
constructor(private bottomSheet: MatBottomSheet) { }
|
||||||
|
|
||||||
public onOpenOptions(event: { request: any, filter: any, onChange: any }) {
|
public onOpenOptions(event: { request: any, filter: any, onChange: any, manageOwnRequests: boolean, isAdmin: boolean }) {
|
||||||
const ref = this.bottomSheet.open(RequestOptionsComponent, { data: { id: event.request.id, type: event.request.requestType, canApprove: event.request.canApprove } });
|
const ref = this.bottomSheet.open(RequestOptionsComponent, { data: { id: event.request.id, type: event.request.requestType, canApprove: event.request.canApprove } });
|
||||||
|
|
||||||
ref.afterDismissed().subscribe((result) => {
|
ref.afterDismissed().subscribe((result) => {
|
||||||
|
|
|
@ -145,13 +145,14 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-3 col-sm-12">
|
<div class="col-md-6 col-sm-12">
|
||||||
<button *ngIf="!edit" type="button" mat-raised-button color="accent" data-test="createuserbtn" (click)="create()">Create</button>
|
<button *ngIf="!edit" type="button" mat-raised-button color="accent" data-test="createuserbtn" (click)="create()">Create</button>
|
||||||
<div *ngIf="edit">
|
<div *ngIf="edit">
|
||||||
<button type="button" data-test="updatebtn" mat-raised-button color="accent" class="btn btn-primary-outline" (click)="update()">Update</button>
|
<button type="button" data-test="updatebtn" mat-raised-button color="accent" class="btn btn-primary-outline" (click)="update()">Update</button>
|
||||||
<button type="button" data-test="deletebtn" mat-raised-button color="warn" class="btn btn-danger-outline" (click)="delete()">Delete</button>
|
<button type="button" data-test="deletebtn" mat-raised-button color="warn" class="btn btn-danger-outline" (click)="delete()">Delete</button>
|
||||||
<button type="button" style="float:right;" mat-raised-button color="primary" class="btn btn-info-outline" (click)="resetPassword()" pTooltip="You need your SMTP settings setup">Send
|
<button type="button" style="float:right;" mat-raised-button color="primary" class="btn btn-info-outline" (click)="resetPassword()" matTooltip="You need your SMTP settings setup">Send
|
||||||
Reset Password Link</button>
|
Reset Password Link</button>
|
||||||
|
<button *ngIf="customization.applicationUrl" type="button" mat-raised-button color="accent" class="btn btn-info-outline" (click)="appLink()" matTooltip="Send this link to the user and they can then open the app and directly login">Copy users App Link</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import { Location } from "@angular/common";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
import { AfterViewInit, Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute, Router } from "@angular/router";
|
import { ICheckbox, ICustomizationSettings, INotificationAgent, INotificationPreferences, IRadarrProfile, IRadarrRootFolder, ISonarrProfile, ISonarrRootFolder, IUser, UserType } from "../interfaces";
|
||||||
|
import { IdentityService, MessageService, RadarrService, SettingsService, SonarrService } from "../services";
|
||||||
|
|
||||||
import { ICheckbox, INotificationAgent, INotificationPreferences, IRadarrProfile, IRadarrRootFolder, ISonarrProfile, ISonarrRootFolder, IUser, UserType } from "../interfaces";
|
import { Clipboard } from '@angular/cdk/clipboard';
|
||||||
import { IdentityService, RadarrService, SonarrService, MessageService } from "../services";
|
import { Location } from "@angular/common";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./usermanagement-user.component.html",
|
templateUrl: "./usermanagement-user.component.html",
|
||||||
|
@ -27,12 +28,17 @@ export class UserManagementUserComponent implements OnInit {
|
||||||
|
|
||||||
public countries: string[];
|
public countries: string[];
|
||||||
|
|
||||||
|
private customization: ICustomizationSettings;
|
||||||
|
private accessToken: string;
|
||||||
|
|
||||||
constructor(private identityService: IdentityService,
|
constructor(private identityService: IdentityService,
|
||||||
private notificationService: MessageService,
|
private notificationService: MessageService,
|
||||||
|
private readonly settingsService: SettingsService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private sonarrService: SonarrService,
|
private sonarrService: SonarrService,
|
||||||
private radarrService: RadarrService,
|
private radarrService: RadarrService,
|
||||||
|
private clipboard: Clipboard,
|
||||||
private location: Location) {
|
private location: Location) {
|
||||||
|
|
||||||
this.route.params.subscribe((params: any) => {
|
this.route.params.subscribe((params: any) => {
|
||||||
|
@ -60,6 +66,9 @@ export class UserManagementUserComponent implements OnInit {
|
||||||
this.radarrService.getQualityProfilesFromSettings().subscribe(x => this.radarrQualities = x);
|
this.radarrService.getQualityProfilesFromSettings().subscribe(x => this.radarrQualities = x);
|
||||||
this.radarrService.getRootFoldersFromSettings().subscribe(x => this.radarrRootFolders = x);
|
this.radarrService.getRootFoldersFromSettings().subscribe(x => this.radarrRootFolders = x);
|
||||||
|
|
||||||
|
this.settingsService.getCustomization().subscribe(x => this.customization = x);
|
||||||
|
this.identityService.getAccessToken().subscribe(x => this.accessToken = x);
|
||||||
|
|
||||||
if(!this.edit) {
|
if(!this.edit) {
|
||||||
this.user = {
|
this.user = {
|
||||||
alias: "",
|
alias: "",
|
||||||
|
@ -178,7 +187,12 @@ export class UserManagementUserComponent implements OnInit {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async appLink() {
|
||||||
|
this.clipboard.copy(`ombi://${this.customization.applicationUrl}|${this.accessToken}`);
|
||||||
|
this.notificationService.send("Copied!");
|
||||||
|
}
|
||||||
|
|
||||||
public back() {
|
public back() {
|
||||||
this.location.back();
|
this.location.back();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,19 @@
|
||||||
import { CommonModule } from "@angular/common";
|
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
||||||
import { NgModule } from "@angular/core";
|
|
||||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
|
||||||
import { RouterModule, Routes } from "@angular/router";
|
|
||||||
import { ConfirmDialogModule } from "primeng/confirmdialog";
|
|
||||||
import { MultiSelectModule } from "primeng/multiselect";
|
|
||||||
import { SidebarModule } from "primeng/sidebar";
|
|
||||||
import { TooltipModule } from "primeng/tooltip";
|
|
||||||
|
|
||||||
import { UserManagementUserComponent } from "./usermanagement-user.component";
|
|
||||||
import { UserManagementComponent } from "./usermanagement.component";
|
|
||||||
|
|
||||||
import { PipeModule } from "../pipes/pipe.module";
|
|
||||||
import { IdentityService, PlexService, RadarrService, SonarrService } from "../services";
|
import { IdentityService, PlexService, RadarrService, SonarrService } from "../services";
|
||||||
|
import { RouterModule, Routes } from "@angular/router";
|
||||||
|
|
||||||
import { AuthGuard } from "../auth/auth.guard";
|
import { AuthGuard } from "../auth/auth.guard";
|
||||||
|
import { CommonModule } from "@angular/common";
|
||||||
|
import { ConfirmDialogModule } from "primeng/confirmdialog";
|
||||||
|
import { MultiSelectModule } from "primeng/multiselect";
|
||||||
|
import { NgModule } from "@angular/core";
|
||||||
import { OrderModule } from "ngx-order-pipe";
|
import { OrderModule } from "ngx-order-pipe";
|
||||||
|
import { PipeModule } from "../pipes/pipe.module";
|
||||||
import { SharedModule } from "../shared/shared.module";
|
import { SharedModule } from "../shared/shared.module";
|
||||||
|
import { SidebarModule } from "primeng/sidebar";
|
||||||
|
import { TooltipModule } from "primeng/tooltip";
|
||||||
|
import { UserManagementComponent } from "./usermanagement.component";
|
||||||
|
import { UserManagementUserComponent } from "./usermanagement-user.component";
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: "", component: UserManagementComponent, canActivate: [AuthGuard] },
|
{ path: "", component: UserManagementComponent, canActivate: [AuthGuard] },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue