Displaying DistributionSet Details in Tooltip
Signed-off-by: venu1278 <venugopal.boodidadinne@in.bosch.com>
This commit is contained in:
@@ -323,6 +323,10 @@ public abstract class AbstractTable<E extends NamedEntity, I> extends Table {
|
||||
return columnList;
|
||||
}
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.assigned.ds"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.installed.ds"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_BY, i18n.get("header.createdBy"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_CREATED_DATE, i18n.get("header.createdDate"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, i18n.get("header.modifiedBy"), 0.1F));
|
||||
|
||||
@@ -10,9 +10,11 @@ package org.eclipse.hawkbit.ui.components;
|
||||
|
||||
import java.net.URI;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Action.Status;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
@@ -36,6 +38,8 @@ public class ProxyTarget extends Target {
|
||||
|
||||
private DistributionSet installedDistributionSet;
|
||||
|
||||
private DistributionSet assignedDistributionSet;
|
||||
|
||||
private TargetIdName targetIdName;
|
||||
|
||||
private String assignedDistNameVersion;
|
||||
@@ -249,6 +253,21 @@ public class ProxyTarget extends Target {
|
||||
this.installedDistributionSet = installedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the assignedDistributionSet
|
||||
*/
|
||||
public DistributionSet getAssignedDistributionSet() {
|
||||
return assignedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param assignedDistributionSet
|
||||
* the assignedDistributionSet to set
|
||||
*/
|
||||
public void setAssignedDistributionSet(DistributionSet assignedDistributionSet) {
|
||||
this.assignedDistributionSet = assignedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetIdName
|
||||
*/
|
||||
@@ -297,4 +316,5 @@ public class ProxyTarget extends Target {
|
||||
public void setStatus(final Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,10 +13,13 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
import org.eclipse.hawkbit.ui.components.SPUIComponentProvider;
|
||||
import org.eclipse.hawkbit.ui.filtermanagement.event.CustomFilterUIEvent;
|
||||
@@ -69,6 +72,10 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
|
||||
private static final int PROPERTY_DEPT = 3;
|
||||
|
||||
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
|
||||
|
||||
private static final String INSTALL_DIST_SET = "installedDistributionSet";
|
||||
|
||||
/**
|
||||
* Initialize the Action History Table.
|
||||
*/
|
||||
@@ -87,6 +94,7 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
setId(SPUIComponetIdProvider.CUSTOM_FILTER_TARGET_TABLE_ID);
|
||||
setSelectable(false);
|
||||
eventBus.subscribe(this);
|
||||
setItemDescriptionGenerator(new TooltipGenerator());
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
@@ -160,6 +168,9 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
private void setCollapsibleColumns() {
|
||||
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, true);
|
||||
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, true);
|
||||
|
||||
setColumnCollapsed(ASSIGN_DIST_SET, true);
|
||||
setColumnCollapsed(INSTALL_DIST_SET, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,6 +187,9 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
container.addContainerProperty(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER, String.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_TARGET_STATUS, TargetUpdateStatus.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false, true);
|
||||
|
||||
container.addContainerProperty(ASSIGN_DIST_SET, DistributionSet.class, null, false, true);
|
||||
container.addContainerProperty(INSTALL_DIST_SET, DistributionSet.class, null, false, true);
|
||||
}
|
||||
|
||||
private List<TableColumn> getVisbleColumns() {
|
||||
@@ -244,4 +258,58 @@ public class CreateOrUpdateFilterTable extends Table {
|
||||
populateTableData();
|
||||
eventBus.publish(this, CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON);
|
||||
}
|
||||
|
||||
public class TooltipGenerator implements ItemDescriptionGenerator {
|
||||
private static final long serialVersionUID = 688730421728162456L;
|
||||
|
||||
@Override
|
||||
public String generateDescription(Component source, Object itemId, Object propertyId) {
|
||||
final DistributionSet distributionSet;
|
||||
final Item item = getItem(itemId);
|
||||
if (propertyId != null) {
|
||||
if (propertyId.equals(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER)) {
|
||||
distributionSet = (DistributionSet) item.getItemProperty(ASSIGN_DIST_SET).getValue();
|
||||
return getDSDetails(distributionSet);
|
||||
} else if (propertyId.equals(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER)) {
|
||||
distributionSet = (DistributionSet) item.getItemProperty(INSTALL_DIST_SET).getValue();
|
||||
return getDSDetails(distributionSet);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getDSDetails(final DistributionSet distributionSet) {
|
||||
StringBuilder swModuleNames = new StringBuilder();
|
||||
StringBuilder swModuleVendors = new StringBuilder();
|
||||
final Set<SoftwareModule> swModules = (Set<SoftwareModule>)distributionSet.getModules();
|
||||
swModules.forEach(swModule -> {
|
||||
swModuleNames.append(swModule.getName());
|
||||
swModuleNames.append(" , ");
|
||||
swModuleVendors.append(swModule.getVendor());
|
||||
swModuleVendors.append(" , ");
|
||||
});
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("<ul>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" DistributionSet Description : ").append((String) distributionSet.getDescription());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" DistributionSet Type : ").append((distributionSet.getType()).getName());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" Required Migration step : ")
|
||||
.append(distributionSet.isRequiredMigrationStep() ? "Yes" : "No");
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("SoftWare Modules : ").append(swModuleNames.toString());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("Vendor(s) : ").append(swModuleVendors.toString());
|
||||
stringBuilder.append("</li>");
|
||||
|
||||
stringBuilder.append("</ul>");
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,11 +136,16 @@ public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
|
||||
if (pinnedDistId == null) {
|
||||
prxyTarget.setInstalledDistributionSet(null);
|
||||
prxyTarget.setAssignedDistributionSet(null);
|
||||
|
||||
} else {
|
||||
final Target target = getTargetManagement().findTargetByControllerIDWithDetails(targ.getControllerId());
|
||||
final DistributionSet installedDistributionSet = target.getTargetInfo().getInstalledDistributionSet();
|
||||
prxyTarget.setInstalledDistNameVersion(HawkbitCommonUtil.getFormattedNameVersion(
|
||||
installedDistributionSet.getName(), installedDistributionSet.getVersion()));
|
||||
prxyTarget.setInstalledDistributionSet(installedDistributionSet);
|
||||
final DistributionSet assignedDistributionSet = target.getAssignedDistributionSet();
|
||||
prxyTarget.setAssignedDistNameVersion(HawkbitCommonUtil.getFormattedNameVersion(
|
||||
assignedDistributionSet.getName(), assignedDistributionSet.getVersion()));
|
||||
prxyTarget.setAssignedDistributionSet(assignedDistributionSet);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,9 @@ import org.eclipse.hawkbit.eventbus.event.TargetInfoUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.OffsetBasedPageRequest;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetIdName;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
import org.eclipse.hawkbit.repository.model.TargetIdName;
|
||||
@@ -40,6 +42,7 @@ import org.eclipse.hawkbit.ui.filter.target.CustomTargetFilter;
|
||||
import org.eclipse.hawkbit.ui.filter.target.TargetSearchTextFilter;
|
||||
import org.eclipse.hawkbit.ui.filter.target.TargetStatusFilter;
|
||||
import org.eclipse.hawkbit.ui.filter.target.TargetTagFilter;
|
||||
import org.eclipse.hawkbit.ui.filtermanagement.CreateOrUpdateFilterTable.TooltipGenerator;
|
||||
import org.eclipse.hawkbit.ui.management.event.DragEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.ManagementUIEvent;
|
||||
import org.eclipse.hawkbit.ui.management.event.ManagementViewAcceptCriteria;
|
||||
@@ -92,6 +95,7 @@ import com.vaadin.ui.Label;
|
||||
import com.vaadin.ui.Table;
|
||||
import com.vaadin.ui.UI;
|
||||
import com.vaadin.ui.themes.ValoTheme;
|
||||
import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
|
||||
|
||||
/**
|
||||
* Concrete implementation of Target table.
|
||||
@@ -109,6 +113,9 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> implements
|
||||
private static final int PROPERTY_DEPT = 3;
|
||||
private static final String ACTION_NOT_ALLOWED_MSG = "message.action.not.allowed";
|
||||
|
||||
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
|
||||
private static final String INSTALL_DIST_SET = "installedDistributionSet";
|
||||
|
||||
@Autowired
|
||||
private transient TargetManagement targetManagement;
|
||||
|
||||
@@ -136,6 +143,7 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> implements
|
||||
addActionHandler(this);
|
||||
actionSelectAll = new ShortcutAction(i18n.get("action.target.table.selectall"));
|
||||
actionUnSelectAll = new ShortcutAction(i18n.get("action.target.table.clear"));
|
||||
setItemDescriptionGenerator(new TooltipGenerator());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1073,4 +1081,61 @@ public class TargetTable extends AbstractTable<Target, TargetIdName> implements
|
||||
private boolean isFilteredByTags() {
|
||||
return !managementUIState.getTargetTableFilters().getClickedTargetTags().isEmpty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* tooltip for assignedDS and installedDS
|
||||
*/
|
||||
|
||||
protected class TooltipGenerator implements ItemDescriptionGenerator {
|
||||
private static final long serialVersionUID = 688730421728162456L;
|
||||
|
||||
@Override
|
||||
public String generateDescription(Component source, Object itemId, Object propertyId) {
|
||||
final DistributionSet distributionSet;
|
||||
final Item item = getItem(itemId);
|
||||
if (propertyId != null) {
|
||||
if (propertyId.equals(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER)) {
|
||||
distributionSet = (DistributionSet) item.getItemProperty(ASSIGN_DIST_SET).getValue();
|
||||
return getDSDetails(distributionSet);
|
||||
} else if (propertyId.equals(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER)) {
|
||||
distributionSet = (DistributionSet) item.getItemProperty(INSTALL_DIST_SET).getValue();
|
||||
return getDSDetails(distributionSet);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getDSDetails(final DistributionSet distributionSet) {
|
||||
StringBuilder swModuleNames = new StringBuilder();
|
||||
StringBuilder swModuleVendors = new StringBuilder();
|
||||
final Set<SoftwareModule> swModules = (Set<SoftwareModule>)distributionSet.getModules();
|
||||
swModules.forEach(swModule -> {
|
||||
swModuleNames.append(swModule.getName());
|
||||
swModuleNames.append(" , ");
|
||||
swModuleVendors.append(swModule.getVendor());
|
||||
swModuleVendors.append(" , ");
|
||||
});
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("<ul>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" DistributionSet Description : ").append((String) distributionSet.getDescription());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" DistributionSet Type : ").append((distributionSet.getType()).getName());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" Required Migration step : ")
|
||||
.append(distributionSet.isRequiredMigrationStep() ? "Yes" : "No");
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("SoftWare Modules : ").append(swModuleNames.toString());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("Vendor(s) : ").append(swModuleVendors.toString());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("</ul>");
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,10 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.ui.rollout.rollout;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
|
||||
|
||||
import com.vaadin.server.FontAwesome;
|
||||
@@ -31,10 +34,84 @@ public class ProxyRollout extends Rollout {
|
||||
|
||||
private Boolean isActionRecieved = Boolean.FALSE;
|
||||
|
||||
private Boolean isRequiredMigrationStep = Boolean.FALSE;
|
||||
|
||||
private String totalTargetsCount;
|
||||
|
||||
private RolloutRendererData rolloutRendererData;
|
||||
|
||||
private String discription;
|
||||
|
||||
private String type;
|
||||
|
||||
private Set<SoftwareModule> swModules;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the isRequiredMigrationStep
|
||||
*/
|
||||
|
||||
public Boolean getIsRequiredMigrationStep() {
|
||||
return isRequiredMigrationStep;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param isRequiredMigrationStep
|
||||
* the isRequiredMigrationStep to set
|
||||
*/
|
||||
|
||||
public void setIsRequiredMigrationStep(Boolean isRequiredMigrationStep) {
|
||||
this.isRequiredMigrationStep = isRequiredMigrationStep;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the discription
|
||||
*/
|
||||
|
||||
public String getDiscription() {
|
||||
return discription;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param discription
|
||||
* the discription to set
|
||||
*/
|
||||
|
||||
public void setDiscription(String discription) {
|
||||
this.discription = discription;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type
|
||||
* the type to set
|
||||
*/
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return the Set of Software modules
|
||||
*/
|
||||
public Set<SoftwareModule> getSwModules() {
|
||||
return swModules;
|
||||
}
|
||||
/**
|
||||
* @param swModules
|
||||
* Set<SoftwareModule> to set
|
||||
*/
|
||||
public void setSwModules(Set<SoftwareModule> swModules) {
|
||||
this.swModules = swModules;
|
||||
}
|
||||
|
||||
public RolloutRendererData getRolloutRendererData() {
|
||||
return rolloutRendererData;
|
||||
|
||||
@@ -137,6 +137,11 @@ public class RolloutBeanQuery extends AbstractBeanQuery<ProxyRollout> {
|
||||
proxyRollout.setTotalTargetCountStatus(totalTargetCountActionStatus);
|
||||
proxyRollout.setTotalTargetsCount(String.valueOf(rollout.getTotalTargets()));
|
||||
|
||||
proxyRollout.setDescription(distributionSet.getDescription());
|
||||
proxyRollout.setType(distributionSet.getType().getName());
|
||||
proxyRollout.setIsRequiredMigrationStep(distributionSet.isRequiredMigrationStep());
|
||||
proxyRollout.setSwModules(distributionSet.getModules());
|
||||
|
||||
proxyRolloutList.add(proxyRollout);
|
||||
}
|
||||
return proxyRolloutList;
|
||||
|
||||
@@ -14,12 +14,14 @@ import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.hawkbit.eventbus.event.RolloutChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.RolloutManagement;
|
||||
import org.eclipse.hawkbit.repository.SpPermissionChecker;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout.RolloutStatus;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.TotalTargetCountStatus;
|
||||
import org.eclipse.hawkbit.ui.common.grid.AbstractGrid;
|
||||
import org.eclipse.hawkbit.ui.customrenderers.client.renderers.RolloutRendererData;
|
||||
@@ -78,6 +80,12 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
|
||||
private static final String START_OPTION = "Start";
|
||||
|
||||
private static final String DS_TYPE = "type";
|
||||
|
||||
private static final String SW_MODULES = "swModules";
|
||||
|
||||
private static final String IS_REQUIRED_MIGRATION_STEP = "isRequiredMigrationStep";
|
||||
|
||||
private static final String ROLLOUT_RENDERER_DATA = "rolloutRendererData";
|
||||
|
||||
@Autowired
|
||||
@@ -160,8 +168,11 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
protected void addContainerProperties() {
|
||||
final LazyQueryContainer rolloutGridContainer = (LazyQueryContainer) getContainerDataSource();
|
||||
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_NAME, String.class, "", false, false);
|
||||
rolloutGridContainer.addContainerProperty(DS_TYPE, String.class, null, false, false);
|
||||
rolloutGridContainer.addContainerProperty(SW_MODULES, Set.class, null, false, false);
|
||||
rolloutGridContainer.addContainerProperty(ROLLOUT_RENDERER_DATA, RolloutRendererData.class, null, false, false);
|
||||
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, null, false, false);
|
||||
rolloutGridContainer.addContainerProperty(IS_REQUIRED_MIGRATION_STEP, boolean.class, null, false, false);
|
||||
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_STATUS, RolloutStatus.class, null, false,
|
||||
false);
|
||||
rolloutGridContainer.addContainerProperty(SPUILabelDefinitions.VAR_DIST_NAME_VERSION, String.class, null, false,
|
||||
@@ -216,6 +227,9 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
@Override
|
||||
protected void setColumnHeaderNames() {
|
||||
getColumn(ROLLOUT_RENDERER_DATA).setHeaderCaption(i18n.get("header.name"));
|
||||
getColumn(DS_TYPE).setHeaderCaption("Type");
|
||||
getColumn(SW_MODULES).setHeaderCaption("swModules");
|
||||
getColumn(IS_REQUIRED_MIGRATION_STEP).setHeaderCaption("IsRequiredMigrationStep");
|
||||
getColumn(SPUILabelDefinitions.VAR_DIST_NAME_VERSION).setHeaderCaption(i18n.get("header.distributionset"));
|
||||
getColumn(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS).setHeaderCaption(i18n.get("header.numberofgroups"));
|
||||
getColumn(SPUILabelDefinitions.VAR_TOTAL_TARGETS).setHeaderCaption(i18n.get("header.total.targets"));
|
||||
@@ -240,6 +254,9 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
final List<Object> columnList = new ArrayList<>();
|
||||
columnList.add(ROLLOUT_RENDERER_DATA);
|
||||
columnList.add(SPUILabelDefinitions.VAR_DIST_NAME_VERSION);
|
||||
columnList.add(DS_TYPE);
|
||||
columnList.add(SW_MODULES);
|
||||
columnList.add(IS_REQUIRED_MIGRATION_STEP);
|
||||
columnList.add(SPUILabelDefinitions.VAR_STATUS);
|
||||
columnList.add(SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS);
|
||||
columnList.add(SPUILabelDefinitions.VAR_NUMBER_OF_GROUPS);
|
||||
@@ -264,6 +281,9 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
columnsToBeHidden.add(SPUILabelDefinitions.VAR_MODIFIED_DATE);
|
||||
columnsToBeHidden.add(SPUILabelDefinitions.VAR_MODIFIED_BY);
|
||||
columnsToBeHidden.add(SPUILabelDefinitions.VAR_DESC);
|
||||
columnsToBeHidden.add(IS_REQUIRED_MIGRATION_STEP);
|
||||
columnsToBeHidden.add(DS_TYPE);
|
||||
columnsToBeHidden.add(SW_MODULES);
|
||||
for (final Object propertyId : columnsToBeHidden) {
|
||||
getColumn(propertyId).setHidden(true);
|
||||
}
|
||||
@@ -456,10 +476,49 @@ public class RolloutListGrid extends AbstractGrid {
|
||||
} else if (SPUILabelDefinitions.VAR_TOTAL_TARGETS_COUNT_STATUS.equals(cell.getPropertyId())) {
|
||||
return DistributionBarHelper
|
||||
.getTooltip(((TotalTargetCountStatus) cell.getValue()).getStatusTotalCountMap());
|
||||
} else if (SPUILabelDefinitions.VAR_DIST_NAME_VERSION.equals(cell.getPropertyId())) {
|
||||
return getDSDetails((Item) cell.getItem());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getDSDetails(final Item rolloutItem) {
|
||||
StringBuilder swModuleNames = new StringBuilder();
|
||||
StringBuilder swModuleVendors = new StringBuilder();
|
||||
final Set<SoftwareModule> swModules = (Set<SoftwareModule>) rolloutItem.getItemProperty(SW_MODULES).getValue();
|
||||
swModules.forEach(swModule -> {
|
||||
swModuleNames.append(swModule.getName());
|
||||
swModuleNames.append(" , ");
|
||||
swModuleVendors.append(swModule.getVendor());
|
||||
swModuleVendors.append(" , ");
|
||||
});
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("<ul>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" DistributionSet Description : ")
|
||||
.append((String) rolloutItem.getItemProperty(SPUILabelDefinitions.VAR_DESC).getValue());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append(" DistributionSet Type : ")
|
||||
.append((String) rolloutItem.getItemProperty(DS_TYPE).getValue());
|
||||
stringBuilder.append("</li>");
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("Required Migration step : ")
|
||||
.append((boolean) rolloutItem.getItemProperty(IS_REQUIRED_MIGRATION_STEP).getValue() ? "Yes" : "No");
|
||||
stringBuilder.append("</li>");
|
||||
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("SoftWare Modules : ").append(swModuleNames.toString());
|
||||
stringBuilder.append("</li>");
|
||||
|
||||
stringBuilder.append("<li>");
|
||||
stringBuilder.append("Vendor(s) : ").append(swModuleVendors.toString());
|
||||
stringBuilder.append("</li>");
|
||||
|
||||
stringBuilder.append("</ul>");
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
enum ACTION {
|
||||
PAUSE, RESUME, START, UPDATE
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.hawkbit.im.authentication.UserPrincipal;
|
||||
import org.eclipse.hawkbit.repository.SoftwareManagement;
|
||||
import org.eclipse.hawkbit.repository.model.AssignmentResult;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
@@ -107,6 +108,9 @@ public final class HawkbitCommonUtil {
|
||||
private static final String DELETE_DROP_CREATE_SCRIPT = "var q = document.getElementById('show-delete-drop-hint'); if(q) { } else { showDeleteDrop = document.createElement('style'); showDeleteDrop.id=\"show-delete-drop-hint\"; document.head.appendChild(showDeleteDrop); }";
|
||||
private static final String DELETE_TAG_DROP_REMOVE_SCRIPT = "var o = document.getElementById('show-delete-drop-hint'); if(o) { document.head.removeChild(o); } ";
|
||||
|
||||
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
|
||||
private static final String INSTALL_DIST_SET = "installedDistributionSet";
|
||||
|
||||
/**
|
||||
* Define empty string.
|
||||
*/
|
||||
@@ -1090,6 +1094,10 @@ public final class HawkbitCommonUtil {
|
||||
targetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP, String.class, null,
|
||||
false, true);
|
||||
targetTableContainer.addContainerProperty(SPUILabelDefinitions.VAR_DESC, String.class, "", false, true);
|
||||
|
||||
targetTableContainer.addContainerProperty(ASSIGN_DIST_SET, DistributionSet.class, null, false, true);
|
||||
targetTableContainer.addContainerProperty(INSTALL_DIST_SET, DistributionSet.class, null, false, true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user