ui: Make clearer which target's detail is currently open (#2882)
Signed-off-by: Mohamed Belaouad <mohamed.belaouad@wattsense.com>
This commit is contained in:
@@ -342,8 +342,9 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static class TargetDetailedView extends TabSheet {
|
protected static class TargetDetailedView extends VerticalLayout {
|
||||||
|
|
||||||
|
private final Span targetId;
|
||||||
private final TargetDetails targetDetails;
|
private final TargetDetails targetDetails;
|
||||||
private final TargetAssignedInstalled targetAssignedInstalled;
|
private final TargetAssignedInstalled targetAssignedInstalled;
|
||||||
private final TargetTags targetTags;
|
private final TargetTags targetTags;
|
||||||
@@ -351,6 +352,8 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
|||||||
private final TargetActionsHistoryLayout targetActionsHistoryLayout;
|
private final TargetActionsHistoryLayout targetActionsHistoryLayout;
|
||||||
|
|
||||||
private TargetDetailedView(final HawkbitMgmtClient hawkbitClient) {
|
private TargetDetailedView(final HawkbitMgmtClient hawkbitClient) {
|
||||||
|
final TabSheet tabSheet = new TabSheet();
|
||||||
|
targetId = new Span();
|
||||||
targetDetails = new TargetDetails(hawkbitClient);
|
targetDetails = new TargetDetails(hawkbitClient);
|
||||||
targetAssignedInstalled = new TargetAssignedInstalled(hawkbitClient);
|
targetAssignedInstalled = new TargetAssignedInstalled(hawkbitClient);
|
||||||
targetTags = new TargetTags(hawkbitClient);
|
targetTags = new TargetTags(hawkbitClient);
|
||||||
@@ -358,14 +361,17 @@ public class TargetView extends TableView<TargetView.TargetWithDs, String> {
|
|||||||
targetActionsHistoryLayout = new TargetActionsHistoryLayout(hawkbitClient);
|
targetActionsHistoryLayout = new TargetActionsHistoryLayout(hawkbitClient);
|
||||||
setWidthFull();
|
setWidthFull();
|
||||||
|
|
||||||
add("Details", targetDetails);
|
add(targetId);
|
||||||
add("Assigned / Installed", targetAssignedInstalled);
|
tabSheet.add("Details", targetDetails);
|
||||||
add("Tags", targetTags);
|
tabSheet.add("Assigned / Installed", targetAssignedInstalled);
|
||||||
add("Metadata", targetMetadata);
|
tabSheet.add("Tags", targetTags);
|
||||||
add("Action History", targetActionsHistoryLayout);
|
tabSheet.add("Metadata", targetMetadata);
|
||||||
|
tabSheet.add("Action History", targetActionsHistoryLayout);
|
||||||
|
add(tabSheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setItem(final MgmtTarget target) {
|
private void setItem(final MgmtTarget target) {
|
||||||
|
this.targetId.setText(target.getControllerId());
|
||||||
this.targetDetails.setItem(target);
|
this.targetDetails.setItem(target);
|
||||||
this.targetAssignedInstalled.setItem(target);
|
this.targetAssignedInstalled.setItem(target);
|
||||||
this.targetTags.setItem(target);
|
this.targetTags.setItem(target);
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class TableView<T, ID> extends Div implements Constants, BeforeEnterObser
|
|||||||
|
|
||||||
if (detailsButtonHandler != null) {
|
if (detailsButtonHandler != null) {
|
||||||
ComponentRenderer<Button, T> renderer = new ComponentRenderer<>(renderDetailsButton(detailsButtonHandler));
|
ComponentRenderer<Button, T> renderer = new ComponentRenderer<>(renderDetailsButton(detailsButtonHandler));
|
||||||
selectionGrid.addColumn(renderer).setHeader("Details").setAutoWidth(true).setFlexGrow(0);
|
selectionGrid.addColumn(renderer).setHeader("Details").setAutoWidth(true).setFlexGrow(0).setFrozenToEnd(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
filter = new Filter(
|
filter = new Filter(
|
||||||
|
|||||||
Reference in New Issue
Block a user