Fixed ActorSystemContext initialization. UI: Fix rulenode missing original icon after copy/paste.
This commit is contained in:
parent
457dfc485b
commit
e9d7561fd8
@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
|
|||||||
import com.google.protobuf.InvalidProtocolBufferException;
|
import com.google.protobuf.InvalidProtocolBufferException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.thingsboard.rule.engine.api.RpcError;
|
import org.thingsboard.rule.engine.api.RpcError;
|
||||||
import org.thingsboard.rule.engine.api.msg.ToDeviceActorNotificationMsg;
|
import org.thingsboard.rule.engine.api.msg.ToDeviceActorNotificationMsg;
|
||||||
@ -67,6 +68,7 @@ public class DefaultDeviceRpcService implements DeviceRpcService {
|
|||||||
private ClusterRpcService rpcService;
|
private ClusterRpcService rpcService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private ActorService actorService;
|
private ActorService actorService;
|
||||||
|
|
||||||
private ScheduledExecutorService rpcCallBackExecutor;
|
private ScheduledExecutorService rpcCallBackExecutor;
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import lombok.Getter;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.thingsboard.rule.engine.api.RpcError;
|
import org.thingsboard.rule.engine.api.RpcError;
|
||||||
import org.thingsboard.server.actors.service.ActorService;
|
import org.thingsboard.server.actors.service.ActorService;
|
||||||
@ -102,6 +103,7 @@ public class DefaultDeviceStateService implements DeviceStateService {
|
|||||||
private AttributesService attributesService;
|
private AttributesService attributesService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Lazy
|
||||||
private ActorService actorService;
|
private ActorService actorService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -225,7 +225,7 @@ sql:
|
|||||||
# Actor system parameters
|
# Actor system parameters
|
||||||
actors:
|
actors:
|
||||||
tenant:
|
tenant:
|
||||||
create_components_on_init: true
|
create_components_on_init: "${ACTORS_TENANT_CREATE_COMPONENTS_ON_INIT:true}"
|
||||||
session:
|
session:
|
||||||
max_concurrent_sessions_per_device: "${ACTORS_MAX_CONCURRENT_SESSION_PER_DEVICE:1}"
|
max_concurrent_sessions_per_device: "${ACTORS_MAX_CONCURRENT_SESSION_PER_DEVICE:1}"
|
||||||
sync:
|
sync:
|
||||||
|
|||||||
@ -214,10 +214,19 @@ function ItemBuffer($q, bufferStore, types, utils, dashboardUtils, ruleChainServ
|
|||||||
var node = ruleNodes.nodes[i];
|
var node = ruleNodes.nodes[i];
|
||||||
var component = ruleChainService.getRuleNodeComponentByClazz(node.componentClazz);
|
var component = ruleChainService.getRuleNodeComponentByClazz(node.componentClazz);
|
||||||
if (component) {
|
if (component) {
|
||||||
|
var icon = types.ruleNodeType[component.type].icon;
|
||||||
|
var iconUrl = null;
|
||||||
|
if (component.configurationDescriptor.nodeDefinition.icon) {
|
||||||
|
icon = component.configurationDescriptor.nodeDefinition.icon;
|
||||||
|
}
|
||||||
|
if (component.configurationDescriptor.nodeDefinition.iconUrl) {
|
||||||
|
iconUrl = component.configurationDescriptor.nodeDefinition.iconUrl;
|
||||||
|
}
|
||||||
delete node.componentClazz;
|
delete node.componentClazz;
|
||||||
node.component = component;
|
node.component = component;
|
||||||
node.nodeClass = types.ruleNodeType[component.type].nodeClass;
|
node.nodeClass = types.ruleNodeType[component.type].nodeClass;
|
||||||
node.icon = types.ruleNodeType[component.type].icon;
|
node.icon = icon;
|
||||||
|
node.iconUrl = iconUrl;
|
||||||
node.connectors = [];
|
node.connectors = [];
|
||||||
node.x = Math.round(node.x + deltaX);
|
node.x = Math.round(node.x + deltaX);
|
||||||
node.y = Math.round(node.y + deltaY);
|
node.y = Math.round(node.y + deltaY);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user