2019-08-12 19:34:23 +03:00
|
|
|
<!--
|
|
|
|
|
|
2020-02-20 10:26:43 +02:00
|
|
|
Copyright © 2016-2020 The Thingsboard Authors
|
2019-08-12 19:34:23 +03:00
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<div>
|
|
|
|
|
<mat-card class="settings-card">
|
|
|
|
|
<mat-card-title>
|
|
|
|
|
<div fxLayout="row">
|
|
|
|
|
<span class="mat-headline" translate>admin.security-settings</span>
|
|
|
|
|
<span fxFlex></span>
|
|
|
|
|
<div tb-help="securitySettings"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</mat-card-title>
|
|
|
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
|
|
|
|
|
</mat-progress-bar>
|
|
|
|
|
<div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div>
|
|
|
|
|
<mat-card-content style="padding-top: 16px;">
|
2020-04-27 10:39:18 +03:00
|
|
|
<form [formGroup]="securitySettingsFormGroup" (ngSubmit)="save()">
|
2019-08-12 19:34:23 +03:00
|
|
|
<fieldset [disabled]="isLoading$ | async">
|
2020-02-20 18:50:00 +02:00
|
|
|
<mat-expansion-panel [expanded]="true">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
<div class="tb-panel-title" translate>admin.general-policy</div>
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.max-failed-login-attempts</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="maxFailedLoginAttempts"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('maxFailedLoginAttempts').hasError('min')">
|
|
|
|
|
{{ 'admin.minimum-max-failed-login-attempts-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.user-lockout-notification-email</mat-label>
|
|
|
|
|
<input matInput type="email"
|
|
|
|
|
formControlName="userLockoutNotificationEmail"/>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
</mat-expansion-panel>
|
2019-08-12 19:34:23 +03:00
|
|
|
<mat-expansion-panel [expanded]="true">
|
|
|
|
|
<mat-expansion-panel-header>
|
|
|
|
|
<mat-panel-title>
|
|
|
|
|
<div class="tb-panel-title" translate>admin.password-policy</div>
|
|
|
|
|
</mat-panel-title>
|
|
|
|
|
</mat-expansion-panel-header>
|
|
|
|
|
<section formGroupName="passwordPolicy">
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.minimum-password-length</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="minimumLength"
|
|
|
|
|
step="1"
|
|
|
|
|
min="5"
|
|
|
|
|
max="50"
|
|
|
|
|
required/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLength').hasError('required')">
|
|
|
|
|
{{ 'admin.minimum-password-length-required' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLength').hasError('min')">
|
|
|
|
|
{{ 'admin.minimum-password-length-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLength').hasError('max')">
|
|
|
|
|
{{ 'admin.minimum-password-length-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.minimum-uppercase-letters</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="minimumUppercaseLetters"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumUppercaseLetters').hasError('min')">
|
|
|
|
|
{{ 'admin.minimum-uppercase-letters-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.minimum-lowercase-letters</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="minimumLowercaseLetters"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumLowercaseLetters').hasError('min')">
|
|
|
|
|
{{ 'admin.minimum-lowercase-letters-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.minimum-digits</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="minimumDigits"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumDigits').hasError('min')">
|
|
|
|
|
{{ 'admin.minimum-digits-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.minimum-special-characters</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="minimumSpecialCharacters"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('minimumSpecialCharacters').hasError('min')">
|
|
|
|
|
{{ 'admin.minimum-special-characters-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
|
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.password-expiration-period-days</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="passwordExpirationPeriodDays"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('passwordExpirationPeriodDays').hasError('min')">
|
|
|
|
|
{{ 'admin.password-expiration-period-days-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
2020-02-20 18:50:00 +02:00
|
|
|
<mat-form-field class="mat-block">
|
|
|
|
|
<mat-label translate>admin.password-reuse-frequency-days</mat-label>
|
|
|
|
|
<input matInput type="number"
|
|
|
|
|
formControlName="passwordReuseFrequencyDays"
|
|
|
|
|
step="1"
|
|
|
|
|
min="0"/>
|
|
|
|
|
<mat-error *ngIf="securitySettingsFormGroup.get('passwordPolicy').get('passwordReuseFrequencyDays').hasError('min')">
|
|
|
|
|
{{ 'admin.password-reuse-frequency-days-range' | translate }}
|
|
|
|
|
</mat-error>
|
|
|
|
|
</mat-form-field>
|
2019-08-12 19:34:23 +03:00
|
|
|
</section>
|
|
|
|
|
</mat-expansion-panel>
|
|
|
|
|
<div fxLayout="row" fxLayoutAlign="end center" style="width: 100%;" class="layout-wrap">
|
2020-04-27 10:39:18 +03:00
|
|
|
<button mat-button mat-raised-button color="primary" [disabled]="(isLoading$ | async) || securitySettingsFormGroup.invalid || !securitySettingsFormGroup.dirty"
|
2019-08-12 19:34:23 +03:00
|
|
|
type="submit">{{'action.save' | translate}}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
</mat-card-content>
|
|
|
|
|
</mat-card>
|
|
|
|
|
</div>
|