From cdb79bfc0cba129b58119d3ab0dc9af0b28dd944 Mon Sep 17 00:00:00 2001 From: Maksym Dudnik Date: Tue, 27 Jun 2023 12:05:32 +0300 Subject: [PATCH] requested changes and internationalization fix --- .../device-example-command.component.html | 16 +++--- .../device-example-command.component.ts | 2 +- .../lib/gateway/gateway-form.component.html | 2 +- .../gateway-logs-settings.component.html | 4 +- ...ateway-service-rpc-settings.component.html | 2 +- .../device-gateway-command.component.html | 2 +- .../gateway-configuration.component.html | 52 +++++++++---------- .../gateway-configuration.component.scss | 2 +- .../device/gateway-connectors.component.html | 21 ++++---- .../device/gateway-service-rpc.component.html | 6 +-- .../device/gateway-statistics.component.html | 4 +- .../device/gateway-statistics.component.ts | 3 +- .../gateway-remote-configuration-dialog.html | 6 +-- .../gateway-remote-configuration-dialog.ts | 4 +- .../components/file-input.component.html | 4 +- .../components/file-input.component.scss | 2 +- .../assets/locale/locale.constant-en_US.json | 21 +++++++- 17 files changed, 86 insertions(+), 67 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/device/device-example-command.component.html b/ui-ngx/src/app/modules/home/components/device/device-example-command.component.html index 69fe98ba3d..ea29f533ba 100644 --- a/ui-ngx/src/app/modules/home/components/device/device-example-command.component.html +++ b/ui-ngx/src/app/modules/home/components/device/device-example-command.component.html @@ -27,12 +27,12 @@ HTTP - In order to publish telemetry data to (ThingsBoard device) with credentials of the current device you can use the following commands. +
MQTT - 1. Setup: - 2. Send command: + {{'device.telemetry-command-setup-step'| translate}} + {{'device.telemetry-command-send-step'| translate}}
{{ mqttCode }}
+ [disabled]="commandForm.invalid">{{'gateway.rpc-command-send' | translate}} - Result + {{'gateway.rpc-command-result' | translate}} diff --git a/ui-ngx/src/app/shared/components/device/gateway-statistics.component.html b/ui-ngx/src/app/shared/components/device/gateway-statistics.component.html index 6233205eaa..611e68dbea 100644 --- a/ui-ngx/src/app/shared/components/device/gateway-statistics.component.html +++ b/ui-ngx/src/app/shared/components/device/gateway-statistics.component.html @@ -46,13 +46,13 @@ matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="pageLink.sortDirection()" matSortDisableClear> - Timestamp + {{'audit-log.timestamp' | translate}} {{row[0]| date:'yyyy-MM-dd HH:mm:ss' }} - Message + {{"event.message" | translate}} {{ row[1] }} diff --git a/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts b/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts index cc0c2e0591..91ddd1ab9e 100644 --- a/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts +++ b/ui-ngx/src/app/shared/components/device/gateway-statistics.component.ts @@ -39,7 +39,6 @@ import { PageLink } from '@shared/models/page/page-link'; import { Direction, SortOrder } from '@shared/models/page/sort-order'; import { MatTableDataSource } from '@angular/material/table'; import { MatSort } from '@angular/material/sort'; -import { isNumber } from '@core/utils'; @Component({ @@ -131,7 +130,7 @@ export class GatewayStatisticsComponent extends PageComponent implements AfterVi this.attributeService.getEntityAttributes(gateway.id, AttributeScope.SHARED_SCOPE, ["general_configuration"]).subscribe((resp: AttributeData[]) => { if (resp && resp.length) { this.commands = resp[0].value.statistics.commands; - if (!this.statisticForm.get('statisticKey').value) { + if (!this.statisticForm.get('statisticKey').value && this.commands && this.commands.length) { this.statisticForm.get('statisticKey').setValue(this.commands[0].attributeOnGateway); this.createChartsSubscription(gateway, this.commands[0].attributeOnGateway); } diff --git a/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.html b/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.html index d8bff54898..7a66cfd4fb 100644 --- a/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.html +++ b/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.html @@ -31,9 +31,9 @@ gateway.configuration-delete-dialog-input - + + *ngIf="gatewayControl.hasError('required')"> {{'gateway.configuration-delete-dialog-input-required' | translate }} @@ -49,7 +49,7 @@ diff --git a/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.ts b/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.ts index 95850a2444..49e44b2302 100644 --- a/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.ts +++ b/ui-ngx/src/app/shared/components/dialog/gateway-remote-configuration-dialog.ts @@ -36,7 +36,7 @@ export class GatewayRemoteConfigurationDialogComponent extends DialogComponent, protected router: Router, @@ -45,7 +45,7 @@ export class GatewayRemoteConfigurationDialogComponent extends DialogComponent
diff --git a/ui-ngx/src/app/shared/components/file-input.component.scss b/ui-ngx/src/app/shared/components/file-input.component.scss index efbaff1932..a229a01bfb 100644 --- a/ui-ngx/src/app/shared/components/file-input.component.scss +++ b/ui-ngx/src/app/shared/components/file-input.component.scss @@ -94,7 +94,7 @@ $previewSize: 100px !default; } } - .pe { + .pointer-event { pointer-events: auto; } } 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 29b68ae52b..2750ed4484 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -1311,6 +1311,10 @@ "copyAccessToken": "Copy access token", "copy-mqtt-authentication": "Copy MQTT credentials", "transportCommandCopiedMessage": "Transport Command has been copied to clipboard", + "telemetry-commands-help-link": "In order to publish telemetry data to (ThingsBoard device) with credentials of the current device you can use the following commands.", + "telemetry-command-setup-step": "1. Setup:", + "telemetry-command-send-step": "2. Send command:", + "telemetry-command-send-step-coap": "2. Send command: (based on CoAP cli)", "idCopiedMessage": "Device Id has been copied to clipboard", "accessTokenCopiedMessage": "Device access token has been copied to clipboard", "mqtt-authentication-copied-message": "Device MQTT authentication has been copied to clipboard", @@ -2565,11 +2569,22 @@ "xmpp": "XMPP Connector", "ocpp": "OCPP Connector" }, - "connectors": "Connectors configuration", + "connectors": "Connectors", + "connectors-config": "Connectors configuration", "connectors-active": "Connector active", "connectors-inactive": "Connector inactive", + "connectors-table-enabled": "Enabled", + "connectors-table-name": "Name", + "connectors-table-type": "Type", + "connectors-table-actions": "Actions", + "connectors-table-key": "Key", + "connectors-table-class": "Class", + "rpc-command-send": "Send", + "rpc-command-result": "Result", + "rpc-command-edit-params": "Edit parameters", "select-connector": "Select connector", "gateway-configuration": "Gateway Configuration", + "docker-label": "In order to run ThingsBoard IoT gateway in docker with credentials for this device you can use the following commands.", "copy-command": "Copy docker command", "create-new-gateway": "Create a new gateway", "create-new-gateway-text": "Are you sure you want create a new gateway with name: '{{gatewayName}}'?", @@ -4643,7 +4658,9 @@ "read-only": "Read only", "events-title": "Gateway events form title", "events-filter": "Events filter", - "event-key-contains": "Event key contains..." + "event-key-contains": "Event key contains...", + "is-connector": "Is Connector", + "state-param-name": "State parameter connector name" }, "gauge": { "default-color": "Default color",