diff --git a/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.html b/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.html index ee9c46d8c1..79c4a2f00d 100644 --- a/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.html +++ b/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.html @@ -38,6 +38,7 @@ {{ 'rule-node-config.device-id-required' | translate }} + diff --git a/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.ts b/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.ts index 7c96131fef..7dd934ccd9 100644 --- a/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/rule-node/external/azure-iot-hub-config.component.ts @@ -53,6 +53,7 @@ export class AzureIotHubConfigComponent extends RuleNodeConfigurationComponent { clientId: [configuration ? configuration.clientId : null, [Validators.required]], cleanSession: [configuration ? configuration.cleanSession : false, []], ssl: [configuration ? configuration.ssl : false, []], + protocolVersion: [configuration ? configuration.protocolVersion : null, []], credentials: this.fb.group( { type: [configuration && configuration.credentials ? configuration.credentials.type : null, [Validators.required]], diff --git a/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts b/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts index 2d88b220c6..277995cba0 100644 --- a/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts +++ b/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts @@ -18,20 +18,7 @@ import { Component, forwardRef, Input } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { SubscriptSizing, MatFormFieldAppearance } from '@angular/material/form-field'; - -export enum MqttVersion { - MQTT_3_1 = 'MQTT_3_1', - MQTT_3_1_1 = 'MQTT_3_1_1', - MQTT_5 = 'MQTT_5' -} - -export const DEFAULT_MQTT_VERSION = MqttVersion.MQTT_3_1_1; - -export const MqttVersionTranslation = new Map([ - [MqttVersion.MQTT_3_1, 'MQTT 3.1'], - [MqttVersion.MQTT_3_1_1, 'MQTT 3.1.1'], - [MqttVersion.MQTT_5, 'MQTT 5.0'] -]); +import { MqttVersionTranslation, MqttVersion } from '@shared/models/mqtt.models'; @Component({ selector: 'tb-mqtt-version-select', diff --git a/ui-ngx/src/app/shared/models/mqtt.models.ts b/ui-ngx/src/app/shared/models/mqtt.models.ts new file mode 100644 index 0000000000..2bd40f3681 --- /dev/null +++ b/ui-ngx/src/app/shared/models/mqtt.models.ts @@ -0,0 +1,29 @@ +/// +/// Copyright © 2016-2025 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +export enum MqttVersion { + MQTT_3_1 = 'MQTT_3_1', + MQTT_3_1_1 = 'MQTT_3_1_1', + MQTT_5 = 'MQTT_5' +} + +export const DEFAULT_MQTT_VERSION = MqttVersion.MQTT_3_1_1; + +export const MqttVersionTranslation = new Map([ + [MqttVersion.MQTT_3_1, 'MQTT 3.1'], + [MqttVersion.MQTT_3_1_1, 'MQTT 3.1.1'], + [MqttVersion.MQTT_5, 'MQTT 5.0'] +]);