Browse Source

Merge branch 'master' of https://github.com/thingsboard/thingsboard into feature/batch-telemetry

pull/2253/head
YevhenBondarenko 7 years ago
parent
commit
9a7f33a2e3
  1. 2
      application/src/main/data/json/system/widget_bundles/cards.json
  2. 2
      application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java
  3. 2
      common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportContext.java
  4. 33
      common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/RemoteTransportService.java
  5. 36
      tools/src/main/java/org/thingsboard/client/tools/RestClient.java
  6. 2
      ui/src/app/common/utils.service.js
  7. 3
      ui/src/app/locale/locale.constant-cs_CZ.json
  8. 3
      ui/src/app/locale/locale.constant-de_DE.json
  9. 2606
      ui/src/app/locale/locale.constant-el_GR.json
  10. 3
      ui/src/app/locale/locale.constant-en_US.json
  11. 3
      ui/src/app/locale/locale.constant-es_ES.json
  12. 3
      ui/src/app/locale/locale.constant-fr_FR.json
  13. 3
      ui/src/app/locale/locale.constant-it_IT.json
  14. 3
      ui/src/app/locale/locale.constant-ru_RU.json
  15. 3
      ui/src/app/locale/locale.constant-tr_TR.json
  16. 3
      ui/src/app/locale/locale.constant-uk_UA.json

2
application/src/main/data/json/system/widget_bundles/cards.json

File diff suppressed because one or more lines are too long

2
application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java

