Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -54,4 +54,6 @@ public interface Constants {
|
|||||||
String CANCEL_ESC = "Cancel (Esc)";
|
String CANCEL_ESC = "Cancel (Esc)";
|
||||||
|
|
||||||
String NAME_ASC = "name:asc";
|
String NAME_ASC = "name:asc";
|
||||||
|
|
||||||
|
String NOT_AVAILABLE_NULL = "n/a (null)";
|
||||||
}
|
}
|
||||||
@@ -225,11 +225,9 @@ public class RolloutView extends TableView<MgmtRolloutResponseBody, Long> {
|
|||||||
targetFilter.setValue(rollout.getTargetFilterQuery());
|
targetFilter.setValue(rollout.getTargetFilterQuery());
|
||||||
final MgmtDistributionSet distributionSetMgmt = hawkbitClient.getDistributionSetRestApi()
|
final MgmtDistributionSet distributionSetMgmt = hawkbitClient.getDistributionSetRestApi()
|
||||||
.getDistributionSet(rollout.getDistributionSetId()).getBody();
|
.getDistributionSet(rollout.getDistributionSetId()).getBody();
|
||||||
if (distributionSetMgmt == null) { // should not be here
|
distributionSet.setValue(distributionSetMgmt == null
|
||||||
distributionSet.setValue("n/a (null)");
|
? NOT_AVAILABLE_NULL // should not be the case
|
||||||
} else {
|
: distributionSetMgmt.getName() + ":" + distributionSetMgmt.getVersion());
|
||||||
distributionSet.setValue(distributionSetMgmt.getName() + ":" + distributionSetMgmt.getVersion());
|
|
||||||
}
|
|
||||||
actonType.setValue(switch (rollout.getType()) {
|
actonType.setValue(switch (rollout.getType()) {
|
||||||
case SOFT -> Constants.SOFT;
|
case SOFT -> Constants.SOFT;
|
||||||
case FORCED -> Constants.FORCED;
|
case FORCED -> Constants.FORCED;
|
||||||
|
|||||||
@@ -379,8 +379,8 @@ public class TargetView extends TableView<MgmtTarget, String> {
|
|||||||
lastModifiedAt.setValue(new Date(target.getLastModifiedAt()).toString());
|
lastModifiedAt.setValue(new Date(target.getLastModifiedAt()).toString());
|
||||||
securityToken.setValue(target.getSecurityToken());
|
securityToken.setValue(target.getSecurityToken());
|
||||||
|
|
||||||
MgmtPollStatus pollStatus = target.getPollStatus();
|
final MgmtPollStatus pollStatus = target.getPollStatus();
|
||||||
lastPoll.setValue(new Date(pollStatus.getLastRequestAt()).toString());
|
lastPoll.setValue(pollStatus == null ? NOT_AVAILABLE_NULL : new Date(pollStatus.getLastRequestAt()).toString());
|
||||||
final ResponseEntity<MgmtTargetAttributes> response = hawkbitClient.getTargetRestApi().getAttributes(target.getControllerId());
|
final ResponseEntity<MgmtTargetAttributes> response = hawkbitClient.getTargetRestApi().getAttributes(target.getControllerId());
|
||||||
if (response.getStatusCode().is2xxSuccessful()) {
|
if (response.getStatusCode().is2xxSuccessful()) {
|
||||||
targetAttributes.setValue(Objects.requireNonNullElse(response.getBody(), Collections.emptyMap()).entrySet().stream()
|
targetAttributes.setValue(Objects.requireNonNullElse(response.getBody(), Collections.emptyMap()).entrySet().stream()
|
||||||
|
|||||||
Reference in New Issue
Block a user