Commit e9d7561fd87717e01edcf35fdbe5eaeabaad649f

Authored by Igor Kulikov
1 parent 457dfc48

Fixed ActorSystemContext initialization. UI: Fix rulenode missing original icon after copy/paste.

... ... @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
22 22 import com.google.protobuf.InvalidProtocolBufferException;
23 23 import lombok.extern.slf4j.Slf4j;
24 24 import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.context.annotation.Lazy;
25 26 import org.springframework.stereotype.Service;
26 27 import org.thingsboard.rule.engine.api.RpcError;
27 28 import org.thingsboard.rule.engine.api.msg.ToDeviceActorNotificationMsg;
... ... @@ -67,6 +68,7 @@ public class DefaultDeviceRpcService implements DeviceRpcService {
67 68 private ClusterRpcService rpcService;
68 69
69 70 @Autowired
  71 + @Lazy
70 72 private ActorService actorService;
71 73
72 74 private ScheduledExecutorService rpcCallBackExecutor;
... ...
... ... @@ -28,6 +28,7 @@ import lombok.Getter;
28 28 import lombok.extern.slf4j.Slf4j;
29 29 import org.springframework.beans.factory.annotation.Autowired;
30 30 import org.springframework.beans.factory.annotation.Value;
  31 +import org.springframework.context.annotation.Lazy;
31 32 import org.springframework.stereotype.Service;
32 33 import org.thingsboard.rule.engine.api.RpcError;
33 34 import org.thingsboard.server.actors.service.ActorService;
... ... @@ -102,6 +103,7 @@ public class DefaultDeviceStateService implements DeviceStateService {
102 103 private AttributesService attributesService;
103 104
104 105 @Autowired
  106 + @Lazy
105 107 private ActorService actorService;
106 108
107 109 @Autowired
... ...
... ... @@ -225,7 +225,7 @@ sql:
225 225 # Actor system parameters
226 226 actors:
227 227 tenant:
228   - create_components_on_init: true
  228 + create_components_on_init: "${ACTORS_TENANT_CREATE_COMPONENTS_ON_INIT:true}"
229 229 session:
230 230 max_concurrent_sessions_per_device: "${ACTORS_MAX_CONCURRENT_SESSION_PER_DEVICE:1}"
231 231 sync:
... ...
... ... @@ -214,10 +214,19 @@ function ItemBuffer($q, bufferStore, types, utils, dashboardUtils, ruleChainServ
214 214 var node = ruleNodes.nodes[i];
215 215 var component = ruleChainService.getRuleNodeComponentByClazz(node.componentClazz);
216 216 if (component) {
  217 + var icon = types.ruleNodeType[component.type].icon;
  218 + var iconUrl = null;
  219 + if (component.configurationDescriptor.nodeDefinition.icon) {
  220 + icon = component.configurationDescriptor.nodeDefinition.icon;
  221 + }
  222 + if (component.configurationDescriptor.nodeDefinition.iconUrl) {
  223 + iconUrl = component.configurationDescriptor.nodeDefinition.iconUrl;
  224 + }
217 225 delete node.componentClazz;
218 226 node.component = component;
219 227 node.nodeClass = types.ruleNodeType[component.type].nodeClass;
220   - node.icon = types.ruleNodeType[component.type].icon;
  228 + node.icon = icon;
  229 + node.iconUrl = iconUrl;
221 230 node.connectors = [];
222 231 node.x = Math.round(node.x + deltaX);
223 232 node.y = Math.round(node.y + deltaY);
... ...