@ -84,7 +84,7 @@ public class ThingsboardMessageConfiguration {
}
@Slf4j
static class SpringResourceLoader extends org.apache.velocity.runtime.resource.loader.ResourceLoader {
public static class SpringResourceLoader extends org.apache.velocity.runtime.resource.loader.ResourceLoader {
public static final String NAME = "spring";

2
common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportContext.java

@ -47,7 +47,7 @@ public class TransportContext {
@PostConstruct
public void init() {
executor = Executors.newCachedThreadPool();
executor = Executors.newWorkStealingPool(50);
}
@PreDestroy

33
common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/RemoteTransportService.java

@ -320,28 +320,19 @@ public class RemoteTransportService extends AbstractTransportService {
send(sessionInfo, toRuleEngineMsg, callback);
}
private static class TransportCallbackAdaptor implements Callback {
private final TransportServiceCallback<Void> callback;
TransportCallbackAdaptor(TransportServiceCallback<Void> callback) {
this.callback = callback;
}
@Override
public void onCompletion(RecordMetadata metadata, Exception exception) {
if (exception == null) {
if (callback != null) {
callback.onSuccess(null);
}
} else {
if (callback != null) {
callback.onError(exception);
private void send(SessionInfoProto sessionInfo, ToRuleEngineMsg toRuleEngineMsg, TransportServiceCallback<Void> callback) {
ruleEngineProducer.send(getRoutingKey(sessionInfo), toRuleEngineMsg, (metadata, exception) -> {
if (callback != null) {
if (exception == null) {
this.transportCallbackExecutor.submit(() -> {
callback.onSuccess(null);
});
} else {
this.transportCallbackExecutor.submit(() -> {
callback.onError(exception);
});
}
}
}
}
private void send(SessionInfoProto sessionInfo, ToRuleEngineMsg toRuleEngineMsg, TransportServiceCallback<Void> callback) {
ruleEngineProducer.send(getRoutingKey(sessionInfo), toRuleEngineMsg, new TransportCallbackAdaptor(callback));
});
}
}

36
tools/src/main/java/org/thingsboard/client/tools/RestClient.java

@ -547,7 +547,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
addPageLinkToParam(params, pageLink);
ResponseEntity<TextPageData<Asset>> assets = restTemplate.exchange(
baseURL + "/tenant/assets?type={type}&" + getUrlParams(pageLink),
baseURL + "/api/tenant/assets?type={type}&" + getUrlParams(pageLink),
HttpMethod.GET, HttpEntity.EMPTY,
new ParameterizedTypeReference<TextPageData<Asset>>() {
},
@ -1470,7 +1470,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> handleOneWayDeviceRPCRequest(String deviceId, String requestBody) {
return restTemplate.exchange(
baseURL + "/oneway/{deviceId}",
baseURL + "/api/plugins/rpc/oneway/{deviceId}",
HttpMethod.POST,
new HttpEntity<>(requestBody),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1480,7 +1480,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> handleTwoWayDeviceRPCRequest(String deviceId, String requestBody) {
return restTemplate.exchange(
baseURL + "/twoway/{deviceId}",
baseURL + "/api/plugins/rpc/twoway/{deviceId}",
HttpMethod.POST,
new HttpEntity<>(requestBody),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1579,7 +1579,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> getAttributeKeys(String entityType, String entityId) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/keys/attributes",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/keys/attributes",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1590,7 +1590,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> getAttributeKeysByScope(String entityType, String entityId, String scope) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/keys/attributes/{scope}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/keys/attributes/{scope}",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1602,7 +1602,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> getAttributesResponseEntity(String entityType, String entityId, String keys) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/values/attributes?keys={keys}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/values/attributes?keys={keys}",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1614,7 +1614,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> getAttributesByScope(String entityType, String entityId, String scope, String keys) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/values/attributes/{scope}?keys={keys}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/values/attributes/{scope}?keys={keys}",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1627,7 +1627,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> getTimeseriesKeys(String entityType, String entityId) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/keys/timeseries",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/keys/timeseries",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1638,7 +1638,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> getLatestTimeseries(String entityType, String entityId, String keys) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/values/timeseries?keys={keys}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries?keys={keys}",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1661,7 +1661,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
params.put("agg", agg == null ? "NONE" : agg);
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/values/timeseries?keys={keys}&startTs={startTs}&endTs={endTs}&interval={interval}&limit={limit}&agg={agg}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries?keys={keys}&startTs={startTs}&endTs={endTs}&interval={interval}&limit={limit}&agg={agg}",
HttpMethod.GET,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1671,7 +1671,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> saveDeviceAttributes(String deviceId, String scope, JsonNode request) {
return restTemplate.exchange(
baseURL + "/{deviceId}/{scope}",
baseURL + "/api/plugins/telemetry/{deviceId}/{scope}",
HttpMethod.POST,
new HttpEntity<>(request),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1682,7 +1682,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> saveEntityAttributesV1(String entityType, String entityId, String scope, JsonNode request) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/{scope}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/{scope}",
HttpMethod.POST,
new HttpEntity<>(request),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1694,7 +1694,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> saveEntityAttributesV2(String entityType, String entityId, String scope, JsonNode request) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/attributes/{scope}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/attributes/{scope}",
HttpMethod.POST,
new HttpEntity<>(request),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1706,7 +1706,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> saveEntityTelemetry(String entityType, String entityId, String scope, String requestBody) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/timeseries/{scope}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/timeseries/{scope}",
HttpMethod.POST,
new HttpEntity<>(requestBody),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1718,7 +1718,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> saveEntityTelemetryWithTTL(String entityType, String entityId, String scope, Long ttl, String requestBody) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/timeseries/{scope}/{ttl}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/timeseries/{scope}/{ttl}",
HttpMethod.POST,
new HttpEntity<>(requestBody),
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1746,7 +1746,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
params.put("rewriteLatestIfDeleted", String.valueOf(rewriteLatestIfDeleted));
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/timeseries/delete?keys={keys}&deleteAllDataForKeys={deleteAllDataForKeys}&startTs={startTs}&endTs={endTs}&rewriteLatestIfDeleted={rewriteLatestIfDeleted}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/timeseries/delete?keys={keys}&deleteAllDataForKeys={deleteAllDataForKeys}&startTs={startTs}&endTs={endTs}&rewriteLatestIfDeleted={rewriteLatestIfDeleted}",
HttpMethod.DELETE,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1756,7 +1756,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> deleteEntityAttributes(String deviceId, String scope, String keys) {
return restTemplate.exchange(
baseURL + "/{deviceId}/{scope}?keys={keys}",
baseURL + "/api/plugins/telemetry/{deviceId}/{scope}?keys={keys}",
HttpMethod.DELETE,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {
@ -1768,7 +1768,7 @@ public class RestClient implements ClientHttpRequestInterceptor {
public DeferredResult<ResponseEntity> deleteEntityAttributes(String entityType, String entityId, String scope, String keys) {
return restTemplate.exchange(
baseURL + "/{entityType}/{entityId}/{scope}?keys={keys}",
baseURL + "/api/plugins/telemetry/{entityType}/{entityId}/{scope}?keys={keys}",
HttpMethod.DELETE,
HttpEntity.EMPTY,
new ParameterizedTypeReference<DeferredResult<ResponseEntity>>() {

2
ui/src/app/common/utils.service.js

@ -522,7 +522,7 @@ function Utils($mdColorPalette, $rootScope, $window, $translate, $q, $timeout, t
} else if (variableName === 'deviceName') {
label = label.split(variable).join(datasource.entityName);
} else if (variableName === 'entityLabel') {
label = label.split(variable).join(datasource.entityLabel);
label = label.split(variable).join(datasource.entityLabel || datasource.entityName);
} else if (variableName === 'aliasName') {
label = label.split(variable).join(datasource.aliasName);
} else if (variableName === 'entityDescription') {

3
ui/src/app/locale/locale.constant-cs_CZ.json

@ -1651,7 +1651,8 @@
"tr_TR": "Turkish",
"fa_IR": "Persian",
"uk_UA": "Ukrainian",
"cs_CZ": "Česky"
"cs_CZ": "Česky",
"el_GR": "Řečtina"
}
}
}

3
ui/src/app/locale/locale.constant-de_DE.json

@ -1699,7 +1699,8 @@
"tr_TR": "Türkisch",
"fa_IR": "Persisch",
"uk_UA": "Ukrainisch",
"cs_CZ": "Tschechisch"
"cs_CZ": "Tschechisch",
"el_GR": "Griechisch"
}
}
}

2606
ui/src/app/locale/locale.constant-el_GR.json

File diff suppressed because it is too large

3
ui/src/app/locale/locale.constant-en_US.json

@ -1780,7 +1780,8 @@
"tr_TR": "Turkish",
"fa_IR": "Persian",
"uk_UA": "Ukrainian",
"cs_CZ": "Czech"
"cs_CZ": "Czech",
"el_GR": "Greek"
}
}
}

3
ui/src/app/locale/locale.constant-es_ES.json

@ -1757,7 +1757,8 @@
"tr_TR": "Turco",
"fa_IR": "Persa",
"uk_UA": "Ucraniano",
"cs_CZ": "Checo"
"cs_CZ": "Checo",
"el_GR": "Griego"
}
}
}

3
ui/src/app/locale/locale.constant-fr_FR.json

@ -1167,7 +1167,8 @@
"tr_TR": "Turc",
"fa_IR": "Persane",
"uk_UA": "Ukrainien",
"cs_CZ": "Tchèque"
"cs_CZ": "Tchèque",
"el_GR": "Grec"
}
},
"layout": {

3
ui/src/app/locale/locale.constant-it_IT.json

@ -1714,7 +1714,8 @@
"tr_TR": "Turco",
"fa_IR": "Persiana",
"uk_UA": "Ucraino",
"cs_CZ": "Ceco"
"cs_CZ": "Ceco",
"el_GR": "Greco"
}
}
}

3
ui/src/app/locale/locale.constant-ru_RU.json

@ -1776,7 +1776,8 @@
"ja_JA": "Японский",
"fa_IR": "Персидский",
"uk_UA": "Украинский",
"cs_CZ": "Чешский"
"cs_CZ": "Чешский",
"el_GR": "Греческий"
}
}
}

3
ui/src/app/locale/locale.constant-tr_TR.json

@ -1604,7 +1604,8 @@
"tr_TR": "Türkçe",
"fa_IR": "Farsça",
"uk_UA": "Ukrayna",
"cs_CZ": "Çekçe"
"cs_CZ": "Çekçe",
"el_GR": "Yunanca"
}
}
}

3
ui/src/app/locale/locale.constant-uk_UA.json

@ -2382,7 +2382,8 @@
"de_DE": "Німецька",
"uk_UA": "Українська",
"fa_IR": "Перська",
"cs_CZ": "Чеська"
"cs_CZ": "Чеська",
"el_GR": "Грецька"
}
}
}
Loading…
Cancel
Save