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;
|
||||
@@ -26,275 +28,293 @@ import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
|
||||
*
|
||||
*/
|
||||
public class ProxyTarget extends Target {
|
||||
private static final long serialVersionUID = -8891449133620645310L;
|
||||
private String controllerId;
|
||||
private URI address = null;
|
||||
private Long lastTargetQuery = null;
|
||||
private Long installationDate;
|
||||
private static final long serialVersionUID = -8891449133620645310L;
|
||||
private String controllerId;
|
||||
private URI address = null;
|
||||
private Long lastTargetQuery = null;
|
||||
private Long installationDate;
|
||||
|
||||
private TargetUpdateStatus updateStatus = TargetUpdateStatus.UNKNOWN;
|
||||
private TargetUpdateStatus updateStatus = TargetUpdateStatus.UNKNOWN;
|
||||
|
||||
private DistributionSet installedDistributionSet;
|
||||
private DistributionSet installedDistributionSet;
|
||||
|
||||
private TargetIdName targetIdName;
|
||||
private DistributionSet assignedDistributionSet;
|
||||
|
||||
private String assignedDistNameVersion;
|
||||
private TargetIdName targetIdName;
|
||||
|
||||
private String installedDistNameVersion;
|
||||
private String assignedDistNameVersion;
|
||||
|
||||
private String pollStatusToolTip;
|
||||
private String installedDistNameVersion;
|
||||
|
||||
private String createdByUser;
|
||||
private String pollStatusToolTip;
|
||||
|
||||
private String createdDate;
|
||||
private String createdByUser;
|
||||
|
||||
private String lastModifiedDate;
|
||||
private String createdDate;
|
||||
|
||||
private String modifiedByUser;
|
||||
private String lastModifiedDate;
|
||||
|
||||
private Status status;
|
||||
private String modifiedByUser;
|
||||
|
||||
/**
|
||||
* @param controllerId
|
||||
*/
|
||||
public ProxyTarget() {
|
||||
super(null);
|
||||
final Integer generatedId = new SecureRandom().nextInt(Integer.MAX_VALUE) - Integer.MAX_VALUE;
|
||||
targetIdName = new TargetIdName(generatedId, generatedId.toString(), generatedId.toString());
|
||||
}
|
||||
private Status status;
|
||||
|
||||
/**
|
||||
* @return the createdByUser
|
||||
*/
|
||||
public String getCreatedByUser() {
|
||||
return createdByUser;
|
||||
}
|
||||
/**
|
||||
* @param controllerId
|
||||
*/
|
||||
public ProxyTarget() {
|
||||
super(null);
|
||||
final Integer generatedId = new SecureRandom().nextInt(Integer.MAX_VALUE) - Integer.MAX_VALUE;
|
||||
targetIdName = new TargetIdName(generatedId, generatedId.toString(), generatedId.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createdByUser
|
||||
* the createdByUser to set
|
||||
*/
|
||||
public void setCreatedByUser(final String createdByUser) {
|
||||
this.createdByUser = createdByUser;
|
||||
}
|
||||
/**
|
||||
* @return the createdByUser
|
||||
*/
|
||||
public String getCreatedByUser() {
|
||||
return createdByUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the createdDate
|
||||
*/
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
/**
|
||||
* @param createdByUser
|
||||
* the createdByUser to set
|
||||
*/
|
||||
public void setCreatedByUser(final String createdByUser) {
|
||||
this.createdByUser = createdByUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createdDate
|
||||
* the createdDate to set
|
||||
*/
|
||||
public void setCreatedDate(final String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
/**
|
||||
* @return the createdDate
|
||||
*/
|
||||
public String getCreatedDate() {
|
||||
return createdDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the modifiedByUser
|
||||
*/
|
||||
public String getModifiedByUser() {
|
||||
return modifiedByUser;
|
||||
}
|
||||
/**
|
||||
* @param createdDate
|
||||
* the createdDate to set
|
||||
*/
|
||||
public void setCreatedDate(final String createdDate) {
|
||||
this.createdDate = createdDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param modifiedByUser
|
||||
* the modifiedByUser to set
|
||||
*/
|
||||
public void setModifiedByUser(final String modifiedByUser) {
|
||||
this.modifiedByUser = modifiedByUser;
|
||||
}
|
||||
/**
|
||||
* @return the modifiedByUser
|
||||
*/
|
||||
public String getModifiedByUser() {
|
||||
return modifiedByUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastModifiedDate
|
||||
*/
|
||||
public String getLastModifiedDate() {
|
||||
return lastModifiedDate;
|
||||
}
|
||||
/**
|
||||
* @param modifiedByUser
|
||||
* the modifiedByUser to set
|
||||
*/
|
||||
public void setModifiedByUser(final String modifiedByUser) {
|
||||
this.modifiedByUser = modifiedByUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastModifiedDate
|
||||
* the lastModifiedDate to set
|
||||
*/
|
||||
public void setLastModifiedDate(final String lastModifiedDate) {
|
||||
this.lastModifiedDate = lastModifiedDate;
|
||||
}
|
||||
/**
|
||||
* @return the lastModifiedDate
|
||||
*/
|
||||
public String getLastModifiedDate() {
|
||||
return lastModifiedDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the assignedDistNameVersion
|
||||
*/
|
||||
public String getAssignedDistNameVersion() {
|
||||
return assignedDistNameVersion;
|
||||
}
|
||||
/**
|
||||
* @param lastModifiedDate
|
||||
* the lastModifiedDate to set
|
||||
*/
|
||||
public void setLastModifiedDate(final String lastModifiedDate) {
|
||||
this.lastModifiedDate = lastModifiedDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param assignedDistNameVersion
|
||||
* the assignedDistNameVersion to set
|
||||
*/
|
||||
public void setAssignedDistNameVersion(final String assignedDistNameVersion) {
|
||||
this.assignedDistNameVersion = assignedDistNameVersion;
|
||||
}
|
||||
/**
|
||||
* @return the assignedDistNameVersion
|
||||
*/
|
||||
public String getAssignedDistNameVersion() {
|
||||
return assignedDistNameVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the installedDistNameVersion
|
||||
*/
|
||||
public String getInstalledDistNameVersion() {
|
||||
return installedDistNameVersion;
|
||||
}
|
||||
/**
|
||||
* @param assignedDistNameVersion
|
||||
* the assignedDistNameVersion to set
|
||||
*/
|
||||
public void setAssignedDistNameVersion(final String assignedDistNameVersion) {
|
||||
this.assignedDistNameVersion = assignedDistNameVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param installedDistNameVersion
|
||||
* the installedDistNameVersion to set
|
||||
*/
|
||||
public void setInstalledDistNameVersion(final String installedDistNameVersion) {
|
||||
this.installedDistNameVersion = installedDistNameVersion;
|
||||
}
|
||||
/**
|
||||
* @return the installedDistNameVersion
|
||||
*/
|
||||
public String getInstalledDistNameVersion() {
|
||||
return installedDistNameVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET - ID.
|
||||
*
|
||||
* @return String as ID.
|
||||
*/
|
||||
@Override
|
||||
public String getControllerId() {
|
||||
return controllerId;
|
||||
}
|
||||
/**
|
||||
* @param installedDistNameVersion
|
||||
* the installedDistNameVersion to set
|
||||
*/
|
||||
public void setInstalledDistNameVersion(final String installedDistNameVersion) {
|
||||
this.installedDistNameVersion = installedDistNameVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* SET - ID.
|
||||
*
|
||||
* @param controllerId
|
||||
* as ID
|
||||
*/
|
||||
@Override
|
||||
public void setControllerId(final String controllerId) {
|
||||
this.controllerId = controllerId;
|
||||
}
|
||||
/**
|
||||
* GET - ID.
|
||||
*
|
||||
* @return String as ID.
|
||||
*/
|
||||
@Override
|
||||
public String getControllerId() {
|
||||
return controllerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ipAddress
|
||||
*/
|
||||
public URI getAddress() {
|
||||
return address;
|
||||
}
|
||||
/**
|
||||
* SET - ID.
|
||||
*
|
||||
* @param controllerId
|
||||
* as ID
|
||||
*/
|
||||
@Override
|
||||
public void setControllerId(final String controllerId) {
|
||||
this.controllerId = controllerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ipAddress
|
||||
* the ipAddress to set
|
||||
*/
|
||||
public void setAddress(final URI address) {
|
||||
this.address = address;
|
||||
}
|
||||
/**
|
||||
* @return the ipAddress
|
||||
*/
|
||||
public URI getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastTargetQuery
|
||||
*/
|
||||
public Long getLastTargetQuery() {
|
||||
return lastTargetQuery;
|
||||
}
|
||||
/**
|
||||
* @param ipAddress
|
||||
* the ipAddress to set
|
||||
*/
|
||||
public void setAddress(final URI address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastTargetQuery
|
||||
* the lastTargetQuery to set
|
||||
*/
|
||||
public void setLastTargetQuery(final Long lastTargetQuery) {
|
||||
this.lastTargetQuery = lastTargetQuery;
|
||||
}
|
||||
/**
|
||||
* @return the lastTargetQuery
|
||||
*/
|
||||
public Long getLastTargetQuery() {
|
||||
return lastTargetQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the installationDate
|
||||
*/
|
||||
public Long getInstallationDate() {
|
||||
return installationDate;
|
||||
}
|
||||
/**
|
||||
* @param lastTargetQuery
|
||||
* the lastTargetQuery to set
|
||||
*/
|
||||
public void setLastTargetQuery(final Long lastTargetQuery) {
|
||||
this.lastTargetQuery = lastTargetQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param installationDate
|
||||
* the installationDate to set
|
||||
*/
|
||||
public void setInstallationDate(final Long installationDate) {
|
||||
this.installationDate = installationDate;
|
||||
}
|
||||
/**
|
||||
* @return the installationDate
|
||||
*/
|
||||
public Long getInstallationDate() {
|
||||
return installationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the updateStatus
|
||||
*/
|
||||
public TargetUpdateStatus getUpdateStatus() {
|
||||
return updateStatus;
|
||||
}
|
||||
/**
|
||||
* @param installationDate
|
||||
* the installationDate to set
|
||||
*/
|
||||
public void setInstallationDate(final Long installationDate) {
|
||||
this.installationDate = installationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updateStatus
|
||||
* the updateStatus to set
|
||||
*/
|
||||
public void setUpdateStatus(final TargetUpdateStatus updateStatus) {
|
||||
this.updateStatus = updateStatus;
|
||||
}
|
||||
/**
|
||||
* @return the updateStatus
|
||||
*/
|
||||
public TargetUpdateStatus getUpdateStatus() {
|
||||
return updateStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the installedDistributionSet
|
||||
*/
|
||||
public DistributionSet getInstalledDistributionSet() {
|
||||
return installedDistributionSet;
|
||||
}
|
||||
/**
|
||||
* @param updateStatus
|
||||
* the updateStatus to set
|
||||
*/
|
||||
public void setUpdateStatus(final TargetUpdateStatus updateStatus) {
|
||||
this.updateStatus = updateStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param installedDistributionSet
|
||||
* the installedDistributionSet to set
|
||||
*/
|
||||
public void setInstalledDistributionSet(final DistributionSet installedDistributionSet) {
|
||||
this.installedDistributionSet = installedDistributionSet;
|
||||
}
|
||||
/**
|
||||
* @return the installedDistributionSet
|
||||
*/
|
||||
public DistributionSet getInstalledDistributionSet() {
|
||||
return installedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the targetIdName
|
||||
*/
|
||||
@Override
|
||||
public TargetIdName getTargetIdName() {
|
||||
if (this.targetIdName == null) {
|
||||
return super.getTargetIdName();
|
||||
}
|
||||
return this.targetIdName;
|
||||
}
|
||||
/**
|
||||
* @param installedDistributionSet
|
||||
* the installedDistributionSet to set
|
||||
*/
|
||||
public void setInstalledDistributionSet(final DistributionSet installedDistributionSet) {
|
||||
this.installedDistributionSet = installedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param targetIdName
|
||||
* the targetIdName to set
|
||||
*/
|
||||
public void setTargetIdName(final TargetIdName targetIdName) {
|
||||
this.targetIdName = targetIdName;
|
||||
}
|
||||
/**
|
||||
* @return the assignedDistributionSet
|
||||
*/
|
||||
public DistributionSet getAssignedDistributionSet() {
|
||||
return assignedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pollStatusToolTip
|
||||
*/
|
||||
public String getPollStatusToolTip() {
|
||||
return pollStatusToolTip;
|
||||
}
|
||||
/**
|
||||
* @param assignedDistributionSet
|
||||
* the assignedDistributionSet to set
|
||||
*/
|
||||
public void setAssignedDistributionSet(DistributionSet assignedDistributionSet) {
|
||||
this.assignedDistributionSet = assignedDistributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pollStatusToolTip
|
||||
* the pollStatusToolTip to set
|
||||
*/
|
||||
public void setPollStatusToolTip(final String pollStatusToolTip) {
|
||||
this.pollStatusToolTip = pollStatusToolTip;
|
||||
}
|
||||
/**
|
||||
* @return the targetIdName
|
||||
*/
|
||||
@Override
|
||||
public TargetIdName getTargetIdName() {
|
||||
if (this.targetIdName == null) {
|
||||
return super.getTargetIdName();
|
||||
}
|
||||
return this.targetIdName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the status
|
||||
*/
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
/**
|
||||
* @param targetIdName
|
||||
* the targetIdName to set
|
||||
*/
|
||||
public void setTargetIdName(final TargetIdName targetIdName) {
|
||||
this.targetIdName = targetIdName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pollStatusToolTip
|
||||
*/
|
||||
public String getPollStatusToolTip() {
|
||||
return pollStatusToolTip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pollStatusToolTip
|
||||
* the pollStatusToolTip to set
|
||||
*/
|
||||
public void setPollStatusToolTip(final String pollStatusToolTip) {
|
||||
this.pollStatusToolTip = pollStatusToolTip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the status
|
||||
*/
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param status
|
||||
* the status to set
|
||||
*/
|
||||
public void setStatus(final Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param status
|
||||
* the status to set
|
||||
*/
|
||||
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;
|
||||
@@ -54,194 +57,259 @@ import com.vaadin.ui.themes.ValoTheme;
|
||||
@ViewScope
|
||||
public class CreateOrUpdateFilterTable extends Table {
|
||||
|
||||
private static final long serialVersionUID = 6887304217281629713L;
|
||||
private static final long serialVersionUID = 6887304217281629713L;
|
||||
|
||||
@Autowired
|
||||
private I18N i18n;
|
||||
@Autowired
|
||||
private I18N i18n;
|
||||
|
||||
@Autowired
|
||||
private transient EventBus.SessionEventBus eventBus;
|
||||
@Autowired
|
||||
private transient EventBus.SessionEventBus eventBus;
|
||||
|
||||
@Autowired
|
||||
private FilterManagementUIState filterManagementUIState;
|
||||
@Autowired
|
||||
private FilterManagementUIState filterManagementUIState;
|
||||
|
||||
private LazyQueryContainer container;
|
||||
private LazyQueryContainer container;
|
||||
|
||||
private static final int PROPERTY_DEPT = 3;
|
||||
private static final int PROPERTY_DEPT = 3;
|
||||
|
||||
/**
|
||||
* Initialize the Action History Table.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
setStyleName("sp-table");
|
||||
setSizeFull();
|
||||
setImmediate(true);
|
||||
setHeight(100.0f, Unit.PERCENTAGE);
|
||||
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
|
||||
addStyleName(ValoTheme.TABLE_SMALL);
|
||||
setColumnCollapsingAllowed(true);
|
||||
addCustomGeneratedColumns();
|
||||
restoreOnLoad();
|
||||
populateTableData();
|
||||
setId(SPUIComponetIdProvider.CUSTOM_FILTER_TARGET_TABLE_ID);
|
||||
setSelectable(false);
|
||||
eventBus.subscribe(this);
|
||||
}
|
||||
private static final String ASSIGN_DIST_SET = "assignedDistributionSet";
|
||||
|
||||
@PreDestroy
|
||||
void destroy() {
|
||||
eventBus.unsubscribe(this);
|
||||
}
|
||||
private static final String INSTALL_DIST_SET = "installedDistributionSet";
|
||||
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
||||
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
||||
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK) {
|
||||
UI.getCurrent().access(() -> populateTableData());
|
||||
} else if (custFUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) {
|
||||
UI.getCurrent().access(() -> onQuery());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Initialize the Action History Table.
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
setStyleName("sp-table");
|
||||
setSizeFull();
|
||||
setImmediate(true);
|
||||
setHeight(100.0f, Unit.PERCENTAGE);
|
||||
addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
|
||||
addStyleName(ValoTheme.TABLE_SMALL);
|
||||
setColumnCollapsingAllowed(true);
|
||||
addCustomGeneratedColumns();
|
||||
restoreOnLoad();
|
||||
populateTableData();
|
||||
setId(SPUIComponetIdProvider.CUSTOM_FILTER_TARGET_TABLE_ID);
|
||||
setSelectable(false);
|
||||
eventBus.subscribe(this);
|
||||
setItemDescriptionGenerator(new TooltipGenerator());
|
||||
}
|
||||
|
||||
private void restoreOnLoad() {
|
||||
if (filterManagementUIState.isCreateFilterViewDisplayed()) {
|
||||
filterManagementUIState.setFilterQueryValue(null);
|
||||
} else {
|
||||
filterManagementUIState.getTfQuery()
|
||||
.ifPresent(value -> filterManagementUIState.setFilterQueryValue(value.getQuery()));
|
||||
}
|
||||
}
|
||||
@PreDestroy
|
||||
void destroy() {
|
||||
eventBus.unsubscribe(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a empty HierarchicalContainer.
|
||||
*/
|
||||
private LazyQueryContainer createContainer() {
|
||||
// ADD all the filters to the query config
|
||||
final Map<String, Object> queryConfig = prepareQueryConfigFilters();
|
||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||
void onEvent(final CustomFilterUIEvent custFUIEvent) {
|
||||
if (custFUIEvent == CustomFilterUIEvent.TARGET_DETAILS_VIEW
|
||||
|| custFUIEvent == CustomFilterUIEvent.CREATE_NEW_FILTER_CLICK) {
|
||||
UI.getCurrent().access(() -> populateTableData());
|
||||
} else if (custFUIEvent == CustomFilterUIEvent.FILTER_TARGET_BY_QUERY) {
|
||||
UI.getCurrent().access(() -> onQuery());
|
||||
}
|
||||
}
|
||||
|
||||
// Create TargetBeanQuery factory with the query config.
|
||||
final BeanQueryFactory<CustomTargetBeanQuery> targetQF = new BeanQueryFactory<>(CustomTargetBeanQuery.class);
|
||||
targetQF.setQueryConfiguration(queryConfig);
|
||||
private void restoreOnLoad() {
|
||||
if (filterManagementUIState.isCreateFilterViewDisplayed()) {
|
||||
filterManagementUIState.setFilterQueryValue(null);
|
||||
} else {
|
||||
filterManagementUIState.getTfQuery()
|
||||
.ifPresent(value -> filterManagementUIState.setFilterQueryValue(value.getQuery()));
|
||||
}
|
||||
}
|
||||
|
||||
// create lazy query container with lazy defination and query
|
||||
final LazyQueryContainer targetTableContainer = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_CONT_ID_NAME),
|
||||
targetQF);
|
||||
targetTableContainer.getQueryView().getQueryDefinition().setMaxNestedPropertyDepth(PROPERTY_DEPT);
|
||||
/**
|
||||
* Create a empty HierarchicalContainer.
|
||||
*/
|
||||
private LazyQueryContainer createContainer() {
|
||||
// ADD all the filters to the query config
|
||||
final Map<String, Object> queryConfig = prepareQueryConfigFilters();
|
||||
|
||||
return targetTableContainer;
|
||||
// Create TargetBeanQuery factory with the query config.
|
||||
final BeanQueryFactory<CustomTargetBeanQuery> targetQF = new BeanQueryFactory<>(CustomTargetBeanQuery.class);
|
||||
targetQF.setQueryConfiguration(queryConfig);
|
||||
|
||||
}
|
||||
// create lazy query container with lazy defination and query
|
||||
final LazyQueryContainer targetTableContainer = new LazyQueryContainer(
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_CONT_ID_NAME),
|
||||
targetQF);
|
||||
targetTableContainer.getQueryView().getQueryDefinition().setMaxNestedPropertyDepth(PROPERTY_DEPT);
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
if (!Strings.isNullOrEmpty(filterManagementUIState.getFilterQueryValue())) {
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_QUERY, filterManagementUIState.getFilterQueryValue());
|
||||
}
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_INVALID_QUERY,
|
||||
filterManagementUIState.getIsFilterByInvalidFilterQuery());
|
||||
return queryConfig;
|
||||
}
|
||||
return targetTableContainer;
|
||||
|
||||
/**
|
||||
* populate campaign data.
|
||||
*
|
||||
*/
|
||||
public void populateTableData() {
|
||||
container = createContainer();
|
||||
setContainerDataSource(container);
|
||||
addContainerproperties();
|
||||
setColumnProperties();
|
||||
setPageLength(30);
|
||||
setCollapsibleColumns();
|
||||
}
|
||||
}
|
||||
|
||||
private void setCollapsibleColumns() {
|
||||
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, true);
|
||||
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, true);
|
||||
}
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<>();
|
||||
if (!Strings.isNullOrEmpty(filterManagementUIState.getFilterQueryValue())) {
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_QUERY, filterManagementUIState.getFilterQueryValue());
|
||||
}
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_INVALID_QUERY,
|
||||
filterManagementUIState.getIsFilterByInvalidFilterQuery());
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a empty HierarchicalContainer.
|
||||
*/
|
||||
private void addContainerproperties() {
|
||||
/* Create HierarchicalContainer container */
|
||||
container.addContainerProperty(SPUILabelDefinitions.NAME, String.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_BY, String.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, Date.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class, null, false, true);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, String.class, null, false, true);
|
||||
container.addContainerProperty(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER, String.class, "");
|
||||
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);
|
||||
}
|
||||
/**
|
||||
* populate campaign data.
|
||||
*
|
||||
*/
|
||||
public void populateTableData() {
|
||||
container = createContainer();
|
||||
setContainerDataSource(container);
|
||||
addContainerproperties();
|
||||
setColumnProperties();
|
||||
setPageLength(30);
|
||||
setCollapsibleColumns();
|
||||
}
|
||||
|
||||
private List<TableColumn> getVisbleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.15f));
|
||||
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));
|
||||
columnList.add(
|
||||
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.assigned.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.installed.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.STATUS_ICON, i18n.get("header.status"), 0.1F));
|
||||
return columnList;
|
||||
}
|
||||
private void setCollapsibleColumns() {
|
||||
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, true);
|
||||
setColumnCollapsed(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, true);
|
||||
|
||||
private Component getStatusIcon(final Object itemId) {
|
||||
final Item row1 = getItem(itemId);
|
||||
final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1
|
||||
.getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
|
||||
final Label label = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_LABEL_SIMPLE);
|
||||
label.setContentMode(ContentMode.HTML);
|
||||
if (targetStatus == TargetUpdateStatus.PENDING) {
|
||||
label.setDescription("Pending");
|
||||
label.setStyleName("statusIconYellow");
|
||||
label.setValue(FontAwesome.ADJUST.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.REGISTERED) {
|
||||
label.setDescription("Registered");
|
||||
label.setStyleName("statusIconLightBlue");
|
||||
label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.ERROR) {
|
||||
label.setDescription(i18n.get("label.error"));
|
||||
label.setStyleName("statusIconRed");
|
||||
label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
|
||||
label.setStyleName("statusIconGreen");
|
||||
label.setDescription("In-Synch");
|
||||
label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
|
||||
label.setStyleName("statusIconBlue");
|
||||
label.setDescription(i18n.get("label.unknown"));
|
||||
label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
|
||||
}
|
||||
return label;
|
||||
}
|
||||
setColumnCollapsed(ASSIGN_DIST_SET, true);
|
||||
setColumnCollapsed(INSTALL_DIST_SET, true);
|
||||
}
|
||||
|
||||
private void setColumnProperties() {
|
||||
final List<TableColumn> columnList = getVisbleColumns();
|
||||
final List<Object> swColumnIds = new ArrayList<>();
|
||||
for (final TableColumn column : columnList) {
|
||||
setColumnHeader(column.getColumnPropertyId(), column.getColumnHeader());
|
||||
setColumnExpandRatio(column.getColumnPropertyId(), column.getExpandRatio());
|
||||
swColumnIds.add(column.getColumnPropertyId());
|
||||
}
|
||||
setVisibleColumns(swColumnIds.toArray());
|
||||
}
|
||||
/**
|
||||
* Create a empty HierarchicalContainer.
|
||||
*/
|
||||
private void addContainerproperties() {
|
||||
/* Create HierarchicalContainer container */
|
||||
container.addContainerProperty(SPUILabelDefinitions.NAME, String.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_BY, String.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_CREATED_DATE, Date.class, null);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_BY, String.class, null, false, true);
|
||||
container.addContainerProperty(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, String.class, null, false, true);
|
||||
container.addContainerProperty(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER, String.class, "");
|
||||
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);
|
||||
|
||||
protected void addCustomGeneratedColumns() {
|
||||
addGeneratedColumn(SPUILabelDefinitions.STATUS_ICON, (source, itemId, columnId) -> getStatusIcon(itemId));
|
||||
}
|
||||
container.addContainerProperty(ASSIGN_DIST_SET, DistributionSet.class, null, false, true);
|
||||
container.addContainerProperty(INSTALL_DIST_SET, DistributionSet.class, null, false, true);
|
||||
}
|
||||
|
||||
private void onQuery() {
|
||||
populateTableData();
|
||||
eventBus.publish(this, CustomFilterUIEvent.UPDATE_TARGET_FILTER_SEARCH_ICON);
|
||||
}
|
||||
private List<TableColumn> getVisbleColumns() {
|
||||
final List<TableColumn> columnList = new ArrayList<>();
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.NAME, i18n.get("header.name"), 0.15f));
|
||||
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));
|
||||
columnList.add(
|
||||
new TableColumn(SPUILabelDefinitions.VAR_LAST_MODIFIED_DATE, i18n.get("header.modifiedDate"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.ASSIGNED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.assigned.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.INSTALLED_DISTRIBUTION_NAME_VER,
|
||||
i18n.get("header.installed.ds"), 0.125F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_DESC, i18n.get("header.description"), 0.1F));
|
||||
columnList.add(new TableColumn(SPUILabelDefinitions.STATUS_ICON, i18n.get("header.status"), 0.1F));
|
||||
return columnList;
|
||||
}
|
||||
|
||||
private Component getStatusIcon(final Object itemId) {
|
||||
final Item row1 = getItem(itemId);
|
||||
final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1
|
||||
.getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
|
||||
final Label label = SPUIComponentProvider.getLabel("", SPUILabelDefinitions.SP_LABEL_SIMPLE);
|
||||
label.setContentMode(ContentMode.HTML);
|
||||
if (targetStatus == TargetUpdateStatus.PENDING) {
|
||||
label.setDescription("Pending");
|
||||
label.setStyleName("statusIconYellow");
|
||||
label.setValue(FontAwesome.ADJUST.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.REGISTERED) {
|
||||
label.setDescription("Registered");
|
||||
label.setStyleName("statusIconLightBlue");
|
||||
label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.ERROR) {
|
||||
label.setDescription(i18n.get("label.error"));
|
||||
label.setStyleName("statusIconRed");
|
||||
label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
|
||||
label.setStyleName("statusIconGreen");
|
||||
label.setDescription("In-Synch");
|
||||
label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
|
||||
} else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
|
||||
label.setStyleName("statusIconBlue");
|
||||
label.setDescription(i18n.get("label.unknown"));
|
||||
label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
private void setColumnProperties() {
|
||||
final List<TableColumn> columnList = getVisbleColumns();
|
||||
final List<Object> swColumnIds = new ArrayList<>();
|
||||
for (final TableColumn column : columnList) {
|
||||
setColumnHeader(column.getColumnPropertyId(), column.getColumnHeader());
|
||||
setColumnExpandRatio(column.getColumnPropertyId(), column.getExpandRatio());
|
||||
swColumnIds.add(column.getColumnPropertyId());
|
||||
}
|
||||
setVisibleColumns(swColumnIds.toArray());
|
||||
}
|
||||
|
||||
protected void addCustomGeneratedColumns() {
|
||||
addGeneratedColumn(SPUILabelDefinitions.STATUS_ICON, (source, itemId, columnId) -> getStatusIcon(itemId));
|
||||
}
|
||||
|
||||
private void onQuery() {
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,183 +41,188 @@ import com.google.common.base.Strings;
|
||||
*
|
||||
*/
|
||||
public class TargetBeanQuery extends AbstractBeanQuery<ProxyTarget> {
|
||||
private static final long serialVersionUID = -5645680058303167558L;
|
||||
private Sort sort = new Sort(SPUIDefinitions.TARGET_TABLE_CREATE_AT_SORT_ORDER, "createdAt");
|
||||
private Collection<TargetUpdateStatus> status = null;
|
||||
private String[] targetTags = null;
|
||||
private Long distributionId = null;
|
||||
private String searchText = null;
|
||||
private Boolean noTagClicked = Boolean.FALSE;
|
||||
private transient TargetManagement targetManagement;
|
||||
private transient I18N i18N;
|
||||
private Long pinnedDistId = null;
|
||||
private TargetFilterQuery targetFilterQuery;
|
||||
private ManagementUIState managementUIState;
|
||||
private static final long serialVersionUID = -5645680058303167558L;
|
||||
private Sort sort = new Sort(SPUIDefinitions.TARGET_TABLE_CREATE_AT_SORT_ORDER, "createdAt");
|
||||
private Collection<TargetUpdateStatus> status = null;
|
||||
private String[] targetTags = null;
|
||||
private Long distributionId = null;
|
||||
private String searchText = null;
|
||||
private Boolean noTagClicked = Boolean.FALSE;
|
||||
private transient TargetManagement targetManagement;
|
||||
private transient I18N i18N;
|
||||
private Long pinnedDistId = null;
|
||||
private TargetFilterQuery targetFilterQuery;
|
||||
private ManagementUIState managementUIState;
|
||||
|
||||
/**
|
||||
* Parametric Constructor.
|
||||
*
|
||||
* @param definition
|
||||
* as Def
|
||||
* @param queryConfig
|
||||
* as Config
|
||||
* @param sortIds
|
||||
* as sort
|
||||
* @param sortStates
|
||||
* as Sort status
|
||||
*/
|
||||
public TargetBeanQuery(final QueryDefinition definition, final Map<String, Object> queryConfig,
|
||||
final Object[] sortIds, final boolean[] sortStates) {
|
||||
super(definition, queryConfig, sortIds, sortStates);
|
||||
/**
|
||||
* Parametric Constructor.
|
||||
*
|
||||
* @param definition
|
||||
* as Def
|
||||
* @param queryConfig
|
||||
* as Config
|
||||
* @param sortIds
|
||||
* as sort
|
||||
* @param sortStates
|
||||
* as Sort status
|
||||
*/
|
||||
public TargetBeanQuery(final QueryDefinition definition, final Map<String, Object> queryConfig,
|
||||
final Object[] sortIds, final boolean[] sortStates) {
|
||||
super(definition, queryConfig, sortIds, sortStates);
|
||||
|
||||
if (HawkbitCommonUtil.mapCheckStrKey(queryConfig)) {
|
||||
status = (Collection<TargetUpdateStatus>) queryConfig.get(SPUIDefinitions.FILTER_BY_STATUS);
|
||||
targetTags = (String[]) queryConfig.get(SPUIDefinitions.FILTER_BY_TAG);
|
||||
noTagClicked = (Boolean) queryConfig.get(SPUIDefinitions.FILTER_BY_NO_TAG);
|
||||
distributionId = (Long) queryConfig.get(SPUIDefinitions.FILTER_BY_DISTRIBUTION);
|
||||
searchText = (String) queryConfig.get(SPUIDefinitions.FILTER_BY_TEXT);
|
||||
targetFilterQuery = (TargetFilterQuery) queryConfig.get(SPUIDefinitions.FILTER_BY_TARGET_FILTER_QUERY);
|
||||
if (!Strings.isNullOrEmpty(searchText)) {
|
||||
searchText = String.format("%%%s%%", searchText);
|
||||
}
|
||||
pinnedDistId = (Long) queryConfig.get(SPUIDefinitions.ORDER_BY_DISTRIBUTION);
|
||||
}
|
||||
if (HawkbitCommonUtil.mapCheckStrKey(queryConfig)) {
|
||||
status = (Collection<TargetUpdateStatus>) queryConfig.get(SPUIDefinitions.FILTER_BY_STATUS);
|
||||
targetTags = (String[]) queryConfig.get(SPUIDefinitions.FILTER_BY_TAG);
|
||||
noTagClicked = (Boolean) queryConfig.get(SPUIDefinitions.FILTER_BY_NO_TAG);
|
||||
distributionId = (Long) queryConfig.get(SPUIDefinitions.FILTER_BY_DISTRIBUTION);
|
||||
searchText = (String) queryConfig.get(SPUIDefinitions.FILTER_BY_TEXT);
|
||||
targetFilterQuery = (TargetFilterQuery) queryConfig.get(SPUIDefinitions.FILTER_BY_TARGET_FILTER_QUERY);
|
||||
if (!Strings.isNullOrEmpty(searchText)) {
|
||||
searchText = String.format("%%%s%%", searchText);
|
||||
}
|
||||
pinnedDistId = (Long) queryConfig.get(SPUIDefinitions.ORDER_BY_DISTRIBUTION);
|
||||
}
|
||||
|
||||
if (HawkbitCommonUtil.checkBolArray(sortStates)) {
|
||||
// Initalize Sor
|
||||
sort = new Sort(sortStates[0] ? Direction.ASC : Direction.DESC, (String) sortIds[0]);
|
||||
// Add sort.
|
||||
for (int targetId = 1; targetId < sortIds.length; targetId++) {
|
||||
sort.and(new Sort(sortStates[targetId] ? Direction.ASC : Direction.DESC, (String) sortIds[targetId]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (HawkbitCommonUtil.checkBolArray(sortStates)) {
|
||||
// Initalize Sor
|
||||
sort = new Sort(sortStates[0] ? Direction.ASC : Direction.DESC, (String) sortIds[0]);
|
||||
// Add sort.
|
||||
for (int targetId = 1; targetId < sortIds.length; targetId++) {
|
||||
sort.and(new Sort(sortStates[targetId] ? Direction.ASC : Direction.DESC, (String) sortIds[targetId]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ProxyTarget constructBean() {
|
||||
return new ProxyTarget();
|
||||
}
|
||||
@Override
|
||||
protected ProxyTarget constructBean() {
|
||||
return new ProxyTarget();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ProxyTarget> loadBeans(final int startIndex, final int count) {
|
||||
Slice<Target> targetBeans;
|
||||
final List<ProxyTarget> proxyTargetBeans = new ArrayList<>();
|
||||
if (pinnedDistId != null) {
|
||||
targetBeans = getTargetManagement().findTargetsAllOrderByLinkedDistributionSet(
|
||||
new OffsetBasedPageRequest(startIndex, SPUIDefinitions.PAGE_SIZE, sort), pinnedDistId,
|
||||
distributionId, status, searchText, noTagClicked, targetTags);
|
||||
} else if (null != targetFilterQuery) {
|
||||
targetBeans = getTargetManagement().findTargetsAll(targetFilterQuery,
|
||||
new PageRequest(startIndex / SPUIDefinitions.PAGE_SIZE, SPUIDefinitions.PAGE_SIZE, sort));
|
||||
} else if (!anyFilterSelected()) {
|
||||
targetBeans = getTargetManagement().findTargetsAll(
|
||||
new PageRequest(startIndex / SPUIDefinitions.PAGE_SIZE, SPUIDefinitions.PAGE_SIZE, sort));
|
||||
} else {
|
||||
targetBeans = getTargetManagement().findTargetByFilters(
|
||||
new PageRequest(startIndex / SPUIDefinitions.PAGE_SIZE, SPUIDefinitions.PAGE_SIZE, sort), status,
|
||||
searchText, distributionId, noTagClicked, targetTags);
|
||||
}
|
||||
for (final Target targ : targetBeans) {
|
||||
final ProxyTarget prxyTarget = new ProxyTarget();
|
||||
prxyTarget.setTargetIdName(targ.getTargetIdName());
|
||||
prxyTarget.setName(targ.getName());
|
||||
prxyTarget.setDescription(targ.getDescription());
|
||||
prxyTarget.setControllerId(targ.getControllerId());
|
||||
prxyTarget.setInstallationDate(targ.getTargetInfo().getInstallationDate());
|
||||
prxyTarget.setAddress(targ.getTargetInfo().getAddress());
|
||||
prxyTarget.setLastTargetQuery(targ.getTargetInfo().getLastTargetQuery());
|
||||
prxyTarget.setUpdateStatus(targ.getTargetInfo().getUpdateStatus());
|
||||
prxyTarget.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(targ.getLastModifiedAt()));
|
||||
prxyTarget.setCreatedDate(SPDateTimeUtil.getFormattedDate(targ.getCreatedAt()));
|
||||
prxyTarget.setCreatedAt(targ.getCreatedAt());
|
||||
prxyTarget.setCreatedByUser(HawkbitCommonUtil.getIMUser(targ.getCreatedBy()));
|
||||
prxyTarget.setModifiedByUser(HawkbitCommonUtil.getIMUser(targ.getLastModifiedBy()));
|
||||
@Override
|
||||
protected List<ProxyTarget> loadBeans(final int startIndex, final int count) {
|
||||
Slice<Target> targetBeans;
|
||||
final List<ProxyTarget> proxyTargetBeans = new ArrayList<>();
|
||||
if (pinnedDistId != null) {
|
||||
targetBeans = getTargetManagement().findTargetsAllOrderByLinkedDistributionSet(
|
||||
new OffsetBasedPageRequest(startIndex, SPUIDefinitions.PAGE_SIZE, sort), pinnedDistId,
|
||||
distributionId, status, searchText, noTagClicked, targetTags);
|
||||
} else if (null != targetFilterQuery) {
|
||||
targetBeans = getTargetManagement().findTargetsAll(targetFilterQuery,
|
||||
new PageRequest(startIndex / SPUIDefinitions.PAGE_SIZE, SPUIDefinitions.PAGE_SIZE, sort));
|
||||
} else if (!anyFilterSelected()) {
|
||||
targetBeans = getTargetManagement().findTargetsAll(
|
||||
new PageRequest(startIndex / SPUIDefinitions.PAGE_SIZE, SPUIDefinitions.PAGE_SIZE, sort));
|
||||
} else {
|
||||
targetBeans = getTargetManagement().findTargetByFilters(
|
||||
new PageRequest(startIndex / SPUIDefinitions.PAGE_SIZE, SPUIDefinitions.PAGE_SIZE, sort), status,
|
||||
searchText, distributionId, noTagClicked, targetTags);
|
||||
}
|
||||
for (final Target targ : targetBeans) {
|
||||
final ProxyTarget prxyTarget = new ProxyTarget();
|
||||
prxyTarget.setTargetIdName(targ.getTargetIdName());
|
||||
prxyTarget.setName(targ.getName());
|
||||
prxyTarget.setDescription(targ.getDescription());
|
||||
prxyTarget.setControllerId(targ.getControllerId());
|
||||
prxyTarget.setInstallationDate(targ.getTargetInfo().getInstallationDate());
|
||||
prxyTarget.setAddress(targ.getTargetInfo().getAddress());
|
||||
prxyTarget.setLastTargetQuery(targ.getTargetInfo().getLastTargetQuery());
|
||||
prxyTarget.setUpdateStatus(targ.getTargetInfo().getUpdateStatus());
|
||||
prxyTarget.setLastModifiedDate(SPDateTimeUtil.getFormattedDate(targ.getLastModifiedAt()));
|
||||
prxyTarget.setCreatedDate(SPDateTimeUtil.getFormattedDate(targ.getCreatedAt()));
|
||||
prxyTarget.setCreatedAt(targ.getCreatedAt());
|
||||
prxyTarget.setCreatedByUser(HawkbitCommonUtil.getIMUser(targ.getCreatedBy()));
|
||||
prxyTarget.setModifiedByUser(HawkbitCommonUtil.getIMUser(targ.getLastModifiedBy()));
|
||||
|
||||
if (pinnedDistId == null) {
|
||||
prxyTarget.setInstalledDistributionSet(null);
|
||||
prxyTarget.setAssignedDistributionSet(null);
|
||||
} else {
|
||||
final Target target = getTargetManagement().findTargetByControllerIDWithDetails(targ.getControllerId());
|
||||
final DistributionSet installedDistributionSet = target.getTargetInfo().getInstalledDistributionSet();
|
||||
prxyTarget.setInstalledDistributionSet(installedDistributionSet);
|
||||
final DistributionSet assignedDistributionSet = target.getAssignedDistributionSet();
|
||||
prxyTarget.setAssignedDistributionSet(assignedDistributionSet);
|
||||
}
|
||||
if (pinnedDistId == null) {
|
||||
prxyTarget.setInstalledDistributionSet(null);
|
||||
prxyTarget.setAssignedDistributionSet(null);
|
||||
|
||||
prxyTarget.setUpdateStatus(targ.getTargetInfo().getUpdateStatus());
|
||||
prxyTarget.setLastTargetQuery(targ.getTargetInfo().getLastTargetQuery());
|
||||
prxyTarget.setTargetInfo(targ.getTargetInfo());
|
||||
prxyTarget.setPollStatusToolTip(
|
||||
HawkbitCommonUtil.getPollStatusToolTip(prxyTarget.getTargetInfo().getPollStatus(), getI18N()));
|
||||
proxyTargetBeans.add(prxyTarget);
|
||||
}
|
||||
return proxyTargetBeans;
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
|
||||
private Boolean isTagSelected() {
|
||||
if (targetTags == null && !noTagClicked) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
prxyTarget.setUpdateStatus(targ.getTargetInfo().getUpdateStatus());
|
||||
prxyTarget.setLastTargetQuery(targ.getTargetInfo().getLastTargetQuery());
|
||||
prxyTarget.setTargetInfo(targ.getTargetInfo());
|
||||
prxyTarget.setPollStatusToolTip(
|
||||
HawkbitCommonUtil.getPollStatusToolTip(prxyTarget.getTargetInfo().getPollStatus(), getI18N()));
|
||||
proxyTargetBeans.add(prxyTarget);
|
||||
}
|
||||
return proxyTargetBeans;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void saveBeans(final List<ProxyTarget> addedTargets, final List<ProxyTarget> modifiedTargets,
|
||||
final List<ProxyTarget> removedTargets) {
|
||||
// CRUD operations on Target will be done through repository methods
|
||||
}
|
||||
private Boolean isTagSelected() {
|
||||
if (targetTags == null && !noTagClicked) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private Boolean anyFilterSelected() {
|
||||
if (status == null && distributionId == null && Strings.isNullOrEmpty(searchText) && !isTagSelected()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void saveBeans(final List<ProxyTarget> addedTargets, final List<ProxyTarget> modifiedTargets,
|
||||
final List<ProxyTarget> removedTargets) {
|
||||
// CRUD operations on Target will be done through repository methods
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
final long totSize = getTargetManagement().countTargetsAll();
|
||||
long size;
|
||||
if (null != targetFilterQuery) {
|
||||
size = getTargetManagement().countTargetByTargetFilterQuery(targetFilterQuery);
|
||||
} else if (!anyFilterSelected()) {
|
||||
size = totSize;
|
||||
} else {
|
||||
size = getTargetManagement().countTargetByFilters(status, searchText, distributionId, noTagClicked,
|
||||
targetTags);
|
||||
}
|
||||
private Boolean anyFilterSelected() {
|
||||
if (status == null && distributionId == null && Strings.isNullOrEmpty(searchText) && !isTagSelected()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
final ManagementUIState tmpManagementUIState = getManagementUIState();
|
||||
tmpManagementUIState.setTargetsCountAll(totSize);
|
||||
if (size > SPUIDefinitions.MAX_TARGET_TABLE_ENTRIES) {
|
||||
tmpManagementUIState.setTargetsTruncated(size - SPUIDefinitions.MAX_TARGET_TABLE_ENTRIES);
|
||||
size = SPUIDefinitions.MAX_TARGET_TABLE_ENTRIES;
|
||||
} else {
|
||||
tmpManagementUIState.setTargetsTruncated(null);
|
||||
}
|
||||
@Override
|
||||
public int size() {
|
||||
final long totSize = getTargetManagement().countTargetsAll();
|
||||
long size;
|
||||
if (null != targetFilterQuery) {
|
||||
size = getTargetManagement().countTargetByTargetFilterQuery(targetFilterQuery);
|
||||
} else if (!anyFilterSelected()) {
|
||||
size = totSize;
|
||||
} else {
|
||||
size = getTargetManagement().countTargetByFilters(status, searchText, distributionId, noTagClicked,
|
||||
targetTags);
|
||||
}
|
||||
|
||||
return (int) size;
|
||||
}
|
||||
final ManagementUIState tmpManagementUIState = getManagementUIState();
|
||||
tmpManagementUIState.setTargetsCountAll(totSize);
|
||||
if (size > SPUIDefinitions.MAX_TARGET_TABLE_ENTRIES) {
|
||||
tmpManagementUIState.setTargetsTruncated(size - SPUIDefinitions.MAX_TARGET_TABLE_ENTRIES);
|
||||
size = SPUIDefinitions.MAX_TARGET_TABLE_ENTRIES;
|
||||
} else {
|
||||
tmpManagementUIState.setTargetsTruncated(null);
|
||||
}
|
||||
|
||||
private TargetManagement getTargetManagement() {
|
||||
if (targetManagement == null) {
|
||||
targetManagement = SpringContextHelper.getBean(TargetManagement.class);
|
||||
}
|
||||
return targetManagement;
|
||||
}
|
||||
return (int) size;
|
||||
}
|
||||
|
||||
private ManagementUIState getManagementUIState() {
|
||||
if (managementUIState == null) {
|
||||
managementUIState = SpringContextHelper.getBean(ManagementUIState.class);
|
||||
}
|
||||
return managementUIState;
|
||||
}
|
||||
private TargetManagement getTargetManagement() {
|
||||
if (targetManagement == null) {
|
||||
targetManagement = SpringContextHelper.getBean(TargetManagement.class);
|
||||
}
|
||||
return targetManagement;
|
||||
}
|
||||
|
||||
private I18N getI18N() {
|
||||
if (i18N == null) {
|
||||
i18N = SpringContextHelper.getBean(I18N.class);
|
||||
}
|
||||
return i18N;
|
||||
}
|
||||
private ManagementUIState getManagementUIState() {
|
||||
if (managementUIState == null) {
|
||||
managementUIState = SpringContextHelper.getBean(ManagementUIState.class);
|
||||
}
|
||||
return managementUIState;
|
||||
}
|
||||
|
||||
private I18N getI18N() {
|
||||
if (i18N == null) {
|
||||
i18N = SpringContextHelper.getBean(I18N.class);
|
||||
}
|
||||
return i18N;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -108,6 +112,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;
|
||||
@@ -30,11 +33,85 @@ public class ProxyRollout extends Rollout {
|
||||
private Long numberOfGroups;
|
||||
|
||||
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;
|
||||
|
||||
@@ -136,6 +136,11 @@ public class RolloutBeanQuery extends AbstractBeanQuery<ProxyRollout> {
|
||||
final TotalTargetCountStatus totalTargetCountActionStatus = rollout.getTotalTargetCountStatus();
|
||||
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);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
@@ -106,6 +107,9 @@ public final class HawkbitCommonUtil {
|
||||
private static final String TARGET_TAG_DROP_REMOVE_SCRIPT = "var m = document.getElementById('show-filter-drop-hint'); if(m) { document.head.removeChild(m); } ";
|
||||
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