Browse Source

added curent tb version to the UpdateMessage

pull/8212/head
YevhenBondarenko 3 years ago
parent
commit
b13c9d7368
  1. 5
      application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java
  2. 5
      common/data/src/main/java/org/thingsboard/server/common/data/UpdateMessage.java

5
application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java

@ -66,7 +66,7 @@ public class DefaultUpdateService implements UpdateService {
@PostConstruct
private void init() {
updateMessage = new UpdateMessage("", false);
updateMessage = new UpdateMessage("", false, "");
if (updatesEnabled) {
try {
platform = System.getProperty("platform", "unknown");
@ -124,7 +124,8 @@ public class DefaultUpdateService implements UpdateService {
JsonNode response = restClient.postForObject(UPDATE_SERVER_BASE_URL+"/api/thingsboard/updates", request, JsonNode.class);
updateMessage = new UpdateMessage(
response.get("message").asText(),
response.get("updateAvailable").asBoolean()
response.get("updateAvailable").asBoolean(),
version
);
} catch (Exception e) {
log.trace(e.getMessage());

5
common/data/src/main/java/org/thingsboard/server/common/data/UpdateMessage.java

@ -25,7 +25,8 @@ public class UpdateMessage {
@ApiModelProperty(position = 1, value = "The message about new platform update available.")
private final String message;
@ApiModelProperty(position = 1, value = "'True' if new platform update is available.")
@ApiModelProperty(position = 2, value = "'True' if new platform update is available.")
private final boolean isUpdateAvailable;
@ApiModelProperty(position = 3, value = "Current ThingsBoard version.")
private final String currentVersion;
}

Loading…
Cancel
Save