mqtt version refactor models, add to node 'azure iot hub'.

This commit is contained in:
deaflynx 2025-05-12 14:57:09 +03:00
parent 564baea894
commit 73044bb1f2
4 changed files with 32 additions and 14 deletions

View File

@ -38,6 +38,7 @@
{{ 'rule-node-config.device-id-required' | translate }}
</mat-error>
</mat-form-field>
<tb-mqtt-version-select formControlName="protocolVersion" subscriptSizing="fixed"></tb-mqtt-version-select>
<mat-accordion>
<mat-expansion-panel class="tb-mqtt-credentials-panel-group">
<mat-expansion-panel-header>

View File

@ -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]],

View File

@ -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, string>([
[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',

View File

@ -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, string>([
[MqttVersion.MQTT_3_1, 'MQTT 3.1'],
[MqttVersion.MQTT_3_1_1, 'MQTT 3.1.1'],
[MqttVersion.MQTT_5, 'MQTT 5.0']
]);