diff --git a/application/src/main/data/json/tenant/dashboards/gateways.json b/application/src/main/data/json/tenant/dashboards/gateways.json
index 11813ae878..a62550ed95 100644
--- a/application/src/main/data/json/tenant/dashboards/gateways.json
+++ b/application/src/main/data/json/tenant/dashboards/gateways.json
@@ -880,7 +880,7 @@
"isConnectorLog": true,
"connectorLogState": "connector_logs"
},
- "title": "${entityName} Logs",
+ "title": "${connectorName} logs",
"showTitleIcon": false,
"dropShadow": true,
"enableFullscreen": true,
@@ -1085,13 +1085,14 @@
"showLegend": false,
"actions": {},
"datasources": [],
- "targetDeviceAliasIds": [
- "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
- ],
"showTitleIcon": false,
"widgetCss": "",
"pageSize": 1024,
- "noDataDisplayMessage": ""
+ "noDataDisplayMessage": "",
+ "targetDevice": {
+ "type": "entity",
+ "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
+ }
},
"row": 0,
"col": 0,
@@ -1494,15 +1495,16 @@
"showLegend": false,
"actions": {},
"datasources": [],
- "targetDeviceAliasIds": [
- "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
- ],
"showTitleIcon": false,
"titleTooltip": "",
"widgetCss": "",
"pageSize": 1024,
"noDataDisplayMessage": "",
- "borderRadius": "4px"
+ "borderRadius": "4px",
+ "targetDevice": {
+ "type": "entity",
+ "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
+ }
},
"row": 0,
"col": 0,
@@ -1557,9 +1559,6 @@
},
"title": "Service RPC",
"datasources": [],
- "targetDeviceAliasIds": [
- "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
- ],
"showTitleIcon": false,
"titleTooltip": "",
"dropShadow": true,
@@ -1574,7 +1573,11 @@
"noDataDisplayMessage": "",
"enableDataExport": false,
"showLegend": false,
- "borderRadius": "4px"
+ "borderRadius": "4px",
+ "targetDevice": {
+ "type": "entity",
+ "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
+ }
},
"row": 0,
"col": 0,
@@ -1596,9 +1599,6 @@
},
"title": "Service RPC",
"datasources": [],
- "targetDeviceAliasIds": [
- "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
- ],
"showTitleIcon": false,
"titleTooltip": "",
"dropShadow": true,
@@ -1613,7 +1613,11 @@
"noDataDisplayMessage": "",
"enableDataExport": false,
"showLegend": false,
- "borderRadius": "4px"
+ "borderRadius": "4px",
+ "targetDevice": {
+ "type": "entity",
+ "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
+ }
},
"row": 0,
"col": 0,
@@ -1802,15 +1806,16 @@
"showLegend": false,
"actions": {},
"datasources": [],
- "targetDeviceAliasIds": [
- "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
- ],
"showTitleIcon": false,
"titleTooltip": "",
"widgetCss": "",
"pageSize": 1024,
"noDataDisplayMessage": "",
- "borderRadius": "4px"
+ "borderRadius": "4px",
+ "targetDevice": {
+ "type": "entity",
+ "entityAliasId": "a2f01c66-96cf-49c5-303f-e6f21c559ee8"
+ }
},
"row": 0,
"col": 0,
@@ -2102,6 +2107,448 @@
"ACTIVE"
]
}
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "bd9176e1-9e04-3e9b-d5a5-07b72bb9ae90",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "mqttCount",
+ "color": "#4caf50",
+ "settings": {},
+ "_hash": 0.9590451878027946,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entity",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "44038462-1bae-e075-7b31-283341cb2295",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "entityField",
+ "label": "modbusCount",
+ "color": "#4caf50",
+ "settings": {},
+ "_hash": 0.9300660062254784,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "884e9c34-7534-a483-99be-81b56cd91185",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "grcpCount",
+ "color": "#f44336",
+ "settings": {},
+ "_hash": 0.16110429492126088,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "e91ca0e9-1653-4fbc-5f3d-3da021b1b415",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "opcuaCount",
+ "color": "#ffc107",
+ "settings": {},
+ "_hash": 0.13973521146913304,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "3f74cbaa-6353-5e88-a7e8-708fc0e18039",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "bleCount",
+ "color": "#607d8b",
+ "settings": {},
+ "_hash": 0.7205723252294653,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "c08eee84-64ee-73c4-8d96-c0df813a92cd",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "requestCount",
+ "color": "#9c27b0",
+ "settings": {},
+ "_hash": 0.6993292961463216,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "2f0af7f5-22ea-c0d5-3aef-7f2bb1b534ec",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "canCount",
+ "color": "#8bc34a",
+ "settings": {},
+ "_hash": 0.4850065031079176,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "92a7d208-c143-ea20-5162-1da584532830",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "bacnetCount",
+ "color": "#3f51b5",
+ "settings": {},
+ "_hash": 0.36987531665233075,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "498f090c-b1e5-df74-35d1-3ecf89d33f1c",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "odbcCount",
+ "color": "#e91e63",
+ "settings": {},
+ "_hash": 0.8279345016611896,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "9175179d-a8db-848b-0762-e78da150e768",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "restCount",
+ "color": "#ffeb3b",
+ "settings": {},
+ "_hash": 0.07245826389852739,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "9175179d-a8db-848b-0762-e78da150e768",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "restCount",
+ "color": "#03a9f4",
+ "settings": {},
+ "_hash": 0.4321492578560704,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "1b70460b-428b-2aed-f23a-65927d3e67bb",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "snmpCount",
+ "color": "#ff9800",
+ "settings": {},
+ "_hash": 0.7395574625078822,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "ae357478-b4c2-eee8-dde6-a6942fe6202f",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "ftpCount",
+ "color": "#673ab7",
+ "settings": {},
+ "_hash": 0.9999791065203374,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "6eef4979-369f-c2cc-4894-96a84b6a668a",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "socketCount",
+ "color": "#cddc39",
+ "settings": {},
+ "_hash": 0.47563823619478685,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "9c8e3a63-01a1-64b5-fe44-4f58f8350340",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "xmppCount",
+ "color": "#009688",
+ "settings": {},
+ "_hash": 0.5679285702280172,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "c6501413-d823-29c4-992f-9ae6e8e25549",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "ocppCount",
+ "color": "#795548",
+ "settings": {},
+ "_hash": 0.38390880166484287,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
+ },
+ {
+ "type": "entityCount",
+ "entityAliasId": "a75d9031-ba51-8da4-81be-de65061b72f4",
+ "filterId": "2f04d6e5-8438-857a-ca78-ae78cc8b0c03",
+ "dataKeys": [
+ {
+ "name": "count",
+ "type": "count",
+ "label": "customCount",
+ "color": "#00bcd4",
+ "settings": {},
+ "_hash": 0.9282529984749979,
+ "aggregationType": null,
+ "units": null,
+ "decimals": null,
+ "funcBody": null,
+ "usePostProcessing": null,
+ "postFuncBody": null
+ }
+ ],
+ "alarmFilterConfig": {
+ "statusList": [
+ "ACTIVE"
+ ]
+ }
}
],
"timewindow": {
@@ -2134,7 +2581,7 @@
"padding": "0px",
"settings": {
"useMarkdownTextFunction": false,
- "markdownTextPattern": "
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n",
+ "markdownTextPattern": "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n",
"applyDefaultMarkdownStyle": false,
"markdownCss": ".mat-mdc-form-field-subscript-wrapper {\n display: none !important;\n}"
},
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/broker-config-control/broker-config-control.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/broker-config-control/broker-config-control.component.html
new file mode 100644
index 0000000000..f70ed366e1
--- /dev/null
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/broker-config-control/broker-config-control.component.html
@@ -0,0 +1,86 @@
+
+
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/broker-config-control/broker-config-control.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/broker-config-control/broker-config-control.component.ts
new file mode 100644
index 0000000000..13f5c7c77e
--- /dev/null
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/broker-config-control/broker-config-control.component.ts
@@ -0,0 +1,130 @@
+///
+/// Copyright © 2016-2024 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.
+///
+
+import { ChangeDetectionStrategy, Component, forwardRef, OnDestroy } from '@angular/core';
+import {
+ ControlValueAccessor,
+ FormBuilder,
+ NG_VALIDATORS,
+ NG_VALUE_ACCESSOR,
+ UntypedFormGroup,
+ ValidationErrors,
+ Validator,
+ Validators
+} from '@angular/forms';
+import {
+ BrokerConfig,
+ MqttVersions,
+ noLeadTrailSpacesRegex,
+ PortLimits,
+} from '@home/components/widget/lib/gateway/gateway-widget.models';
+import { SharedModule } from '@shared/shared.module';
+import { CommonModule } from '@angular/common';
+import { TranslateService } from '@ngx-translate/core';
+import { generateSecret } from '@core/utils';
+import { SecurityConfigComponent } from '@home/components/widget/lib/gateway/connectors-configuration/public-api';
+import { Subject } from 'rxjs';
+
+@Component({
+ selector: 'tb-broker-config-control',
+ templateUrl: './broker-config-control.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ standalone: true,
+ imports: [
+ CommonModule,
+ SharedModule,
+ SecurityConfigComponent,
+ ],
+ providers: [
+ {
+ provide: NG_VALUE_ACCESSOR,
+ useExisting: forwardRef(() => BrokerConfigControlComponent),
+ multi: true
+ },
+ {
+ provide: NG_VALIDATORS,
+ useExisting: forwardRef(() => BrokerConfigControlComponent),
+ multi: true
+ }
+ ]
+})
+export class BrokerConfigControlComponent implements ControlValueAccessor, Validator, OnDestroy {
+ brokerConfigFormGroup: UntypedFormGroup;
+ mqttVersions = MqttVersions;
+ portLimits = PortLimits;
+
+ private onChange: (value: string) => void;
+ private onTouched: () => void;
+
+ private destroy$ = new Subject();
+
+ constructor(private fb: FormBuilder,
+ private translate: TranslateService) {
+ this.brokerConfigFormGroup = this.fb.group({
+ name: ['', []],
+ host: ['', [Validators.required, Validators.pattern(noLeadTrailSpacesRegex)]],
+ port: [null, [Validators.required, Validators.min(PortLimits.MIN), Validators.max(PortLimits.MAX)]],
+ version: [5, []],
+ clientId: ['', [Validators.pattern(noLeadTrailSpacesRegex)]],
+ security: []
+ });
+
+ this.brokerConfigFormGroup.valueChanges.subscribe(value => {
+ this.onChange(value);
+ this.onTouched();
+ });
+ }
+
+ get portErrorTooltip(): string {
+ if (this.brokerConfigFormGroup.get('port').hasError('required')) {
+ return this.translate.instant('gateway.port-required');
+ } else if (
+ this.brokerConfigFormGroup.get('port').hasError('min') ||
+ this.brokerConfigFormGroup.get('port').hasError('max')
+ ) {
+ return this.translate.instant('gateway.port-limits-error',
+ {min: PortLimits.MIN, max: PortLimits.MAX});
+ }
+ return '';
+ }
+
+ ngOnDestroy(): void {
+ this.destroy$.next();
+ this.destroy$.complete();
+ }
+
+ generate(formControlName: string): void {
+ this.brokerConfigFormGroup.get(formControlName)?.patchValue('tb_gw_' + generateSecret(5));
+ }
+
+ registerOnChange(fn: (value: string) => void): void {
+ this.onChange = fn;
+ }
+
+ registerOnTouched(fn: () => void): void {
+ this.onTouched = fn;
+ }
+
+ writeValue(brokerConfig: BrokerConfig): void {
+ this.brokerConfigFormGroup.patchValue(brokerConfig, {emitEvent: false});
+ }
+
+ validate(): ValidationErrors | null {
+ return this.brokerConfigFormGroup.valid ? null : {
+ brokerConfigFormGroup: {valid: false}
+ };
+ }
+}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.html
similarity index 88%
rename from ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.html
rename to ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.html
index c3fe478ef2..bbaf616471 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.html
@@ -50,9 +50,10 @@
class="tb-error">
warning
-
@@ -83,9 +84,10 @@
class="tb-error">
warning
-
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.scss
similarity index 100%
rename from ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.scss
rename to ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.scss
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.ts
similarity index 83%
rename from ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.ts
rename to ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.ts
index 8a40f25430..569f40b185 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/device-info-table/device-info-table.component.ts
@@ -16,27 +16,19 @@
import {
ChangeDetectionStrategy,
- ChangeDetectorRef,
Component,
- ElementRef,
forwardRef,
Input,
- NgZone,
OnDestroy,
OnInit,
- ViewContainerRef
} from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { TranslateService } from '@ngx-translate/core';
import { MatDialog } from '@angular/material/dialog';
-import { DialogService } from '@core/services/dialog.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
-import { Overlay } from '@angular/cdk/overlay';
-import { UtilsService } from '@core/services/utils.service';
-import { EntityService } from '@core/http/entity.service';
import {
ControlValueAccessor,
FormBuilder,
@@ -50,6 +42,7 @@ import {
import {
DeviceInfoType,
noLeadTrailSpacesRegex,
+ OPCUaSourceTypes,
SourceTypes,
SourceTypeTranslationsMap
} from '@home/components/widget/lib/gateway/gateway-widget.models';
@@ -88,7 +81,7 @@ export class DeviceInfoTableComponent extends PageComponent implements ControlVa
required = false;
@Input()
- sourceTypes: Array = Object.values(SourceTypes);
+ sourceTypes: Array = Object.values(SourceTypes);
deviceInfoTypeValue: any;
@@ -111,14 +104,6 @@ export class DeviceInfoTableComponent extends PageComponent implements ControlVa
constructor(protected store: Store,
public translate: TranslateService,
public dialog: MatDialog,
- private overlay: Overlay,
- private viewContainerRef: ViewContainerRef,
- private dialogService: DialogService,
- private entityService: EntityService,
- private utils: UtilsService,
- private zone: NgZone,
- private cd: ChangeDetectorRef,
- private elementRef: ElementRef,
private fb: FormBuilder) {
super(store);
}
@@ -131,13 +116,13 @@ export class DeviceInfoTableComponent extends PageComponent implements ControlVa
if (this.useSource) {
this.mappingFormGroup.addControl('deviceNameExpressionSource',
- this.fb.control(SourceTypes.MSG, []));
+ this.fb.control(this.sourceTypes[0], []));
}
if (this.deviceInfoType === DeviceInfoType.FULL) {
if (this.useSource) {
this.mappingFormGroup.addControl('deviceProfileExpressionSource',
- this.fb.control(SourceTypes.MSG, []));
+ this.fb.control(this.sourceTypes[0], []));
}
this.mappingFormGroup.addControl('deviceProfileExpression',
this.fb.control('', this.required ?
@@ -154,6 +139,7 @@ export class DeviceInfoTableComponent extends PageComponent implements ControlVa
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
+ super.ngOnDestroy();
}
registerOnChange(fn: any): void {
@@ -175,5 +161,4 @@ export class DeviceInfoTableComponent extends PageComponent implements ControlVa
updateView(value: any) {
this.propagateChange(value);
}
-
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-data-keys-panel.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-data-keys-panel/mapping-data-keys-panel.component.html
similarity index 71%
rename from ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-data-keys-panel.component.html
rename to ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-data-keys-panel/mapping-data-keys-panel.component.html
index 4c3a6434fd..8b95c0bd3a 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-data-keys-panel.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/gateway/connectors-configuration/mapping-data-keys-panel/mapping-data-keys-panel.component.html
@@ -26,14 +26,15 @@
- {{ keyControl.get('key').value }}
- {{ '-' }}
- {{ valueTitle(keyControl.get('value').value) }}
+
+ {{ keyControl.get('key').value }}{{ '-' }}
+
+ {{ valueTitle(keyControl) }}
-
+