Merged changes
This commit is contained in:
commit
8f54146cb8
File diff suppressed because one or more lines are too long
@ -469,6 +469,7 @@ transport:
|
|||||||
boss_group_thread_count: "${NETTY_BOSS_GROUP_THREADS:1}"
|
boss_group_thread_count: "${NETTY_BOSS_GROUP_THREADS:1}"
|
||||||
worker_group_thread_count: "${NETTY_WORKER_GROUP_THREADS:12}"
|
worker_group_thread_count: "${NETTY_WORKER_GROUP_THREADS:12}"
|
||||||
max_payload_size: "${NETTY_MAX_PAYLOAD_SIZE:65536}"
|
max_payload_size: "${NETTY_MAX_PAYLOAD_SIZE:65536}"
|
||||||
|
so_keep_alive: "${NETTY_SO_KEEPALIVE:true}"
|
||||||
# MQTT SSL configuration
|
# MQTT SSL configuration
|
||||||
ssl:
|
ssl:
|
||||||
# Enable/disable SSL support
|
# Enable/disable SSL support
|
||||||
|
|||||||
@ -17,6 +17,7 @@ package org.thingsboard.server.transport.mqtt;
|
|||||||
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
import io.netty.channel.ChannelOption;
|
||||||
import io.netty.channel.EventLoopGroup;
|
import io.netty.channel.EventLoopGroup;
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||||
@ -50,6 +51,8 @@ public class MqttTransportService {
|
|||||||
private Integer bossGroupThreadCount;
|
private Integer bossGroupThreadCount;
|
||||||
@Value("${transport.mqtt.netty.worker_group_thread_count}")
|
@Value("${transport.mqtt.netty.worker_group_thread_count}")
|
||||||
private Integer workerGroupThreadCount;
|
private Integer workerGroupThreadCount;
|
||||||
|
@Value("${transport.mqtt.netty.so_keep_alive}")
|
||||||
|
private boolean keepAlive;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MqttTransportContext context;
|
private MqttTransportContext context;
|
||||||
@ -69,7 +72,8 @@ public class MqttTransportService {
|
|||||||
ServerBootstrap b = new ServerBootstrap();
|
ServerBootstrap b = new ServerBootstrap();
|
||||||
b.group(bossGroup, workerGroup)
|
b.group(bossGroup, workerGroup)
|
||||||
.channel(NioServerSocketChannel.class)
|
.channel(NioServerSocketChannel.class)
|
||||||
.childHandler(new MqttTransportServerInitializer(context));
|
.childHandler(new MqttTransportServerInitializer(context))
|
||||||
|
.childOption(ChannelOption.SO_KEEPALIVE, keepAlive);
|
||||||
|
|
||||||
serverChannel = b.bind(host, port).sync().channel();
|
serverChannel = b.bind(host, port).sync().channel();
|
||||||
log.info("Mqtt transport started!");
|
log.info("Mqtt transport started!");
|
||||||
|
|||||||
@ -89,10 +89,12 @@ export default class TbMapWidgetV2 {
|
|||||||
openStreetMapProvider.name = settings.mapProvider;
|
openStreetMapProvider.name = settings.mapProvider;
|
||||||
}
|
}
|
||||||
this.map = new TbOpenStreetMap($element, this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, settings.disableScrollZooming, minZoomLevel, openStreetMapProvider);
|
this.map = new TbOpenStreetMap($element, this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, settings.disableScrollZooming, minZoomLevel, openStreetMapProvider);
|
||||||
|
} else if (mapProvider === 'here') {
|
||||||
|
this.map = new TbOpenStreetMap($element, this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, settings.disableScrollZooming, minZoomLevel, settings.mapProvider, settings.credentials);
|
||||||
} else if (mapProvider === 'image-map') {
|
} else if (mapProvider === 'image-map') {
|
||||||
this.map = new TbImageMap(this.ctx, $element, this.utils, initCallback,
|
this.map = new TbImageMap(this.ctx, $element, this.utils, initCallback,
|
||||||
settings.mapImageUrl,
|
settings.mapImageUrl,
|
||||||
settings.disableScrollZooming,
|
settings.disableScrollZooming,
|
||||||
settings.posFunction,
|
settings.posFunction,
|
||||||
settings.imageEntityAlias,
|
settings.imageEntityAlias,
|
||||||
settings.imageUrlAttribute);
|
settings.imageUrlAttribute);
|
||||||
@ -671,6 +673,8 @@ export default class TbMapWidgetV2 {
|
|||||||
return imageMapSettingsSchema;
|
return imageMapSettingsSchema;
|
||||||
} else if (mapProvider === 'tencent-map') {
|
} else if (mapProvider === 'tencent-map') {
|
||||||
schema = angular.copy(tencentMapSettingsSchema);
|
schema = angular.copy(tencentMapSettingsSchema);
|
||||||
|
} else if (mapProvider === 'here') {
|
||||||
|
schema = angular.copy(hereMapSettingsSchema);
|
||||||
}
|
}
|
||||||
angular.merge(schema.schema.properties, commonMapSettingsSchema.schema.properties);
|
angular.merge(schema.schema.properties, commonMapSettingsSchema.schema.properties);
|
||||||
schema.schema.required = schema.schema.required.concat(commonMapSettingsSchema.schema.required);
|
schema.schema.required = schema.schema.required.concat(commonMapSettingsSchema.schema.required);
|
||||||
@ -798,6 +802,62 @@ const tencentMapSettingsSchema =
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const hereMapSettingsSchema =
|
||||||
|
{
|
||||||
|
"schema": {
|
||||||
|
"title": "HERE Map Configuration",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"mapProvider": {
|
||||||
|
"title": "Map layer",
|
||||||
|
"type": "string",
|
||||||
|
"default": "HERE.normalDay"
|
||||||
|
},
|
||||||
|
"credentials":{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"app_id": {
|
||||||
|
"title": "HERE app id",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"app_code": {
|
||||||
|
"title": "HERE app code",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["app_id", "app_code"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": []
|
||||||
|
},
|
||||||
|
"form": [
|
||||||
|
{
|
||||||
|
"key": "mapProvider",
|
||||||
|
"type": "rc-select",
|
||||||
|
"multiple": false,
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"value": "HERE.normalDay",
|
||||||
|
"label": "HERE.normalDay (Default)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "HERE.normalNight",
|
||||||
|
"label": "HERE.normalNight"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "HERE.hybridDay",
|
||||||
|
"label": "HERE.hybridDay"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "HERE.terrainDay",
|
||||||
|
"label": "HERE.terrainDay"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"credentials"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
const openstreetMapSettingsSchema =
|
const openstreetMapSettingsSchema =
|
||||||
{
|
{
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import 'leaflet-providers';
|
|||||||
|
|
||||||
export default class TbOpenStreetMap {
|
export default class TbOpenStreetMap {
|
||||||
|
|
||||||
constructor($containerElement, utils, initCallback, defaultZoomLevel, dontFitMapBounds, disableScrollZooming, minZoomLevel, mapProvider) {
|
constructor($containerElement, utils, initCallback, defaultZoomLevel, dontFitMapBounds, disableScrollZooming, minZoomLevel, mapProvider, credentials) {
|
||||||
|
|
||||||
this.utils = utils;
|
this.utils = utils;
|
||||||
this.defaultZoomLevel = defaultZoomLevel;
|
this.defaultZoomLevel = defaultZoomLevel;
|
||||||
@ -29,18 +29,22 @@ export default class TbOpenStreetMap {
|
|||||||
|
|
||||||
if (!mapProvider) {
|
if (!mapProvider) {
|
||||||
mapProvider = {
|
mapProvider = {
|
||||||
name: "OpenStreetMap.Mapnik"
|
name: "OpenStreetMap.Mapnik"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
this.map = L.map($containerElement[0]).setView([0, 0], this.defaultZoomLevel || 8);
|
if (mapProvider.startsWith("HERE.")) {
|
||||||
|
credentials.app_id = credentials.app_id || "AhM6TzD9ThyK78CT3ptx";
|
||||||
|
credentials.app_code = credentials.app_code || "p6NPiITB3Vv0GMUFnkLOOg";
|
||||||
|
}
|
||||||
|
|
||||||
if (disableScrollZooming) {
|
if (disableScrollZooming) {
|
||||||
this.map.scrollWheelZoom.disable();
|
this.map.scrollWheelZoom.disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
var tileLayer = mapProvider.isCustom ? L.tileLayer(mapProvider.name) : L.tileLayer.provider(mapProvider.name);
|
this.map = L.map($containerElement[0]).setView([0, 0], this.defaultZoomLevel || 8);
|
||||||
|
|
||||||
|
var tileLayer = mapProvider.isCustom ? L.tileLayer(mapProvider.name) : L.tileLayer.provider(mapProvider.name, credentials);
|
||||||
tileLayer.addTo(this.map);
|
tileLayer.addTo(this.map);
|
||||||
|
|
||||||
if (initCallback) {
|
if (initCallback) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user