Browse Source

Merge branch 'master' of github.com:thingsboard/thingsboard

pull/1635/head
nordmif 8 years ago
parent
commit
dae156ad94
  1. 2
      application/pom.xml
  2. 5
      application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
  3. 6
      application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java
  4. 2
      application/src/main/java/org/thingsboard/server/service/executors/AbstractListeningExecutor.java
  5. 48
      application/src/main/java/org/thingsboard/server/service/executors/SharedEventLoopGroupService.java
  6. 2
      application/src/main/java/org/thingsboard/server/service/script/AbstractNashornJsInvokeService.java
  7. 6
      application/src/main/resources/thingsboard.yml
  8. 2
      common/data/pom.xml
  9. 2
      common/message/pom.xml
  10. 2
      common/pom.xml
  11. 2
      common/queue/pom.xml
  12. 2
      common/transport/coap/pom.xml
  13. 2
      common/transport/http/pom.xml
  14. 2
      common/transport/mqtt/pom.xml
  15. 2
      common/transport/pom.xml
  16. 2
      common/transport/transport-api/pom.xml
  17. 2
      dao/pom.xml
  18. 3
      docker/tb-js-executor.env
  19. 2
      msa/black-box-tests/pom.xml
  20. 13
      msa/js-executor/api/jsInvokeMessageProcessor.js
  21. 3
      msa/js-executor/config/custom-environment-variables.yml
  22. 3
      msa/js-executor/config/default.yml
  23. 2
      msa/js-executor/package.json
  24. 2
      msa/js-executor/pom.xml
  25. 2
      msa/pom.xml
  26. 2
      msa/tb-node/pom.xml
  27. 2
      msa/tb/pom.xml
  28. 2
      msa/transport/coap/pom.xml
  29. 2
      msa/transport/http/pom.xml
  30. 2
      msa/transport/mqtt/pom.xml
  31. 2
      msa/transport/pom.xml
  32. 2
      msa/web-ui/package.json
  33. 2
      msa/web-ui/pom.xml
  34. 4
      netty-mqtt/pom.xml
  35. 2
      pom.xml
  36. 2
      rule-engine/pom.xml
  37. 2
      rule-engine/rule-engine-api/pom.xml
  38. 4
      rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/TbContext.java
  39. 2
      rule-engine/rule-engine-components/pom.xml
  40. 11
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/TbMqttNode.java
  41. 2
      tools/pom.xml
  42. 2
      transport/coap/pom.xml
  43. 2
      transport/http/pom.xml
  44. 2
      transport/mqtt/pom.xml
  45. 2
      transport/pom.xml
  46. 2
      ui/package-lock.json
  47. 2
      ui/package.json
  48. 2
      ui/pom.xml
  49. 12
      ui/src/app/widget/lib/map-widget2.js

2
application/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>application</artifactId>

5
application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java

