diff --git a/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html b/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html index 4025e34dda..be71d3724e 100644 --- a/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html +++ b/ui-ngx/src/app/modules/home/components/device/device-credentials-mqtt-basic.component.html @@ -19,6 +19,26 @@ device.client-id + + + + + {{ 'device.client-id-pattern' | translate }} @@ -26,6 +46,27 @@ device.user-name + + + + + {{ 'device.user-name-required' | translate }} @@ -37,6 +78,27 @@ (ngModelChange)="passwordChanged()" type="password"> + + + + + device.access-token + + + + + {{ 'device.access-token-required' | translate }} @@ -41,6 +61,15 @@ device.certificate-pem-format + + {{ 'device.certificate-pem-format-required' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/device/device-credentials.component.ts b/ui-ngx/src/app/modules/home/components/device/device-credentials.component.ts index 2e2f20eb24..bc9af3867e 100644 --- a/ui-ngx/src/app/modules/home/components/device/device-credentials.component.ts +++ b/ui-ngx/src/app/modules/home/components/device/device-credentials.component.ts @@ -34,7 +34,7 @@ import { } from '@shared/models/device.models'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { isDefinedAndNotNull } from '@core/utils'; +import { generateSecret, isDefinedAndNotNull } from '@core/utils'; @Component({ selector: 'tb-device-credentials', @@ -181,4 +181,8 @@ export class DeviceCredentialsComponent implements ControlValueAccessor, OnInit, break; } } + + public generate(formControlName: string) { + this.deviceCredentialsFormGroup.get(formControlName).patchValue(generateSecret(20)); + } } diff --git a/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html b/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html index fb78ba0b97..bc5ffd3ae5 100644 --- a/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html +++ b/ui-ngx/src/app/modules/home/pages/admin/oauth2-settings.component.html @@ -95,6 +95,7 @@