Browse Source

fixes

pull/8337/head
Maksym Dudnik 3 years ago
parent
commit
09062adf39
  1. 10
      ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts

10
ui-ngx/src/app/shared/components/device/gateway-connectors.component.ts

@ -133,6 +133,7 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
log_level: ['', [Validators.required]], log_level: ['', [Validators.required]],
key: ['auto'], key: ['auto'],
class: [''], class: [''],
configuration: [''],
configurationJson: [{}, [Validators.required]] configurationJson: [{}, [Validators.required]]
}) })
@ -155,7 +156,7 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
this.viewsInited = true; this.viewsInited = true;
if (this.device) { if (this.device) {
forkJoin(this.attributeService.getEntityAttributes(this.device, AttributeScope.SHARED_SCOPE, ['active_connectors']), forkJoin(this.attributeService.getEntityAttributes(this.device, AttributeScope.CLIENT_SCOPE, ['active_connectors']),
this.attributeService.getEntityAttributes(this.device, AttributeScope.SERVER_SCOPE, ['inactive_connectors'])).subscribe(attributes => { this.attributeService.getEntityAttributes(this.device, AttributeScope.SERVER_SCOPE, ['inactive_connectors'])).subscribe(attributes => {
if (attributes.length) { if (attributes.length) {
this.activeConnectors = attributes[0].length ? attributes[0][0].value : []; this.activeConnectors = attributes[0].length ? attributes[0][0].value : [];
@ -251,6 +252,7 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
log_level: GatewayLogLevel.info, log_level: GatewayLogLevel.info,
key: 'auto', key: 'auto',
class: '', class: '',
configuration: '',
configurationJson: {} configurationJson: {}
}) })
this.initialConnector = null; this.initialConnector = null;
@ -262,9 +264,9 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
this.connectorForm.enable(); this.connectorForm.enable();
} }
const connector = attribute.value; const connector = attribute.value;
if (connector.configuration) { // if (connector.configuration) {
delete connector.configuration; // delete connector.configuration;
} // }
if (!connector.key) { if (!connector.key) {
connector.key = 'auto'; connector.key = 'auto';
} }

Loading…
Cancel
Save