|
|
|
@ -1,224 +1,175 @@
|
|
|
|
|
<h3 *ngIf="!edit">Create User</h3>
|
|
|
|
|
<h3 *ngIf="edit && user"> User: {{user.userName}}</h3>
|
|
|
|
|
|
|
|
|
|
<p-confirmDialog></p-confirmDialog>
|
|
|
|
|
|
|
|
|
|
<button type="button" class="btn btn-primary-outline" style="float:right;" [routerLink]="['/usermanagement/']">Back</button>
|
|
|
|
|
<div *ngIf="!edit || edit && user">
|
|
|
|
|
|
|
|
|
|
<div class="modal-body" style="margin-top: 45px;">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<h4>User Details</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<h4>User Settings</h4>
|
|
|
|
|
|
|
|
|
|
<div class="small-middle-container" *ngIf="!edit || edit && user">
|
|
|
|
|
|
|
|
|
|
<mat-horizontal-stepper #stepper>
|
|
|
|
|
<mat-step>
|
|
|
|
|
<ng-template matStepLabel>User Details</ng-template>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Username" [(ngModel)]="user.userName" required>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Alias" [(ngModel)]="user.alias" matTooltip="This is used as a display value instead of the users username, so think of it as a more friendly username">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Email Address" type="email" [(ngModel)]="user.emailAddress" required>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Password" type="password" [(ngModel)]="user.password" required>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Confirm Password" type="password" [(ngModel)]="confirmPass" required>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<button mat-button matStepperNext>Next</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<mat-step>
|
|
|
|
|
<ng-template matStepLabel>Choose the Roles</ng-template>
|
|
|
|
|
<div *ngIf="!edit">
|
|
|
|
|
<div *ngFor="let c of availableClaims">
|
|
|
|
|
<mat-checkbox [(ngModel)]="c.enabled">{{c.value | humanize}}</mat-checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="username" class="control-label">Username</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [(ngModel)]="user.userName" class="form-control form-control-custom " id="username"
|
|
|
|
|
name="username" value="{{user?.userName}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="alias" class="control-label">Alias</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [(ngModel)]="user.alias" class="form-control form-control-custom " id="alias"
|
|
|
|
|
name="alias" value="{{user?.alias}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="emailAddress" class="control-label">Email Address</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [(ngModel)]="user.emailAddress" class="form-control form-control-custom " id="emailAddress"
|
|
|
|
|
name="emailAddress" value="{{user?.emailAddress}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="password" class="control-label">Password</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="password" [(ngModel)]="user.password" class="form-control form-control-custom " id="password"
|
|
|
|
|
name="password">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group" *ngIf="!edit">
|
|
|
|
|
<label for="confirmPass" class="control-label">Confirm Password</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="password" [(ngModel)]="confirmPass" class="form-control form-control-custom " id="confirmPass"
|
|
|
|
|
name="confirmPass">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
<ngb-accordion [closeOthers]="true" activeIds="0-header">
|
|
|
|
|
<ngb-panel title="Roles">
|
|
|
|
|
<ng-template ngbPanelContent>
|
|
|
|
|
<div class="panel panel-default a">
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
|
|
<div *ngIf="!edit">
|
|
|
|
|
<div *ngFor="let c of availableClaims">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<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">
|
|
|
|
|
<label id="label{{c.value}}" for="create{{c.value}}">{{c.value | humanize}}</label>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div *ngIf="edit">
|
|
|
|
|
<div *ngFor="let c of user.claims">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<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">
|
|
|
|
|
<label id="label{{c.value}}" for="create{{c.value}}">{{c.value | humanize}}</label>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</ng-template>
|
|
|
|
|
</ngb-panel>
|
|
|
|
|
<ngb-panel title="Request Limits">
|
|
|
|
|
<ng-template ngbPanelContent>
|
|
|
|
|
<div class="panel panel-default a">
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="movieRequestLimit" class="control-label">Movie Request Limit</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [(ngModel)]="user.movieRequestLimit" class="form-control form-small form-control-custom "
|
|
|
|
|
id="movieRequestLimit" name="movieRequestLimit" value="{{user?.movieRequestLimit}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="episodeRequestLimit" class="control-label">Episode Request Limit</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [(ngModel)]="user.episodeRequestLimit" class="form-control form-small form-control-custom "
|
|
|
|
|
id="episodeRequestLimit" name="episodeRequestLimit" value="{{user?.episodeRequestLimit}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="musicRequestLimit" class="control-label">Music Request Limit</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [(ngModel)]="user.musicRequestLimit" class="form-control form-small form-control-custom "
|
|
|
|
|
id="musicRequestLimit" name="musicRequestLimit" value="{{user?.musicRequestLimit}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</ng-template>
|
|
|
|
|
</ngb-panel>
|
|
|
|
|
<ngb-panel title="Notification Preferences" *ngIf="notificationPreferences">
|
|
|
|
|
<ng-template ngbPanelContent>
|
|
|
|
|
<div class="panel panel-default a">
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
<div *ngFor="let pref of notificationPreferences">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="{{pref.agent}}" class="control-label">{{NotificationAgent[pref.agent]
|
|
|
|
|
| humanize}}</label>
|
|
|
|
|
<div>
|
|
|
|
|
<input type="text" [attr.data-test]="NotificationAgent[pref.agent]" [(ngModel)]="pref.value" class="form-control form-control-custom"
|
|
|
|
|
name="{{pref.agent}}" value="{{pref?.value}}">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</ng-template>
|
|
|
|
|
</ngb-panel>
|
|
|
|
|
<ngb-panel title="Quality & Root Path Preferences" *ngIf="user.userQualityProfiles">
|
|
|
|
|
<ng-template ngbPanelContent>
|
|
|
|
|
<div class="panel panel-default a">
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
|
|
|
|
<div class="form-group" *ngIf="sonarrQualities">
|
|
|
|
|
<label for="sonarrQualities" class="control-label">Sonarr Quality Profile</label>
|
|
|
|
|
<div id="sonarrQualities">
|
|
|
|
|
<select class="form-control form-control-custom" [(ngModel)]="user.userQualityProfiles.sonarrQualityProfile">
|
|
|
|
|
<option *ngFor="let folder of sonarrQualities" value="{{folder.id}}">{{folder.name}}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group" *ngIf="sonarrQualities">
|
|
|
|
|
<label for="sonarrQualityProfileAnime" class="control-label">Sonarr Quality Profile (Anime)</label>
|
|
|
|
|
<div id="sonarrQualityProfileAnime">
|
|
|
|
|
<select class="form-control form-control-custom" [(ngModel)]="user.userQualityProfiles.sonarrQualityProfileAnime">
|
|
|
|
|
<option *ngFor="let folder of sonarrQualities" value="{{folder.id}}">{{folder.name}}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group" *ngIf="sonarrRootFolders">
|
|
|
|
|
<label for="sonarrRootPath" class="control-label">Sonarr Root Folder</label>
|
|
|
|
|
<div id="sonarrRootPath">
|
|
|
|
|
<select class="form-control form-control-custom" [(ngModel)]="user.userQualityProfiles.sonarrRootPath">
|
|
|
|
|
<option *ngFor="let folder of sonarrRootFolders" value="{{folder.id}}">{{folder.path}}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group" *ngIf="sonarrRootFolders">
|
|
|
|
|
<label for="sonarrRootPathAnime" class="control-label">Sonarr Root Folder (Anime)</label>
|
|
|
|
|
<div id="sonarrRootPathAnime">
|
|
|
|
|
<select class="form-control form-control-custom" [(ngModel)]="user.userQualityProfiles.sonarrRootPathAnime">
|
|
|
|
|
<option *ngFor="let folder of sonarrRootFolders" value="{{folder.id}}">{{folder.path}}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group" *ngIf="radarrQualities">
|
|
|
|
|
<label for="radarrQualityProfile" class="control-label">Radarr Quality Profiles</label>
|
|
|
|
|
<div id="radarrQualityProfile">
|
|
|
|
|
<select class="form-control form-control-custom" [(ngModel)]="user.userQualityProfiles.radarrQualityProfile">
|
|
|
|
|
<option *ngFor="let folder of radarrQualities" value="{{folder.id}}">{{folder.name}}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group" *ngIf="radarrRootFolders">
|
|
|
|
|
<label for="radarrRootPath" class="control-label">Radarr Root Folder</label>
|
|
|
|
|
<div id="radarrRootPath">
|
|
|
|
|
<select class="form-control form-control-custom" [(ngModel)]="user.userQualityProfiles.radarrRootPath">
|
|
|
|
|
<option *ngFor="let folder of radarrRootFolders" value="{{folder.id}}">{{folder.path}}</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</ng-template>
|
|
|
|
|
</ngb-panel>
|
|
|
|
|
</ngb-accordion>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div *ngIf="edit">
|
|
|
|
|
<div *ngFor="let c of user.claims">
|
|
|
|
|
<mat-checkbox [(ngModel)]="c.enabled">{{c.value | humanize}}</mat-checkbox>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<button *ngIf="!edit" type="button" data-test="createuserbtn" class="btn btn-danger-outline" (click)="create()">Create</button>
|
|
|
|
|
<div *ngIf="edit">
|
|
|
|
|
<button type="button" data-test="updatebtn" class="btn btn-primary-outline" (click)="update()">Update</button>
|
|
|
|
|
<button type="button" data-test="deletebtn" class="btn btn-danger-outline" (click)="delete()">Delete</button>
|
|
|
|
|
<button type="button" style="float:right;" class="btn btn-info-outline" (click)="resetPassword()"
|
|
|
|
|
pTooltip="You need your SMTP settings setup">Send Reset Password Link</button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<button mat-button matStepperPrevious>Back</button>
|
|
|
|
|
<button mat-button matStepperNext>Next</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
<mat-step>
|
|
|
|
|
<ng-template matStepLabel>Set Request Limits</ng-template>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Movie Request Limit" [(ngModel)]="user.movieRequestLimit">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Episode Request Limit" [(ngModel)]="user.episodeRequestLimit">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="Music Request Limit" [(ngModel)]="user.musicRequestLimit">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<button mat-button matStepperPrevious>Back</button>
|
|
|
|
|
<button mat-button matStepperNext>Next</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
<mat-step>
|
|
|
|
|
<ng-template matStepLabel>Notification Preferences</ng-template>
|
|
|
|
|
<div *ngFor="let pref of notificationPreferences">
|
|
|
|
|
<div>
|
|
|
|
|
<mat-form-field>
|
|
|
|
|
<input matInput placeholder="{{NotificationAgent[pref.agent] | humanize}}" [(ngModel)]="pref.value">
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<button mat-button matStepperPrevious>Back</button>
|
|
|
|
|
<button mat-button matStepperNext>Next</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
|
|
|
|
|
<mat-step *ngIf="user.userQualityProfiles && (sonarrQualities || sonarrRootFolders || radarrQualities || radarrRootFolders)">
|
|
|
|
|
<ng-template matStepLabel>Quality & Root Path Preferences</ng-template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<mat-form-field *ngIf="sonarrQualities">
|
|
|
|
|
<mat-label>Sonarr Quality Profile</mat-label>
|
|
|
|
|
<mat-select [(ngModel)]="user.userQualityProfiles.sonarrQualityProfile">
|
|
|
|
|
<mat-option *ngFor="let folder of sonarrQualities" [value]="folder.id">
|
|
|
|
|
{{folder.name}}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
<mat-form-field *ngIf="sonarrQualities">
|
|
|
|
|
<mat-label>Sonarr Quality Profile (Anime)</mat-label>
|
|
|
|
|
<mat-select [(ngModel)]="user.userQualityProfiles.sonarrQualityProfileAnime">
|
|
|
|
|
<mat-option *ngFor="let folder of sonarrQualities" [value]="folder.id">
|
|
|
|
|
{{folder.name}}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
<mat-form-field *ngIf="sonarrRootFolders">
|
|
|
|
|
<mat-label>Sonarr Root Folder</mat-label>
|
|
|
|
|
<mat-select [(ngModel)]="user.userQualityProfiles.sonarrRootPath">
|
|
|
|
|
<mat-option *ngFor="let folder of sonarrRootFolders" [value]="folder.id">
|
|
|
|
|
{{folder.path}}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
<mat-form-field *ngIf="sonarrRootFolders">
|
|
|
|
|
<mat-label>Sonarr Root Folder (Anime)</mat-label>
|
|
|
|
|
<mat-select [(ngModel)]="user.userQualityProfiles.sonarrRootPathAnime">
|
|
|
|
|
<mat-option *ngFor="let folder of sonarrRootFolders" [value]="folder.id">
|
|
|
|
|
{{folder.path}}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
<mat-form-field *ngIf="radarrQualities">
|
|
|
|
|
<mat-label>Radarr Quality Profiles</mat-label>
|
|
|
|
|
<mat-select [(ngModel)]="user.userQualityProfiles.radarrQualityProfile">
|
|
|
|
|
<mat-option *ngFor="let folder of radarrQualities" [value]="folder.id">
|
|
|
|
|
{{folder.name}}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
<mat-form-field *ngIf="radarrRootFolders">
|
|
|
|
|
<mat-label>Radarr Root Folder</mat-label>
|
|
|
|
|
<mat-select [(ngModel)]="user.userQualityProfiles.radarrRootPath">
|
|
|
|
|
<mat-option *ngFor="let folder of radarrRootFolders" [value]="folder.id">
|
|
|
|
|
{{folder.path}}
|
|
|
|
|
</mat-option>
|
|
|
|
|
</mat-select>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<button mat-button matStepperPrevious>Back</button>
|
|
|
|
|
<button mat-button matStepperNext>Next</button>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
<mat-step>
|
|
|
|
|
<ng-template matStepLabel>Actions</ng-template>
|
|
|
|
|
|
|
|
|
|
<button *ngIf="!edit" type="button" mat-raised-button color="accent" data-test="createuserbtn" (click)="create()">Create</button>
|
|
|
|
|
<div *ngIf="edit">
|
|
|
|
|
<button type="button" data-test="updatebtn" mat-raised-button color="warn" 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" style="float:right;" mat-raised-button color="primary" class="btn btn-info-outline" (click)="resetPassword()" pTooltip="You need your SMTP settings setup">Send
|
|
|
|
|
Reset Password Link</button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</mat-step>
|
|
|
|
|
</mat-horizontal-stepper>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|