|
|
|
@ -21,7 +21,7 @@ |
|
|
|
<mat-select formControlName="type" required> |
|
|
|
@for (type of deviceProvisionTypes; track type) { |
|
|
|
<mat-option [value]="type"> |
|
|
|
{{ getDeviceProvisionType(type) | translate }} |
|
|
|
{{deviceProvisionTypeTranslateMap.get(type) | translate}} |
|
|
|
</mat-option> |
|
|
|
} |
|
|
|
</mat-select> |
|
|
|
@ -31,10 +31,10 @@ |
|
|
|
</mat-form-field> |
|
|
|
@switch (provisionConfigurationFormGroup.get('type').value) { |
|
|
|
@case (deviceProvisionType.ALLOW_CREATE_NEW_DEVICES) { |
|
|
|
<ng-container *ngTemplateOutlet="default"></ng-container> |
|
|
|
<ng-container *ngTemplateOutlet="keySecretFields"></ng-container> |
|
|
|
} |
|
|
|
@case (deviceProvisionType.CHECK_PRE_PROVISIONED_DEVICES) { |
|
|
|
<ng-container *ngTemplateOutlet="default"></ng-container> |
|
|
|
<ng-container *ngTemplateOutlet="keySecretFields"></ng-container> |
|
|
|
} |
|
|
|
@case (deviceProvisionType.X509_CERTIFICATE_CHAIN) { |
|
|
|
<div class="tb-hint flex flex-1 items-center justify-start"> |
|
|
|
@ -71,38 +71,38 @@ |
|
|
|
</mat-form-field> |
|
|
|
} |
|
|
|
} |
|
|
|
<ng-template #keySecretFields> |
|
|
|
<section class="flex flex-row xs:flex-col gt-xs:gap-2"> |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
<mat-label translate>device-profile.provision-device-key</mat-label> |
|
|
|
<input matInput formControlName="provisionDeviceKey" required/> |
|
|
|
<button matSuffix mat-icon-button |
|
|
|
ngxClipboard |
|
|
|
[cbContent]="provisionConfigurationFormGroup.get('provisionDeviceKey').value" |
|
|
|
(cbOnSuccess)="onProvisionCopied(true)" |
|
|
|
matTooltip="{{ 'device-profile.copy-provision-key' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left" style="font-size: 20px;"></mat-icon> |
|
|
|
</button> |
|
|
|
@if (provisionConfigurationFormGroup.get('provisionDeviceKey').hasError('required')) { |
|
|
|
<mat-error>{{ 'device-profile.provision-device-key-required' | translate }}</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
<mat-label translate>device-profile.provision-device-secret</mat-label> |
|
|
|
<input matInput formControlName="provisionDeviceSecret" required/> |
|
|
|
<button matSuffix mat-icon-button |
|
|
|
ngxClipboard |
|
|
|
[cbContent]="provisionConfigurationFormGroup.get('provisionDeviceSecret').value" |
|
|
|
(cbOnSuccess)="onProvisionCopied(false)" |
|
|
|
matTooltip="{{ 'device-profile.copy-provision-secret' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left" style="font-size: 20px;"></mat-icon> |
|
|
|
</button> |
|
|
|
@if (provisionConfigurationFormGroup.get('provisionDeviceSecret').hasError('required')) { |
|
|
|
<mat-error>{{ 'device-profile.provision-device-secret-required' | translate }}</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
</section> |
|
|
|
</ng-template> |
|
|
|
</div> |
|
|
|
<ng-template #default> |
|
|
|
<section class="flex flex-row xs:flex-col gt-xs:gap-2"> |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
<mat-label translate>device-profile.provision-device-key</mat-label> |
|
|
|
<input matInput formControlName="provisionDeviceKey" required/> |
|
|
|
<button matSuffix mat-icon-button |
|
|
|
ngxClipboard |
|
|
|
[cbContent]="provisionConfigurationFormGroup.get('provisionDeviceKey').value" |
|
|
|
(cbOnSuccess)="onProvisionCopied(true)" |
|
|
|
matTooltip="{{ 'device-profile.copy-provision-key' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left" style="font-size: 20px;"></mat-icon> |
|
|
|
</button> |
|
|
|
@if (provisionConfigurationFormGroup.get('provisionDeviceKey').hasError('required')) { |
|
|
|
<mat-error>{{ 'device-profile.provision-device-key-required' | translate }}</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
<mat-form-field class="mat-block flex-1" appearance="outline"> |
|
|
|
<mat-label translate>device-profile.provision-device-secret</mat-label> |
|
|
|
<input matInput formControlName="provisionDeviceSecret" required/> |
|
|
|
<button matSuffix mat-icon-button |
|
|
|
ngxClipboard |
|
|
|
[cbContent]="provisionConfigurationFormGroup.get('provisionDeviceSecret').value" |
|
|
|
(cbOnSuccess)="onProvisionCopied(false)" |
|
|
|
matTooltip="{{ 'device-profile.copy-provision-secret' | translate }}" |
|
|
|
matTooltipPosition="above"> |
|
|
|
<mat-icon svgIcon="mdi:clipboard-arrow-left" style="font-size: 20px;"></mat-icon> |
|
|
|
</button> |
|
|
|
@if (provisionConfigurationFormGroup.get('provisionDeviceSecret').hasError('required')) { |
|
|
|
<mat-error>{{ 'device-profile.provision-device-secret-required' | translate }}</mat-error> |
|
|
|
} |
|
|
|
</mat-form-field> |
|
|
|
</section> |
|
|
|
</ng-template> |
|
|
|
|