From 0d6a49aafc24119b3baeb80ad25343c8ffeb2bfb Mon Sep 17 00:00:00 2001 From: nickAS21 Date: Wed, 20 Oct 2021 17:24:40 +0300 Subject: [PATCH] Lwm2m front base64 tooltip --- .../device-credentials-lwm2m-server.component.html | 7 +++++++ .../device/device-credentials-lwm2m.component.html | 14 +++++++++++--- .../lwm2m-device-config-server.component.html | 7 ++++++- ...-profile-transport-configuration.component.html | 4 ++-- .../src/assets/locale/locale.constant-cs_CZ.json | 1 - .../src/assets/locale/locale.constant-en_US.json | 13 +++++++++---- .../src/assets/locale/locale.constant-tr_TR.json | 1 - 7 files changed, 35 insertions(+), 12 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m-server.component.html b/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m-server.component.html index 3c3806882f..d9f08787b6 100644 --- a/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m-server.component.html +++ b/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m-server.component.html @@ -32,6 +32,9 @@ cdkAutosizeMinRows="1" cols="1" formControlName="clientPublicKeyOrId" + matTooltip="{{ 'device.lwm2m-security-config.client-publicKey-or-id-tooltip' | translate: + {count: serverFormGroup.get('securityMode').value === securityConfigLwM2MType.PSK? 0 : + serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK? 1 : 2} }}" required> @@ -45,6 +48,10 @@ cdkAutosizeMinRows="1" cols="1" formControlName="clientSecretKey" + matTooltip="{{ 'device.lwm2m-security-config.client-secret-key-tooltip' | translate: + {count: serverFormGroup.get('securityMode').value === securityConfigLwM2MType.PSK? 0 : + serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK? 1 : 2} }}" + matTooltipPosition="below" required> diff --git a/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m.component.html b/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m.component.html index b10eaf68ae..5833e33934 100644 --- a/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m.component.html +++ b/ui-ngx/src/app/modules/home/components/device/device-credentials-lwm2m.component.html @@ -34,9 +34,12 @@ - + {{ 'device.lwm2m-security-config.identity' | translate }} - + {{ 'device.lwm2m-security-config.identity-required' | translate }} @@ -49,7 +52,10 @@ cdkAutosizeMinRows="1" cols="1" formControlName="key" - required> + required + matTooltip="{{ 'device.lwm2m-security-config.client-key-tooltip' | translate:{count: + lwm2mConfigFormGroup.get('client.securityConfigClientMode').value === securityConfigLwM2MType.PSK?0:1} }}" + matTooltipPosition="below"> {{ 'device.lwm2m-security-config.client-key-required' | translate }} @@ -61,6 +67,8 @@ cdkTextareaAutosize cdkAutosizeMinRows="1" cols="1" + matTooltip="{{ 'device.lwm2m-security-config.client-public-key-tooltip' | translate: {count: lwm2mConfigFormGroup.get('client.cert').value?1:2} }}" + matTooltipPosition="below" formControlName="cert"> device.lwm2m-security-config.client-public-key-hint diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-config-server.component.html b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-config-server.component.html index 9c2ce132d8..9606883368 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-config-server.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-config-server.component.html @@ -99,7 +99,12 @@ cdkAutosizeMinRows="1" cols="1" required formControlName="serverPublicKey" - > + matTooltip="{{ 'device.lwm2m-security-config.client-publicKey-or-id-tooltip' | translate: + {count: serverFormGroup.get('securityMode').value === securityConfigLwM2MType.RPK? 1 : 2} }}" + matTooltipPosition="below" + required> + + {{ 'device-profile.lwm2m.server-public-key-required' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html index 5e444f8ee2..a514891e09 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html @@ -31,13 +31,13 @@ - +
- {{ 'device-profile.lwm2m.servers' | translate }} + {{ 'device-profile.lwm2m.security' | translate }}
diff --git a/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json b/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json index 4e1ec64412..97bc94b645 100644 --- a/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json +++ b/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json @@ -1258,7 +1258,6 @@ "view-attribute": "Zobrazit atribut", "remove-attribute": "Odebrat atribut", "mode": "Režim konfigurace bezpečnosti", - "servers": "Servery", "short-id": "Krátké ID", "short-id-required": "Krátké ID je povinné.", "short-id-range": "Krátké ID by mělo být v rozsahu od 1 do 65534.", diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 4bbde6c029..91dfca6955 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -963,10 +963,15 @@ "lwm2m-security-config": { "identity": "Client Identity", "identity-required": "Client Identity is required.", + "identity-tooltip": "PSK identity is arbitrary PSK Identities of up to 128 bytes, as mandated in [RFC7925]. \n PSK identity MUST be first converted to a character string, and then encoded to octets using UTF-8 [UTF8].", "client-key": "Client Key", "client-key-required": "Client Key is required.", + "client-key-tooltip": "{ count, plural, 1 {RPK public key or id should be in RFC7250 standard and encoded to Base64 format!} other {PSK key should be in RFC4279 standard and HexDec format: 32, 64, 128 characters!.} }", "endpoint": "Endpoint Client Name", "endpoint-required": "Endpoint Client Name is required.", + "client-public-key": "Client public key", + "client-public-key-hint": "If client public key is empty, the trusted certificate will be used", + "client-public-key-tooltip": "{ count, plural, 1 {X509 public key should be in DER-encoded X509v3 format and support only EC algorithm and encoded to Base64 format!} other {} }", "mode": "Security config mode", "client-tab": "Client Security Config", "client-certificate": "Client certificate", @@ -975,10 +980,10 @@ "lwm2m-server": "LwM2M Server", "client-publicKey-or-id": "Client Public Key or Id", "client-publicKey-or-id-required": "Client Public Key or Id is required.", + "client-publicKey-or-id-tooltip": "{ count, plural, 0 {PSK identity is arbitrary PSK Identities of up to 128 bytes, as mandated in [RFC7925]. \n PSK identity MUST be first converted to a character string, and then encoded to octets using UTF-8 [UTF8].} 1 {RPK public key or id should be in RFC7250 standard and encoded to Base64 format!} other {X509 public key should be in DER-encoded X509v3 format and support only EC algorithm and encoded to Base64 format!} }", "client-secret-key": "Client Secret Key", "client-secret-key-required": "Client Secret Key is required.", - "client-public-key": "Client public key", - "client-public-key-hint": "If client public key is empty, the trusted certificate will be used" + "client-secret-key-tooltip": "{ count, plural, 0 {PSK key should be in RFC4279 standard and HexDec format: 32, 64, 128 characters!.} 1 {RPK secret key should be in PKCS_8 format (DER encoding, RFC5958 standard) and encoded to Base64 format!} other {X509 secret key should be in PKCS_8 format (DER encoding, RFC5958 standard) and encoded to Base64 format!} }" }, "client-id": "Client ID", "client-id-pattern": "Contains invalid character.", @@ -1272,7 +1277,8 @@ "view-attribute": "View attribute", "remove-attribute": "Remove attribute", "mode": "Security config mode", - "servers": "Servers", + "security": "Securities", + "bootstrap-tab": "Bootstrap", "short-id": "Short ID", "short-id-required": "Short ID is required.", "short-id-range": "Short ID should be in a range from 1 to 65534.", @@ -1297,7 +1303,6 @@ "s": "S: SMS connection in standard mode", "sq": "SQ: SMS connection in queue mode" }, - "bootstrap-tab": "Bootstrap", "bootstrap-server": "Bootstrap Server", "lwm2m-server": "LwM2M Server", "server-host": "Host", diff --git a/ui-ngx/src/assets/locale/locale.constant-tr_TR.json b/ui-ngx/src/assets/locale/locale.constant-tr_TR.json index c600cb0c9a..3bca05e458 100644 --- a/ui-ngx/src/assets/locale/locale.constant-tr_TR.json +++ b/ui-ngx/src/assets/locale/locale.constant-tr_TR.json @@ -1271,7 +1271,6 @@ "view-attribute": "Öznitelik görüntüle", "remove-attribute": "Öznitelik kaldır", "mode": "Güvenlik yapılandırma modu", - "servers": "Sunucular", "short-id": "Kısa ID", "short-id-required": "Kısa ID gerekli.", "short-id-range": "Kısa ID 1 ile 65534 aralığında olmalıdır.",