|
|
@ -19,6 +19,26 @@ |
|
|
<mat-form-field class="mat-block"> |
|
|
<mat-form-field class="mat-block"> |
|
|
<mat-label translate>device.client-id</mat-label> |
|
|
<mat-label translate>device.client-id</mat-label> |
|
|
<input matInput formControlName="clientId"> |
|
|
<input matInput formControlName="clientId"> |
|
|
|
|
|
<button type="button" |
|
|
|
|
|
matSuffix |
|
|
|
|
|
mat-icon-button |
|
|
|
|
|
aria-label="Generate" |
|
|
|
|
|
matTooltip="{{ 'device.generate-client-id' | translate }}" |
|
|
|
|
|
matTooltipPosition="above" |
|
|
|
|
|
(click)="generate('clientId')" |
|
|
|
|
|
*ngIf="!deviceCredentialsMqttFormGroup.get('clientId').value; else copyClientId"> |
|
|
|
|
|
<mat-icon>autorenew</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
<ng-template #copyClientId> |
|
|
|
|
|
<tb-copy-button |
|
|
|
|
|
matSuffix |
|
|
|
|
|
miniButton="false" |
|
|
|
|
|
[copyText]="deviceCredentialsMqttFormGroup.get('clientId').value" |
|
|
|
|
|
tooltipText="{{ 'device.copy-client-id' | translate }}" |
|
|
|
|
|
tooltipPosition="above" |
|
|
|
|
|
icon="content_copy"> |
|
|
|
|
|
</tb-copy-button> |
|
|
|
|
|
</ng-template> |
|
|
<mat-error *ngIf="deviceCredentialsMqttFormGroup.get('clientId').hasError('pattern')"> |
|
|
<mat-error *ngIf="deviceCredentialsMqttFormGroup.get('clientId').hasError('pattern')"> |
|
|
{{ 'device.client-id-pattern' | translate }} |
|
|
{{ 'device.client-id-pattern' | translate }} |
|
|
</mat-error> |
|
|
</mat-error> |
|
|
@ -26,6 +46,27 @@ |
|
|
<mat-form-field class="mat-block"> |
|
|
<mat-form-field class="mat-block"> |
|
|
<mat-label translate>device.user-name</mat-label> |
|
|
<mat-label translate>device.user-name</mat-label> |
|
|
<input matInput formControlName="userName" [required]="!!deviceCredentialsMqttFormGroup.get('password').value"> |
|
|
<input matInput formControlName="userName" [required]="!!deviceCredentialsMqttFormGroup.get('password').value"> |
|
|
|
|
|
<button type="button" |
|
|
|
|
|
matSuffix |
|
|
|
|
|
mat-icon-button |
|
|
|
|
|
aria-label="Generate" |
|
|
|
|
|
matTooltip="{{ 'device.generate-user-name' | translate }}" |
|
|
|
|
|
matTooltipPosition="above" |
|
|
|
|
|
(click)="generate('userName')" |
|
|
|
|
|
*ngIf="!deviceCredentialsMqttFormGroup.get('userName').value; else copyUserName"> |
|
|
|
|
|
<mat-icon>autorenew</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
<ng-template #copyUserName> |
|
|
|
|
|
<tb-copy-button |
|
|
|
|
|
matSuffix |
|
|
|
|
|
miniButton="false" |
|
|
|
|
|
*ngIf="deviceCredentialsMqttFormGroup.get('userName').value" |
|
|
|
|
|
[copyText]="deviceCredentialsMqttFormGroup.get('userName').value" |
|
|
|
|
|
tooltipText="{{ 'device.copy-user-name' | translate }}" |
|
|
|
|
|
tooltipPosition="above" |
|
|
|
|
|
icon="content_copy"> |
|
|
|
|
|
</tb-copy-button> |
|
|
|
|
|
</ng-template> |
|
|
<mat-error *ngIf="deviceCredentialsMqttFormGroup.get('userName').hasError('required')"> |
|
|
<mat-error *ngIf="deviceCredentialsMqttFormGroup.get('userName').hasError('required')"> |
|
|
{{ 'device.user-name-required' | translate }} |
|
|
{{ 'device.user-name-required' | translate }} |
|
|
</mat-error> |
|
|
</mat-error> |
|
|
@ -37,6 +78,27 @@ |
|
|
(ngModelChange)="passwordChanged()" |
|
|
(ngModelChange)="passwordChanged()" |
|
|
type="password"> |
|
|
type="password"> |
|
|
<tb-toggle-password matSuffix></tb-toggle-password> |
|
|
<tb-toggle-password matSuffix></tb-toggle-password> |
|
|
|
|
|
<button type="button" |
|
|
|
|
|
matSuffix |
|
|
|
|
|
mat-icon-button |
|
|
|
|
|
aria-label="Generate" |
|
|
|
|
|
matTooltip="{{ 'device.generate-password' | translate }}" |
|
|
|
|
|
matTooltipPosition="above" |
|
|
|
|
|
(click)="generate('password')" |
|
|
|
|
|
*ngIf="!deviceCredentialsMqttFormGroup.get('password').value; else copyPassword"> |
|
|
|
|
|
<mat-icon>autorenew</mat-icon> |
|
|
|
|
|
</button> |
|
|
|
|
|
<ng-template #copyPassword> |
|
|
|
|
|
<tb-copy-button |
|
|
|
|
|
matSuffix |
|
|
|
|
|
miniButton="false" |
|
|
|
|
|
*ngIf="deviceCredentialsMqttFormGroup.get('password').value" |
|
|
|
|
|
[copyText]="deviceCredentialsMqttFormGroup.get('password').value" |
|
|
|
|
|
tooltipText="{{ 'device.copy-password' | translate }}" |
|
|
|
|
|
tooltipPosition="above" |
|
|
|
|
|
icon="content_copy"> |
|
|
|
|
|
</tb-copy-button> |
|
|
|
|
|
</ng-template> |
|
|
</mat-form-field> |
|
|
</mat-form-field> |
|
|
<tb-error style="margin-top: -12px; display: block;" |
|
|
<tb-error style="margin-top: -12px; display: block;" |
|
|
[error]="deviceCredentialsMqttFormGroup.hasError('atLeastOne') ? |
|
|
[error]="deviceCredentialsMqttFormGroup.hasError('atLeastOne') ? |
|
|
|