@ -67,6 +67,7 @@ import org.thingsboard.server.service.encoding.DataDecodingEncodingService;
import org.thingsboard.server.service.executors.ClusterRpcCallbackExecutorService;
import org.thingsboard.server.service.executors.DbCallbackExecutorService;
import org.thingsboard.server.service.executors.ExternalCallExecutorService;
import org.thingsboard.server.service.executors.SharedEventLoopGroupService;
import org.thingsboard.server.service.mail.MailExecutorService;
import org.thingsboard.server.service.rpc.DeviceRpcService;
import org.thingsboard.server.service.script.JsExecutorService;
@ -206,6 +207,10 @@ public class ActorSystemContext {
@Getter
private ExternalCallExecutorService externalCallExecutorService;
@Autowired
@Getter
private SharedEventLoopGroupService sharedEventLoopGroupService;
@Autowired
@Getter
private MailService mailService;

6
application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java

@ -17,6 +17,7 @@ package org.thingsboard.server.actors.ruleChain;
import akka.actor.ActorRef;
import com.datastax.driver.core.utils.UUIDs;
import io.netty.channel.EventLoopGroup;
import org.springframework.util.StringUtils;
import org.thingsboard.rule.engine.api.ListeningExecutor;
import org.thingsboard.rule.engine.api.MailService;
@ -238,6 +239,11 @@ class DefaultTbContext implements TbContext {
return mainCtx.getRuleChainTransactionService();
}
@Override
public EventLoopGroup getSharedEventLoop() {
return mainCtx.getSharedEventLoopGroupService().getSharedEventLoopGroup();
}
@Override
public MailService getMailService() {
if (mainCtx.isAllowSystemMailService()) {

2
application/src/main/java/org/thingsboard/server/service/executors/AbstractListeningExecutor.java

@ -34,7 +34,7 @@ public abstract class AbstractListeningExecutor implements ListeningExecutor {
@PostConstruct
public void init() {
this.service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(getThreadPollSize()));
this.service = MoreExecutors.listeningDecorator(Executors.newWorkStealingPool(getThreadPollSize()));
}
@PreDestroy

48
application/src/main/java/org/thingsboard/server/service/executors/SharedEventLoopGroupService.java

@ -0,0 +1,48 @@
/**
* Copyright © 2016-2019 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.
*/
package org.thingsboard.server.service.executors;
import com.google.common.util.concurrent.MoreExecutors;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import lombok.Getter;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
@Component
public class SharedEventLoopGroupService {
@Getter
private EventLoopGroup sharedEventLoopGroup;
@PostConstruct
public void init() {
this.sharedEventLoopGroup = new NioEventLoopGroup();
}
@PreDestroy
public void destroy() {
if (this.sharedEventLoopGroup != null) {
this.sharedEventLoopGroup.shutdownGracefully(0, 5, TimeUnit.SECONDS);
}
}
}

2
application/src/main/java/org/thingsboard/server/service/script/AbstractNashornJsInvokeService.java

@ -42,7 +42,7 @@ public abstract class AbstractNashornJsInvokeService extends AbstractJsInvokeSer
public void init() {
if (useJsSandbox()) {
sandbox = NashornSandboxes.create();
monitorExecutorService = Executors.newFixedThreadPool(getMonitorThreadPoolSize());
monitorExecutorService = Executors.newWorkStealingPool(getMonitorThreadPoolSize());
sandbox.setExecutor(monitorExecutorService);
sandbox.setMaxCPUTime(getMaxCpuTime());
sandbox.allowNoBraces(false);

6
application/src/main/resources/thingsboard.yml

@ -200,13 +200,13 @@ actors:
# Specify thread pool size for database request callbacks executor service
db_callback_thread_pool_size: "${ACTORS_RULE_DB_CALLBACK_THREAD_POOL_SIZE:1}"
# Specify thread pool size for javascript executor service
js_thread_pool_size: "${ACTORS_RULE_JS_THREAD_POOL_SIZE:10}"
js_thread_pool_size: "${ACTORS_RULE_JS_THREAD_POOL_SIZE:50}"
# Specify thread pool size for mail sender executor service
mail_thread_pool_size: "${ACTORS_RULE_MAIL_THREAD_POOL_SIZE:10}"
mail_thread_pool_size: "${ACTORS_RULE_MAIL_THREAD_POOL_SIZE:50}"
# Whether to allow usage of system mail service for rules
allow_system_mail_service: "${ACTORS_RULE_ALLOW_SYSTEM_MAIL_SERVICE:true}"
# Specify thread pool size for external call service
external_call_thread_pool_size: "${ACTORS_RULE_EXTERNAL_CALL_THREAD_POOL_SIZE:10}"
external_call_thread_pool_size: "${ACTORS_RULE_EXTERNAL_CALL_THREAD_POOL_SIZE:50}"
chain:
# Errors for particular actor are persisted once per specified amount of milliseconds
error_persist_frequency: "${ACTORS_RULE_CHAIN_ERROR_FREQUENCY:3000}"

2
common/data/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/message/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>common</artifactId>

2
common/queue/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/transport/coap/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/http/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/mqtt/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
common/transport/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>

2
common/transport/transport-api/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.common</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.common.transport</groupId>

2
dao/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>dao</artifactId>

3
docker/tb-js-executor.env

@ -4,4 +4,5 @@ TB_KAFKA_SERVERS=kafka:9092
LOGGER_LEVEL=info
LOG_FOLDER=logs
LOGGER_FILENAME=tb-js-executor-%DATE%.log
DOCKER_MODE=true
DOCKER_MODE=true
SCRIPT_BODY_TRACE_FREQUENCY=1000

2
msa/black-box-tests/pom.xml

@ -21,7 +21,7 @@
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

13
msa/js-executor/api/jsInvokeMessageProcessor.js

@ -15,16 +15,20 @@
*/
'use strict';
const logger = require('../config/logger')('JsInvokeMessageProcessor'),
const config = require('config'),
logger = require('../config/logger')('JsInvokeMessageProcessor'),
Utils = require('./utils'),
js = require('./jsinvoke.proto').js,
KeyedMessage = require('kafka-node').KeyedMessage,
JsExecutor = require('./jsExecutor');
const scriptBodyTraceFrequency = Number(config.get('script.script_body_trace_frequency'));
function JsInvokeMessageProcessor(producer) {
this.producer = producer;
this.executor = new JsExecutor();
this.scriptMap = {};
this.executedScriptsCounter = 0;
}
JsInvokeMessageProcessor.prototype.onJsInvokeMessage = function(message) {
@ -74,6 +78,13 @@ JsInvokeMessageProcessor.prototype.processCompileRequest = function(requestId, r
JsInvokeMessageProcessor.prototype.processInvokeRequest = function(requestId, responseTopic, invokeRequest) {
var scriptId = getScriptId(invokeRequest);
logger.debug('[%s] Processing invoke request, scriptId: [%s]', requestId, scriptId);
this.executedScriptsCounter++;
if ( this.executedScriptsCounter >= scriptBodyTraceFrequency ) {
this.executedScriptsCounter = 0;
if (logger.levels[logger.level] >= logger.levels['debug']) {
logger.debug('[%s] Executing script body: [%s]', scriptId, invokeRequest.scriptBody);
}
}
this.getOrCompileScript(scriptId, invokeRequest.scriptBody).then(
(script) => {
this.executor.executeScript(script, invokeRequest.args, invokeRequest.timeout).then(

3
msa/js-executor/config/custom-environment-variables.yml

@ -23,3 +23,6 @@ logger:
level: "LOGGER_LEVEL"
path: "LOG_FOLDER"
filename: "LOGGER_FILENAME"
script:
script_body_trace_frequency: "SCRIPT_BODY_TRACE_FREQUENCY"

3
msa/js-executor/config/default.yml

@ -24,3 +24,6 @@ logger:
level: "info"
path: "logs"
filename: "tb-js-executor-%DATE%.log"
script:
script_body_trace_frequency: "1000"

2
msa/js-executor/package.json

@ -1,7 +1,7 @@
{
"name": "thingsboard-js-executor",
"private": true,
"version": "2.3.0",
"version": "2.3.1",
"description": "ThingsBoard JavaScript Executor Microservice",
"main": "server.js",
"bin": "server.js",

2
msa/js-executor/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>msa</artifactId>

2
msa/tb-node/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/tb/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/transport/coap/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/http/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/mqtt/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard.msa</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.msa.transport</groupId>

2
msa/transport/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

2
msa/web-ui/package.json

@ -1,7 +1,7 @@
{
"name": "thingsboard-web-ui",
"private": true,
"version": "2.3.0",
"version": "2.3.1",
"description": "ThingsBoard Web UI Microservice",
"main": "server.js",
"bin": "server.js",

2
msa/web-ui/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>

4
netty-mqtt/pom.xml

@ -19,12 +19,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
<artifactId>netty-mqtt</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Netty MQTT Client</name>

2
pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.thingsboard</groupId>
<artifactId>thingsboard</artifactId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Thingsboard</name>

2
rule-engine/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>rule-engine</artifactId>

2
rule-engine/rule-engine-api/pom.xml

@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>rule-engine</artifactId>
</parent>
<groupId>org.thingsboard.rule-engine</groupId>

4
rule-engine/rule-engine-api/src/main/java/org/thingsboard/rule/engine/api/TbContext.java

@ -15,6 +15,7 @@
*/
package org.thingsboard.rule.engine.api;
import io.netty.channel.EventLoopGroup;
import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.RuleNodeId;
import org.thingsboard.server.common.data.id.TenantId;
@ -105,4 +106,7 @@ public interface TbContext {
String getNodeId();
RuleChainTransactionService getRuleChainTransactionService();
EventLoopGroup getSharedEventLoop();
}

2
rule-engine/rule-engine-components/pom.xml

@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>rule-engine</artifactId>
</parent>
<groupId>org.thingsboard.rule-engine</groupId>

11
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/TbMqttNode.java

@ -59,15 +59,13 @@ public class TbMqttNode implements TbNode {
private TbMqttNodeConfiguration config;
private EventLoopGroup eventLoopGroup;
private MqttClient mqttClient;
@Override
public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException {
try {
this.config = TbNodeUtils.convert(configuration, TbMqttNodeConfiguration.class);
this.eventLoopGroup = new NioEventLoopGroup();
this.mqttClient = initClient();
this.mqttClient = initClient(ctx);
} catch (Exception e) {
throw new TbNodeException(e);
}
@ -99,12 +97,9 @@ public class TbMqttNode implements TbNode {
if (this.mqttClient != null) {
this.mqttClient.disconnect();
}
if (this.eventLoopGroup != null) {
this.eventLoopGroup.shutdownGracefully(0, 5, TimeUnit.SECONDS);
}
}
private MqttClient initClient() throws Exception {
private MqttClient initClient(TbContext ctx) throws Exception {
Optional<SslContext> sslContextOpt = initSslContext();
MqttClientConfig config = sslContextOpt.isPresent() ? new MqttClientConfig(sslContextOpt.get()) : new MqttClientConfig();
if (!StringUtils.isEmpty(this.config.getClientId())) {
@ -113,7 +108,7 @@ public class TbMqttNode implements TbNode {
config.setCleanSession(this.config.isCleanSession());
this.config.getCredentials().configure(config);
MqttClient client = MqttClient.create(config, null);
client.setEventLoop(this.eventLoopGroup);
client.setEventLoop(ctx.getSharedEventLoop());
Future<MqttConnectResult> connectFuture = client.connect(this.config.getHost(), this.config.getPort());
MqttConnectResult result;
try {

2
tools/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>tools</artifactId>

2
transport/coap/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/http/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/mqtt/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>

2
transport/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>transport</artifactId>

2
ui/package-lock.json

@ -1,6 +1,6 @@
{
"name": "thingsboard",
"version": "2.3.0",
"version": "2.3.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

2
ui/package.json

@ -1,7 +1,7 @@
{
"name": "thingsboard",
"private": true,
"version": "2.3.0",
"version": "2.3.1",
"description": "ThingsBoard UI",
"licenses": [
{

2
ui/pom.xml

@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
<version>2.3.0</version>
<version>2.3.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>

12
ui/src/app/widget/lib/map-widget2.js

@ -305,12 +305,9 @@ export default class TbMapWidgetV2 {
}
function updateLocationPolygonColor(location, color) {
if (!location.settings.calculatedPolygonColor || location.settings.calculatedPolygonColor !== color) {
if (location.polygon && color) {
location.settings.calculatedPolygonColor = color;
if (location.polygon) {
tbMap.map.updatePolygonColor(location.polygon, location.settings, color);
}
tbMap.map.updatePolygonColor(location.polygon, location.settings, color);
}
}
@ -338,10 +335,8 @@ export default class TbMapWidgetV2 {
function updateLocationStyle(location, dataMap) {
updateLocationLabel(location, dataMap);
var color = calculateLocationColor(location, dataMap);
var polygonColor = calculateLocationPolygonColor(location, dataMap);
var image = calculateLocationMarkerImage(location, dataMap);
updateLocationColor(location, color, image);
if (location.settings.usePolygonColorFunction) updateLocationPolygonColor(location, polygonColor);
updateLocationMarkerIcon(location, image);
}
@ -441,6 +436,7 @@ export default class TbMapWidgetV2 {
if (location.marker) {
updateLocationStyle(location, dataMap);
}
}
}
return locationChanged;
@ -456,11 +452,13 @@ export default class TbMapWidgetV2 {
locationPolygonClick(event, location);
}, [location.dsIndex]);
tbMap.polygons.push(location.polygon);
if (location.settings.usePolygonColorFunction) updateLocationPolygonColor(location, calculateLocationPolygonColor(location, dataMap));
} else if (polygonLatLngs.length > 0) {
let prevPolygonArr = tbMap.map.getPolygonLatLngs(location.polygon);
if (!prevPolygonArr || !arraysEqual(prevPolygonArr, polygonLatLngs)) {
tbMap.map.setPolygonLatLngs(location.polygon, polygonLatLngs);
}
if (location.settings.usePolygonColorFunction) updateLocationPolygonColor(location, calculateLocationPolygonColor(location, dataMap));
}
}
}

Loading…
Cancel
Save