Merge branch 'master' of github.com:thingsboard/thingsboard
This commit is contained in:
commit
547d9bdbd7
@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
import org.thingsboard.server.common.data.Device;
|
import org.thingsboard.server.common.data.Device;
|
||||||
import org.thingsboard.server.common.data.id.DeviceId;
|
import org.thingsboard.server.common.data.id.DeviceId;
|
||||||
import org.thingsboard.server.common.data.id.TenantId;
|
import org.thingsboard.server.common.data.id.TenantId;
|
||||||
@ -142,8 +143,13 @@ public class LocalTransportApiService implements TransportApiService {
|
|||||||
return getEmptyTransportApiResponse();
|
return getEmptyTransportApiResponse();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
ValidateDeviceCredentialsResponseMsg.Builder builder = ValidateDeviceCredentialsResponseMsg.newBuilder();
|
||||||
|
builder.setDeviceInfo(getDeviceInfoProto(device));
|
||||||
|
if(!StringUtils.isEmpty(credentials.getCredentialsValue())){
|
||||||
|
builder.setCredentialsBody(credentials.getCredentialsValue());
|
||||||
|
}
|
||||||
return TransportApiResponseMsg.newBuilder()
|
return TransportApiResponseMsg.newBuilder()
|
||||||
.setValidateTokenResponseMsg(ValidateDeviceCredentialsResponseMsg.newBuilder().setDeviceInfo(getDeviceInfoProto(device)).setCredentialsBody(credentials.getCredentialsValue()).build()).build();
|
.setValidateTokenResponseMsg(builder.build()).build();
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
log.warn("[{}] Failed to lookup device by id", deviceId, e);
|
log.warn("[{}] Failed to lookup device by id", deviceId, e);
|
||||||
return getEmptyTransportApiResponse();
|
return getEmptyTransportApiResponse();
|
||||||
|
|||||||
@ -40,7 +40,7 @@ public abstract class AbstractTransportService implements TransportService {
|
|||||||
private boolean rateLimitEnabled;
|
private boolean rateLimitEnabled;
|
||||||
@Value("${transport.rate_limits.tenant}")
|
@Value("${transport.rate_limits.tenant}")
|
||||||
private String perTenantLimitsConf;
|
private String perTenantLimitsConf;
|
||||||
@Value("${transport.rate_limits.tenant}")
|
@Value("${transport.rate_limits.device}")
|
||||||
private String perDevicesLimitsConf;
|
private String perDevicesLimitsConf;
|
||||||
@Value("${transport.sessions.inactivity_timeout}")
|
@Value("${transport.sessions.inactivity_timeout}")
|
||||||
private long sessionInactivityTimeout;
|
private long sessionInactivityTimeout;
|
||||||
|
|||||||
@ -59,6 +59,7 @@ import static org.thingsboard.server.common.data.kv.Aggregation.NONE;
|
|||||||
nodeDescription = "Add Message Originator Telemetry for selected time range into Message Metadata\n",
|
nodeDescription = "Add Message Originator Telemetry for selected time range into Message Metadata\n",
|
||||||
nodeDetails = "The node allows you to select fetch mode <b>FIRST/LAST/ALL</b> to fetch telemetry of certain time range that are added into Message metadata without any prefix. " +
|
nodeDetails = "The node allows you to select fetch mode <b>FIRST/LAST/ALL</b> to fetch telemetry of certain time range that are added into Message metadata without any prefix. " +
|
||||||
"If selected fetch mode <b>ALL</b> Telemetry will be added like array into Message Metadata where <b>key</b> is Timestamp and <b>value</b> is value of Telemetry. " +
|
"If selected fetch mode <b>ALL</b> Telemetry will be added like array into Message Metadata where <b>key</b> is Timestamp and <b>value</b> is value of Telemetry. " +
|
||||||
|
"<b>Note</b>: The maximum size of the fetched array is 1000 records. " +
|
||||||
"If selected fetch mode <b>FIRST</b> or <b>LAST</b> Telemetry will be added like string without Timestamp",
|
"If selected fetch mode <b>FIRST</b> or <b>LAST</b> Telemetry will be added like string without Timestamp",
|
||||||
uiResources = {"static/rulenode/rulenode-core-config.js"},
|
uiResources = {"static/rulenode/rulenode-core-config.js"},
|
||||||
configDirective = "tbEnrichmentNodeGetTelemetryFromDatabase")
|
configDirective = "tbEnrichmentNodeGetTelemetryFromDatabase")
|
||||||
@ -87,7 +88,9 @@ public class TbGetTelemetryNode implements TbNode {
|
|||||||
ctx.tellFailure(msg, new IllegalStateException("Telemetry is not selected!"));
|
ctx.tellFailure(msg, new IllegalStateException("Telemetry is not selected!"));
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
if (config.isUseMetadataIntervalPatterns()) {
|
||||||
checkMetadataKeyPatterns(msg);
|
checkMetadataKeyPatterns(msg);
|
||||||
|
}
|
||||||
ListenableFuture<List<TsKvEntry>> list = ctx.getTimeseriesService().findAll(ctx.getTenantId(), msg.getOriginator(), buildQueries(msg));
|
ListenableFuture<List<TsKvEntry>> list = ctx.getTimeseriesService().findAll(ctx.getTenantId(), msg.getOriginator(), buildQueries(msg));
|
||||||
DonAsynchron.withCallback(list, data -> {
|
DonAsynchron.withCallback(list, data -> {
|
||||||
process(data, msg);
|
process(data, msg);
|
||||||
|
|||||||
@ -648,6 +648,12 @@ export default class Subscription {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataUpdated(sourceData, datasourceIndex, dataKeyIndex, apply) {
|
dataUpdated(sourceData, datasourceIndex, dataKeyIndex, apply) {
|
||||||
|
for (var x = 0; x < this.datasourceListeners.length; x++) {
|
||||||
|
this.datasources[x].dataReceived = this.datasources[x].dataReceived === true;
|
||||||
|
if (this.datasourceListeners[x].datasourceIndex === datasourceIndex && sourceData.data.length > 0) {
|
||||||
|
this.datasources[x].dataReceived = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.notifyDataLoaded();
|
this.notifyDataLoaded();
|
||||||
var update = true;
|
var update = true;
|
||||||
var currentData;
|
var currentData;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -60,6 +60,9 @@ export default class TbMapWidgetV2 {
|
|||||||
|
|
||||||
var minZoomLevel = this.drawRoutes ? 18 : 15;
|
var minZoomLevel = this.drawRoutes ? 18 : 15;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var initCallback = function() {
|
var initCallback = function() {
|
||||||
tbMap.update();
|
tbMap.update();
|
||||||
tbMap.resize();
|
tbMap.resize();
|
||||||
@ -87,6 +90,9 @@ export default class TbMapWidgetV2 {
|
|||||||
} else if (mapProvider === 'tencent-map') {
|
} else if (mapProvider === 'tencent-map') {
|
||||||
this.map = new TbTencentMap($element,this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, minZoomLevel, settings.tmApiKey, settings.tmDefaultMapType);
|
this.map = new TbTencentMap($element,this.utils, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, minZoomLevel, settings.tmApiKey, settings.tmDefaultMapType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tbMap.initBounds = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setCallbacks(callbacks) {
|
setCallbacks(callbacks) {
|
||||||
@ -442,6 +448,7 @@ export default class TbMapWidgetV2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateLocations(data, datasources) {
|
function updateLocations(data, datasources) {
|
||||||
|
|
||||||
var locationsChanged = false;
|
var locationsChanged = false;
|
||||||
var bounds = tbMap.map.createBounds();
|
var bounds = tbMap.map.createBounds();
|
||||||
var dataMap = toLabelValueMap(data, datasources);
|
var dataMap = toLabelValueMap(data, datasources);
|
||||||
@ -454,7 +461,11 @@ export default class TbMapWidgetV2 {
|
|||||||
tbMap.map.extendBoundsWithMarker(bounds, location.marker);
|
tbMap.map.extendBoundsWithMarker(bounds, location.marker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (locationsChanged) {
|
if (locationsChanged && tbMap.initBounds) {
|
||||||
|
tbMap.initBounds = !datasources.every(
|
||||||
|
function (ds) {
|
||||||
|
return ds.dataReceived === true;
|
||||||
|
});
|
||||||
tbMap.map.fitBounds(bounds);
|
tbMap.map.fitBounds(bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -477,7 +488,6 @@ export default class TbMapWidgetV2 {
|
|||||||
content = fillPattern(settings.tooltipPattern, settings.tooltipReplaceInfo, data);
|
content = fillPattern(settings.tooltipPattern, settings.tooltipReplaceInfo, data);
|
||||||
return fillPatternWithActions(content, 'onTooltipAction', tooltip.markerArgs);
|
return fillPatternWithActions(content, 'onTooltipAction', tooltip.markerArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.map && this.map.inited() && this.subscription) {
|
if (this.map && this.map.inited() && this.subscription) {
|
||||||
if (this.subscription.data) {
|
if (this.subscription.data) {
|
||||||
if (!this.locations) {
|
if (!this.locations) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user