mqtt version refactor models, add to node 'azure iot hub'.
This commit is contained in:
parent
564baea894
commit
73044bb1f2
@ -38,6 +38,7 @@
|
|||||||
{{ 'rule-node-config.device-id-required' | translate }}
|
{{ 'rule-node-config.device-id-required' | translate }}
|
||||||
</mat-error>
|
</mat-error>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<tb-mqtt-version-select formControlName="protocolVersion" subscriptSizing="fixed"></tb-mqtt-version-select>
|
||||||
<mat-accordion>
|
<mat-accordion>
|
||||||
<mat-expansion-panel class="tb-mqtt-credentials-panel-group">
|
<mat-expansion-panel class="tb-mqtt-credentials-panel-group">
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
|
|||||||
@ -53,6 +53,7 @@ export class AzureIotHubConfigComponent extends RuleNodeConfigurationComponent {
|
|||||||
clientId: [configuration ? configuration.clientId : null, [Validators.required]],
|
clientId: [configuration ? configuration.clientId : null, [Validators.required]],
|
||||||
cleanSession: [configuration ? configuration.cleanSession : false, []],
|
cleanSession: [configuration ? configuration.cleanSession : false, []],
|
||||||
ssl: [configuration ? configuration.ssl : false, []],
|
ssl: [configuration ? configuration.ssl : false, []],
|
||||||
|
protocolVersion: [configuration ? configuration.protocolVersion : null, []],
|
||||||
credentials: this.fb.group(
|
credentials: this.fb.group(
|
||||||
{
|
{
|
||||||
type: [configuration && configuration.credentials ? configuration.credentials.type : null, [Validators.required]],
|
type: [configuration && configuration.credentials ? configuration.credentials.type : null, [Validators.required]],
|
||||||
|
|||||||
@ -18,20 +18,7 @@ import { Component, forwardRef, Input } from '@angular/core';
|
|||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||||
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
||||||
import { SubscriptSizing, MatFormFieldAppearance } from '@angular/material/form-field';
|
import { SubscriptSizing, MatFormFieldAppearance } from '@angular/material/form-field';
|
||||||
|
import { MqttVersionTranslation, MqttVersion } from '@shared/models/mqtt.models';
|
||||||
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']
|
|
||||||
]);
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-mqtt-version-select',
|
selector: 'tb-mqtt-version-select',
|
||||||
|
|||||||
29
ui-ngx/src/app/shared/models/mqtt.models.ts
Normal file
29
ui-ngx/src/app/shared/models/mqtt.models.ts
Normal 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']
|
||||||
|
]);
|
||||||
Loading…
x
Reference in New Issue
Block a user