mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
Sorted out the user management bulk edit
This commit is contained in:
parent
86220bb237
commit
19933f8186
9 changed files with 66 additions and 48 deletions
|
@ -28,6 +28,7 @@
|
||||||
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
|
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
|
||||||
"src/styles/_imports.scss",
|
"src/styles/_imports.scss",
|
||||||
"node_modules/bootstrap/scss/bootstrap.scss",
|
"node_modules/bootstrap/scss/bootstrap.scss",
|
||||||
|
"node_modules/primeng/resources/themes/md-dark-deeppurple/theme.css",
|
||||||
"node_modules/font-awesome/scss/font-awesome.scss",
|
"node_modules/font-awesome/scss/font-awesome.scss",
|
||||||
"node_modules/primeng/resources/primeng.min.css",
|
"node_modules/primeng/resources/primeng.min.css",
|
||||||
"node_modules/primeicons/primeicons.css",
|
"node_modules/primeicons/primeicons.css",
|
||||||
|
|
|
@ -50,8 +50,8 @@
|
||||||
"ngx-order-pipe": "^2.0.1",
|
"ngx-order-pipe": "^2.0.1",
|
||||||
"please-wait": "^0.0.5",
|
"please-wait": "^0.0.5",
|
||||||
"popper.js": "^1.14.3",
|
"popper.js": "^1.14.3",
|
||||||
"primeicons": "^1.0.0",
|
"primeicons": "^4.0.0",
|
||||||
"primeng": "^9.0.6",
|
"primeng": "^10.0.3",
|
||||||
"rxjs": "^6.5.2",
|
"rxjs": "^6.5.2",
|
||||||
"spinkit": "^1.2.5",
|
"spinkit": "^1.2.5",
|
||||||
"store": "^2.0.12",
|
"store": "^2.0.12",
|
||||||
|
|
|
@ -170,7 +170,7 @@
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<app-my-nav id="main-container" [showNav]="showNav" [isAdmin]="isAdmin" [applicationName]="applicationName" [username]="username" [email]="user.email" (logoutClick)="logOut();" (themeChange)="onSetTheme($event)">
|
<app-my-nav id="main-container" [showNav]="showNav" [isAdmin]="isAdmin" [applicationName]="applicationName" [username]="username" [email]="user?.email" (logoutClick)="logOut();" (themeChange)="onSetTheme($event)">
|
||||||
</app-my-nav>
|
</app-my-nav>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ export class AppComponent implements OnInit {
|
||||||
|
|
||||||
if (this.authService.loggedIn()) {
|
if (this.authService.loggedIn()) {
|
||||||
this.identity.getUser().subscribe(u => {
|
this.identity.getUser().subscribe(u => {
|
||||||
this.username = u.userName;
|
|
||||||
if (u.language) {
|
if (u.language) {
|
||||||
this.translate.use(u.language);
|
this.translate.use(u.language);
|
||||||
}
|
}
|
||||||
|
@ -107,20 +106,18 @@ export class AppComponent implements OnInit {
|
||||||
this.currentUrl = event.url;
|
this.currentUrl = event.url;
|
||||||
if (event instanceof NavigationStart) {
|
if (event instanceof NavigationStart) {
|
||||||
this.user = this.authService.claims();
|
this.user = this.authService.claims();
|
||||||
|
this.username = this.user.name;
|
||||||
|
|
||||||
this.isAdmin = this.authService.hasRole("admin");
|
this.isAdmin = this.authService.hasRole("admin");
|
||||||
this.showNav = this.authService.loggedIn();
|
this.showNav = this.authService.loggedIn();
|
||||||
|
|
||||||
// tslint:disable-next-line:no-string-literal
|
if (this.authService.loggedIn()) {
|
||||||
// if (this.user !== null && this.user.name && !this.checkedForUpdate && this.isAdmin) {
|
|
||||||
// this.checkedForUpdate = true;
|
|
||||||
// this.jobService.getCachedUpdate().subscribe(x => {
|
|
||||||
// this.updateAvailable = x;
|
|
||||||
// },
|
|
||||||
// err => this.checkedForUpdate = true);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (this.authService.loggedIn() && !this.hubConnected) {
|
if (!this.isAdmin) {
|
||||||
|
// let's get the remaining requests etc
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.hubConnected) {
|
||||||
this.signalrNotification.initialize();
|
this.signalrNotification.initialize();
|
||||||
this.hubConnected = true;
|
this.hubConnected = true;
|
||||||
|
|
||||||
|
@ -131,6 +128,7 @@ export class AppComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,33 +121,35 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p-sidebar [(visible)]="showBulkEdit" position="right" styleClass="ui-sidebar-md side-back">
|
<p-sidebar [(visible)]="showBulkEdit" position="right" [modal]="false">
|
||||||
<h3>Bulk Edit</h3>
|
<h3>Bulk Edit</h3>
|
||||||
<hr/>
|
<hr/>
|
||||||
<div *ngFor="let c of availableClaims">
|
<div *ngFor="let c of availableClaims">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<input type="checkbox" [(ngModel)]="c.enabled" [value]="c.value" id="create{{c.value}}" [attr.name]="'create' + c.value" ng-checked="c.enabled">
|
<mat-slide-toggle id="create{{c.value}}" [(ngModel)]="c.enabled" [attr.name]="'create' + c.value">
|
||||||
<label for="create{{c.value}}">{{c.value | humanize}}</label>
|
{{c.value | humanize}}</mat-slide-toggle>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="movieRequestLimit" class="control-label">Movie Request Limit</label>
|
|
||||||
<div>
|
|
||||||
<input type="text" [(ngModel)]="bulkMovieLimit" class="form-control form-small form-control-custom " id="movieRequestLimit" name="movieRequestLimit" value="{{bulkMovieLimit}}">
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="episodeRequestLimit" class="control-label">Episode Request Limit</label>
|
|
||||||
<div>
|
|
||||||
<input type="text" [(ngModel)]="bulkEpisodeLimit" class="form-control form-small form-control-custom " id="episodeRequestLimit" name="episodeRequestLimit" value="{{bulkEpisodeLimit}}">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-success-outline" (click)="bulkUpdate()">Update Users</button>
|
<mat-form-field appearance="outline" class="full">
|
||||||
|
<mat-label>Movie Request Limit</mat-label>
|
||||||
|
<input matInput id="movieRequestLimit" name="movieRequestLimit" [(ngModel)]="bulkMovieLimit">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline" class="full">
|
||||||
|
<mat-label>Episode Request Limit</mat-label>
|
||||||
|
<input matInput id="episodeRequestLimit" name="episodeRequestLimit" [(ngModel)]="bulkEpisodeLimit">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline" class="full">
|
||||||
|
<mat-label>Music Request Limit</mat-label>
|
||||||
|
<input matInput id="musicRequestLimit" name="musicRequestLimit" [(ngModel)]="bulkMusicLimit">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
|
||||||
|
<button type="button" mat-raised-button (click)="bulkUpdate()">Update Users</button>
|
||||||
</p-sidebar>
|
</p-sidebar>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
}
|
}
|
||||||
|
@ -52,7 +56,8 @@
|
||||||
::ng-deep .dark & button {
|
::ng-deep .dark & button {
|
||||||
background: $accent-dark !important;
|
background: $accent-dark !important;
|
||||||
color: #303030 !important;
|
color: #303030 !important;
|
||||||
}/*
|
}
|
||||||
|
/*
|
||||||
&:hover{
|
&:hover{
|
||||||
box-shadow: 0 1em 1em -0.8em #fff;
|
box-shadow: 0 1em 1em -0.8em #fff;
|
||||||
transform: translateY(-0.50em);
|
transform: translateY(-0.50em);
|
||||||
|
|
|
@ -26,6 +26,7 @@ export class UserManagementComponent implements OnInit, AfterViewInit {
|
||||||
public availableClaims: ICheckbox[];
|
public availableClaims: ICheckbox[];
|
||||||
public bulkMovieLimit?: number;
|
public bulkMovieLimit?: number;
|
||||||
public bulkEpisodeLimit?: number;
|
public bulkEpisodeLimit?: number;
|
||||||
|
public bulkMusicLimit?: number;
|
||||||
public plexEnabled: boolean;
|
public plexEnabled: boolean;
|
||||||
|
|
||||||
constructor(private identityService: IdentityService,
|
constructor(private identityService: IdentityService,
|
||||||
|
@ -84,6 +85,9 @@ export class UserManagementComponent implements OnInit, AfterViewInit {
|
||||||
if (this.bulkMovieLimit) {
|
if (this.bulkMovieLimit) {
|
||||||
x.movieRequestLimit = this.bulkMovieLimit;
|
x.movieRequestLimit = this.bulkMovieLimit;
|
||||||
}
|
}
|
||||||
|
if (this.bulkMusicLimit) {
|
||||||
|
x.musicRequestLimit = this.bulkMusicLimit;
|
||||||
|
}
|
||||||
this.identityService.updateUser(x).subscribe(y => {
|
this.identityService.updateUser(x).subscribe(y => {
|
||||||
if (!y.successful) {
|
if (!y.successful) {
|
||||||
this.notificationService.error(`Could not update user ${x.userName}. Reason ${y.errors[0]}`);
|
this.notificationService.error(`Could not update user ${x.userName}. Reason ${y.errors[0]}`);
|
||||||
|
@ -95,6 +99,7 @@ export class UserManagementComponent implements OnInit, AfterViewInit {
|
||||||
this.showBulkEdit = false;
|
this.showBulkEdit = false;
|
||||||
this.bulkMovieLimit = undefined;
|
this.bulkMovieLimit = undefined;
|
||||||
this.bulkEpisodeLimit = undefined;
|
this.bulkEpisodeLimit = undefined;
|
||||||
|
this.bulkMusicLimit = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
public isAllSelected() {
|
public isAllSelected() {
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"target": "es5",
|
"target": "es2015",
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
"resolveJsonModule":true,
|
"resolveJsonModule":true,
|
||||||
"allowSyntheticDefaultImports":true,
|
"allowSyntheticDefaultImports":true,
|
||||||
|
|
|
@ -6981,15 +6981,17 @@ prepend-http@^1.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
|
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
|
||||||
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
|
integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=
|
||||||
|
|
||||||
primeicons@^1.0.0:
|
primeicons@^4.0.0:
|
||||||
version "1.0.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/primeicons/-/primeicons-1.0.0.tgz#90061f168ef6227f21f0a7db8204ffa85cd27aec"
|
resolved "https://registry.yarnpkg.com/primeicons/-/primeicons-4.0.0.tgz#a3594b3af213dcf8c4c3d6fc99eea05b7c92f57c"
|
||||||
integrity sha512-p/hzIjUVccW4eJPhuORHI3AUkDpqfvCQVrjxbFEejnTEdWY4C8fomVfjiaA9jCu83fSQnBHuRIGB96iAR8R6uA==
|
integrity sha512-JQBIswGSItn8I0Pq21RchENpKJxSi1MjfBDfggMQpXtoKNKblJoHmol/7tCV3CAV2Dlb94ht8TD8qdIAW01pGg==
|
||||||
|
|
||||||
primeng@^9.0.6:
|
primeng@^10.0.3:
|
||||||
version "9.0.6"
|
version "10.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/primeng/-/primeng-9.0.6.tgz#b0d8350428722aaab2f5d4a65d3d06b5d4f673e0"
|
resolved "https://registry.yarnpkg.com/primeng/-/primeng-10.0.3.tgz#e9d0ea425b9c5023bc9eef2cb014941939d0c35e"
|
||||||
integrity sha512-RGVTkXwHTb7609zTU/uJFYdbJV124kOwrMiwnHjFn6UkwmS3yTX0Kkr21v8KOTJqsKLq3OWVYhkOwvUklipAAg==
|
integrity sha512-Nsiwpmy3RlFPBlxabdzeAYxFn4fXEyZjj7iAi1X5J4RRGD7NoB67+NbnOInE1rXTnNVHYxCca91OvaNiHSWWrg==
|
||||||
|
dependencies:
|
||||||
|
tslib "^2.0.0"
|
||||||
|
|
||||||
private@^0.1.8:
|
private@^0.1.8:
|
||||||
version "0.1.8"
|
version "0.1.8"
|
||||||
|
@ -8745,6 +8747,11 @@ tslib@^1.8.0, tslib@^1.8.1:
|
||||||
version "1.9.3"
|
version "1.9.3"
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
|
||||||
|
|
||||||
|
tslib@^2.0.0:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c"
|
||||||
|
integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==
|
||||||
|
|
||||||
tslint-angular@^1.1.2:
|
tslint-angular@^1.1.2:
|
||||||
version "1.1.2"
|
version "1.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/tslint-angular/-/tslint-angular-1.1.2.tgz#5ce7020968e3b9dc7a40b6d15dadd6da34787309"
|
resolved "https://registry.yarnpkg.com/tslint-angular/-/tslint-angular-1.1.2.tgz#5ce7020968e3b9dc7a40b6d15dadd6da34787309"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue