mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 01:02:57 -07:00
This commit is contained in:
parent
bd27e4ad70
commit
018cd7a072
5 changed files with 81 additions and 58 deletions
|
@ -6,6 +6,10 @@
|
|||
emailAddress: string,
|
||||
password: string,
|
||||
userType: UserType,
|
||||
|
||||
|
||||
// FOR UI
|
||||
checked: boolean,
|
||||
}
|
||||
|
||||
export enum UserType {
|
||||
|
|
|
@ -27,7 +27,8 @@ export class UserManagementAddComponent implements OnInit {
|
|||
id: "",
|
||||
password: "",
|
||||
username: "",
|
||||
userType: UserType.LocalUser
|
||||
userType: UserType.LocalUser,
|
||||
checked:false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,58 +21,68 @@
|
|||
<!-- Table -->
|
||||
<table class="table table-striped table-hover table-responsive table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<a>
|
||||
Username
|
||||
<!--<span ng-show="sortType == 'username' && !sortReverse" class="fa fa-caret-down"></span>
|
||||
<span ng-show="sortType == 'username' && sortReverse" class="fa fa-caret-up"></span>-->
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
Alias
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
Email
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
Roles
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
User Type
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a>
|
||||
<input type="checkbox" ng-checked="checkAll" (change)="checkAllBoxes()">
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
Username
|
||||
<!--<span ng-show="sortType == 'username' && !sortReverse" class="fa fa-caret-down"></span>
|
||||
<span ng-show="sortType == 'username' && sortReverse" class="fa fa-caret-up"></span>-->
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
Alias
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
Email
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
Roles
|
||||
</th>
|
||||
<th>
|
||||
<a>
|
||||
User Type
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let u of users">
|
||||
<td>
|
||||
{{u.username}}
|
||||
</td>
|
||||
<td>
|
||||
{{u.alias}}
|
||||
</td>
|
||||
<td>
|
||||
{{u.emailAddress}}
|
||||
</td>
|
||||
<td>
|
||||
<div *ngFor="let claim of u.claims"><span *ngIf="claim.enabled">{{claim.value}}</span></div>
|
||||
<tr *ngFor="let u of users">
|
||||
<td>
|
||||
<input type="checkbox" [(ngModel)]="u.checked">
|
||||
</td>
|
||||
<td>
|
||||
{{u.username}}
|
||||
</td>
|
||||
<td>
|
||||
{{u.alias}}
|
||||
</td>
|
||||
<td>
|
||||
{{u.emailAddress}}
|
||||
</td>
|
||||
<td>
|
||||
<div *ngFor="let claim of u.claims">
|
||||
<span *ngIf="claim.enabled">{{claim.value}}</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td ng-hide="hideColumns">
|
||||
<span *ngIf="u.userType === 1">Local User</span>
|
||||
<span *ngIf="u.userType === 2">Plex User</span>
|
||||
<span *ngIf="u.userType === 3">Emby User</span>
|
||||
</td>
|
||||
<td>
|
||||
<a [routerLink]="['/usermanagement/edit/' + u.id]" class="btn btn-sm btn-info-outline">Details/Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
<td ng-hide="hideColumns">
|
||||
<span *ngIf="u.userType === 1">Local User</span>
|
||||
<span *ngIf="u.userType === 2">Plex User</span>
|
||||
<span *ngIf="u.userType === 3">Emby User</span>
|
||||
</td>
|
||||
<td>
|
||||
<a [routerLink]="['/usermanagement/edit/' + u.id]" class="btn btn-sm btn-info-outline">Details/Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -98,14 +108,14 @@
|
|||
<input type="text" [(ngModel)]="selectedUser.alias" class="form-control form-control-custom " id="alias" name="alias" value="{{selectedUser?.alias}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="alias" class="control-label">Email Address</label>
|
||||
<div>
|
||||
<input type="text" [(ngModel)]="selectedUser.emailAddress" class="form-control form-control-custom " id="emailAddress" name="emailAddress" value="{{selectedUser?.emailAddress}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngFor="let c of selectedUser.claims">
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
|
@ -115,8 +125,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
|
|
@ -4,7 +4,7 @@ import { IUser } from '../interfaces/IUser';
|
|||
import { IdentityService } from '../services/identity.service';
|
||||
|
||||
@Component({
|
||||
|
||||
|
||||
templateUrl: './usermanagement.component.html'
|
||||
})
|
||||
export class UserManagementComponent implements OnInit {
|
||||
|
@ -19,6 +19,12 @@ export class UserManagementComponent implements OnInit {
|
|||
}
|
||||
|
||||
users: IUser[];
|
||||
|
||||
|
||||
checkAll = false;
|
||||
|
||||
checkAllBoxes() {
|
||||
this.checkAll = !this.checkAll;
|
||||
this.users.forEach(user => {
|
||||
user.checked = this.checkAll;
|
||||
});
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MultiSelectModule } from 'primeng/primeng';
|
||||
|
||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
|
||||
|
||||
|
@ -28,6 +29,7 @@ const routes: Routes = [
|
|||
ReactiveFormsModule,
|
||||
RouterModule.forChild(routes),
|
||||
NgbModule.forRoot(),
|
||||
MultiSelectModule
|
||||
],
|
||||
declarations: [
|
||||
UserManagementComponent,
|
||||
|
@ -41,6 +43,6 @@ const routes: Routes = [
|
|||
providers: [
|
||||
IdentityService
|
||||
],
|
||||
|
||||
|
||||
})
|
||||
export class UserManagementModule { }
|
Loading…
Add table
Add a link
Reference in a new issue