Fix on some minor UI glitches and improvements (#619)
* Fix small UI glitches. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Improved look and feel logout menue. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Gravatar icon disabled by default. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Non text. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove duplicate code. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Provide collections with more useful interface. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * i18n for menu items. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Code readibility. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix code glitches. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix logout query param. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove unused field. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix after change to optional. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove dead code. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -79,6 +79,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
|
import org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
|
||||||
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
|
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter;
|
||||||
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
|
import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint;
|
||||||
|
import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler;
|
||||||
import org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter;
|
import org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter;
|
||||||
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
|
import org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint;
|
||||||
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
|
import org.springframework.security.web.authentication.www.BasicAuthenticationFilter;
|
||||||
@@ -646,13 +647,16 @@ public class SecurityManagedConfiguration {
|
|||||||
httpSec.headers().contentSecurityPolicy(hawkbitSecurityProperties.getContentSecurityPolicy());
|
httpSec.headers().contentSecurityPolicy(hawkbitSecurityProperties.getContentSecurityPolicy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final SimpleUrlLogoutSuccessHandler simpleUrlLogoutSuccessHandler = new SimpleUrlLogoutSuccessHandler();
|
||||||
|
simpleUrlLogoutSuccessHandler.setTargetUrlParameter("login");
|
||||||
|
|
||||||
httpSec
|
httpSec
|
||||||
// UI
|
// UI
|
||||||
.authorizeRequests().antMatchers("/UI/login/**").permitAll().antMatchers("/UI/UIDL/**").permitAll()
|
.authorizeRequests().antMatchers("/UI/login/**").permitAll().antMatchers("/UI/UIDL/**").permitAll()
|
||||||
.anyRequest().authenticated().and()
|
.anyRequest().authenticated().and()
|
||||||
// UI login / logout
|
// UI login / logout
|
||||||
.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/UI/login/#/"))
|
.exceptionHandling().authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/UI/login/#/"))
|
||||||
.and().logout().logoutUrl("/UI/logout").logoutSuccessUrl("/UI/login/#/");
|
.and().logout().logoutUrl("/UI/logout").logoutSuccessHandler(simpleUrlLogoutSuccessHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public final class SpPermission {
|
|||||||
*
|
*
|
||||||
* @return all permission
|
* @return all permission
|
||||||
*/
|
*/
|
||||||
public static Collection<String> getAllAuthorities() {
|
public static List<String> getAllAuthorities() {
|
||||||
return getAllAuthorities(Collections.emptyList());
|
return getAllAuthorities(Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ public final class SpPermission {
|
|||||||
* roles which will excluded
|
* roles which will excluded
|
||||||
* @return all permissions
|
* @return all permissions
|
||||||
*/
|
*/
|
||||||
public static Collection<String> getAllAuthorities(final String... exclusionRoles) {
|
public static List<String> getAllAuthorities(final String... exclusionRoles) {
|
||||||
return getAllAuthorities(Arrays.asList(exclusionRoles));
|
return getAllAuthorities(Arrays.asList(exclusionRoles));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ public final class SpPermission {
|
|||||||
* roles which will excluded
|
* roles which will excluded
|
||||||
* @return all permissions
|
* @return all permissions
|
||||||
*/
|
*/
|
||||||
public static Collection<String> getAllAuthorities(final Collection<String> exclusionRoles) {
|
public static List<String> getAllAuthorities(final Collection<String> exclusionRoles) {
|
||||||
final List<String> allPermissions = new ArrayList<>();
|
final List<String> allPermissions = new ArrayList<>();
|
||||||
final Field[] declaredFields = SpPermission.class.getDeclaredFields();
|
final Field[] declaredFields = SpPermission.class.getDeclaredFields();
|
||||||
for (final Field field : declaredFields) {
|
for (final Field field : declaredFields) {
|
||||||
|
|||||||
@@ -20,25 +20,10 @@
|
|||||||
|
|
||||||
<inherits name="org.vaadin.tokenfield.TokenfieldWidgetset" />
|
<inherits name="org.vaadin.tokenfield.TokenfieldWidgetset" />
|
||||||
|
|
||||||
|
|
||||||
<inherits name="org.vaadin.alump.distributionbar.gwt.DistributionBarWidgetset" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<inherits name="org.vaadin.hene.flexibleoptiongroup.widgetset.FlexibleOptionGroupWidgetset" />
|
|
||||||
|
|
||||||
<inherits name="org.vaadin.alump.distributionbar.gwt.DistributionBarWidgetset" />
|
<inherits name="org.vaadin.alump.distributionbar.gwt.DistributionBarWidgetset" />
|
||||||
|
|
||||||
<inherits name="org.eclipse.hawkbit.ui.customrenderers.CustomRendererWidgetSet" />
|
<inherits name="org.eclipse.hawkbit.ui.customrenderers.CustomRendererWidgetSet" />
|
||||||
<inherits name="org.eclipse.hawkbit.ui.filtermanagement.TextFieldSuggestionBox" />
|
<inherits name="org.eclipse.hawkbit.ui.filtermanagement.TextFieldSuggestionBox" />
|
||||||
<inherits name="org.eclipse.hawkbit.ui.rollout.groupschart.GroupsPieChart" />
|
<inherits name="org.eclipse.hawkbit.ui.rollout.groupschart.GroupsPieChart" />
|
||||||
<inherits name="org.eclipse.hawkbit.ui.dd.CustomAcceptCriteria" />
|
<inherits name="org.eclipse.hawkbit.ui.dd.CustomAcceptCriteria" />
|
||||||
|
|
||||||
|
|
||||||
<inherits name="org.vaadin.hene.flexibleoptiongroup.widgetset.FlexibleOptionGroupWidgetset" />
|
|
||||||
|
|
||||||
<inherits name="org.vaadin.alump.distributionbar.gwt.DistributionBarWidgetset" />
|
|
||||||
|
|
||||||
</module>
|
</module>
|
||||||
|
|||||||
@@ -21,6 +21,16 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||||||
public class UiProperties implements Serializable {
|
public class UiProperties implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private boolean gravatar;
|
||||||
|
|
||||||
|
public boolean isGravatar() {
|
||||||
|
return gravatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGravatar(final boolean gravatar) {
|
||||||
|
this.gravatar = gravatar;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demo account login information.
|
* Demo account login information.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -30,7 +32,12 @@ import com.vaadin.spring.annotation.UIScope;
|
|||||||
@Order(500)
|
@Order(500)
|
||||||
public class UploadArtifactViewMenuItem extends AbstractDashboardMenuItemNotification {
|
public class UploadArtifactViewMenuItem extends AbstractDashboardMenuItemNotification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4096851897640769726L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
UploadArtifactViewMenuItem(final VaadinMessageSource i18n) {
|
||||||
|
super(i18n);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getViewName() {
|
public String getViewName() {
|
||||||
@@ -44,12 +51,12 @@ public class UploadArtifactViewMenuItem extends AbstractDashboardMenuItemNotific
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaption() {
|
public String getDashboardCaption() {
|
||||||
return "Upload";
|
return getI18n().getMessage("dashboard.upload.caption");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaptionLong() {
|
public String getDashboardCaptionLong() {
|
||||||
return "Upload Management";
|
return getI18n().getMessage("dashboard.upload.caption-long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -155,6 +155,22 @@ public final class UserDetailsFormatter {
|
|||||||
return trimAndFormatDetail(userPrincipal.getTenant(), 8);
|
return trimAndFormatDetail(userPrincipal.getTenant(), 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format the current tenant. The information is loaded by the current
|
||||||
|
* session information.
|
||||||
|
*
|
||||||
|
* @return the formatted user name (max 8 characters) can be <null>
|
||||||
|
*/
|
||||||
|
public static Optional<String> getCurrentTenant() {
|
||||||
|
final UserDetails userDetails = getCurrentUser();
|
||||||
|
if (!(userDetails instanceof UserPrincipal)) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
final UserPrincipal userPrincipal = (UserPrincipal) userDetails;
|
||||||
|
return Optional.of(userPrincipal.getTenant().trim());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return logged in users Email address
|
* @return logged in users Email address
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ public abstract class AbstractDistributionSetDetails
|
|||||||
detailsTabLayout.removeAllComponents();
|
detailsTabLayout.removeAllComponents();
|
||||||
|
|
||||||
final Label typeLabel = SPUIComponentProvider
|
final Label typeLabel = SPUIComponentProvider
|
||||||
.createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type);
|
.createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type == null ? "" : type);
|
||||||
typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
|
typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
|
||||||
detailsTabLayout.addComponent(typeLabel);
|
detailsTabLayout.addComponent(typeLabel);
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@ public abstract class AbstractDistributionSetDetails
|
|||||||
|
|
||||||
private String getMigrationRequiredValue(final Boolean isMigrationRequired) {
|
private String getMigrationRequiredValue(final Boolean isMigrationRequired) {
|
||||||
if (isMigrationRequired == null) {
|
if (isMigrationRequired == null) {
|
||||||
return null;
|
return "";
|
||||||
}
|
}
|
||||||
return isMigrationRequired.equals(Boolean.TRUE) ? getI18n().getMessage("label.yes")
|
return isMigrationRequired.equals(Boolean.TRUE) ? getI18n().getMessage("label.yes")
|
||||||
: getI18n().getMessage("label.no");
|
: getI18n().getMessage("label.no");
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -22,16 +24,18 @@ import com.vaadin.spring.annotation.UIScope;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu item for distributions view.
|
* Menu item for distributions view.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@UIScope
|
@UIScope
|
||||||
@Order(400)
|
@Order(400)
|
||||||
public class DistributionsViewMenuItem extends AbstractDashboardMenuItemNotification {
|
public class DistributionsViewMenuItem extends AbstractDashboardMenuItemNotification {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4048522766974227222L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
DistributionsViewMenuItem(final VaadinMessageSource i18n) {
|
||||||
|
super(i18n);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getViewName() {
|
public String getViewName() {
|
||||||
@@ -45,12 +49,12 @@ public class DistributionsViewMenuItem extends AbstractDashboardMenuItemNotifica
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaption() {
|
public String getDashboardCaption() {
|
||||||
return "Distributions";
|
return getI18n().getMessage("dashboard.distributions.caption");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaptionLong() {
|
public String getDashboardCaptionLong() {
|
||||||
return "Distributions Management";
|
return getI18n().getMessage("dashboard.distributions.caption-long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -21,17 +23,19 @@ import com.vaadin.spring.annotation.SpringComponent;
|
|||||||
import com.vaadin.spring.annotation.UIScope;
|
import com.vaadin.spring.annotation.UIScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Menu item for target filter management view.
|
* Menu item for target filter management view.
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@UIScope
|
@UIScope
|
||||||
@Order(300)
|
@Order(300)
|
||||||
public class FilterManagementViewMenuItem extends AbstractDashboardMenuItemNotification {
|
public class FilterManagementViewMenuItem extends AbstractDashboardMenuItemNotification {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1272853053031512243L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
FilterManagementViewMenuItem(final VaadinMessageSource i18n) {
|
||||||
|
super(i18n);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getViewName() {
|
public String getViewName() {
|
||||||
@@ -45,12 +49,12 @@ public class FilterManagementViewMenuItem extends AbstractDashboardMenuItemNotif
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaption() {
|
public String getDashboardCaption() {
|
||||||
return "Target Filters";
|
return getI18n().getMessage("dashboard.filters.caption");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaptionLong() {
|
public String getDashboardCaptionLong() {
|
||||||
return "Target Filter Management";
|
return getI18n().getMessage("dashboard.filters.caption-long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.ui.management;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.ui.menu.DashboardMenuItem;
|
import org.eclipse.hawkbit.ui.menu.DashboardMenuItem;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
|
||||||
import com.vaadin.ui.Label;
|
import com.vaadin.ui.Label;
|
||||||
|
|
||||||
@@ -23,6 +24,12 @@ public abstract class AbstractDashboardMenuItemNotification implements Dashboard
|
|||||||
|
|
||||||
private final Label notificationsLabel = new Label();
|
private final Label notificationsLabel = new Label();
|
||||||
|
|
||||||
|
private final VaadinMessageSource i18n;
|
||||||
|
|
||||||
|
protected AbstractDashboardMenuItemNotification(final VaadinMessageSource i18n) {
|
||||||
|
this.i18n = i18n;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNotificationUnreadValue(final AtomicInteger notificationUnread) {
|
public void setNotificationUnreadValue(final AtomicInteger notificationUnread) {
|
||||||
notificationsLabel.setValue(String.valueOf(notificationUnread.get()));
|
notificationsLabel.setValue(String.valueOf(notificationUnread.get()));
|
||||||
@@ -35,4 +42,7 @@ public abstract class AbstractDashboardMenuItemNotification implements Dashboard
|
|||||||
return notificationsLabel;
|
return notificationsLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected VaadinMessageSource getI18n() {
|
||||||
|
return i18n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -20,15 +22,18 @@ import com.vaadin.spring.annotation.SpringComponent;
|
|||||||
import com.vaadin.spring.annotation.UIScope;
|
import com.vaadin.spring.annotation.UIScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu item for deplyoment.
|
* Menu item for deployment.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@UIScope
|
@UIScope
|
||||||
@Order(100)
|
@Order(100)
|
||||||
public class DeploymentViewMenuItem extends AbstractDashboardMenuItemNotification {
|
public class DeploymentViewMenuItem extends AbstractDashboardMenuItemNotification {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final long serialVersionUID = 6112540239655168995L;
|
@Autowired
|
||||||
|
DeploymentViewMenuItem(final VaadinMessageSource i18n) {
|
||||||
|
super(i18n);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getViewName() {
|
public String getViewName() {
|
||||||
@@ -42,12 +47,12 @@ public class DeploymentViewMenuItem extends AbstractDashboardMenuItemNotificatio
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaption() {
|
public String getDashboardCaption() {
|
||||||
return "Deployment";
|
return getI18n().getMessage("dashboard.deployment.caption");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaptionLong() {
|
public String getDashboardCaptionLong() {
|
||||||
return "Deployment Management";
|
return getI18n().getMessage("dashboard.deployment.caption-long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import java.net.URI;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
import org.eclipse.hawkbit.repository.DeploymentManagement;
|
||||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||||
import org.eclipse.hawkbit.repository.TargetTagManagement;
|
|
||||||
import org.eclipse.hawkbit.repository.TargetManagement;
|
import org.eclipse.hawkbit.repository.TargetManagement;
|
||||||
|
import org.eclipse.hawkbit.repository.TargetTagManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
import org.eclipse.hawkbit.repository.model.Target;
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
@@ -141,9 +141,9 @@ public class TargetDetails extends AbstractTableDetailsLayout<Target> {
|
|||||||
getSelectedBaseEntity().getSecurityToken(),
|
getSelectedBaseEntity().getSecurityToken(),
|
||||||
SPDateTimeUtil.getFormattedDate(getSelectedBaseEntity().getLastTargetQuery()));
|
SPDateTimeUtil.getFormattedDate(getSelectedBaseEntity().getLastTargetQuery()));
|
||||||
|
|
||||||
populateDistributionDtls(installedDistLayout, deploymentManagement
|
|
||||||
.getAssignedDistributionSet(getSelectedBaseEntity().getControllerId()).orElse(null));
|
|
||||||
populateDistributionDtls(assignedDistLayout, deploymentManagement
|
populateDistributionDtls(assignedDistLayout, deploymentManagement
|
||||||
|
.getAssignedDistributionSet(getSelectedBaseEntity().getControllerId()).orElse(null));
|
||||||
|
populateDistributionDtls(installedDistLayout, deploymentManagement
|
||||||
.getInstalledDistributionSet(getSelectedBaseEntity().getControllerId()).orElse(null));
|
.getInstalledDistributionSet(getSelectedBaseEntity().getControllerId()).orElse(null));
|
||||||
} else {
|
} else {
|
||||||
updateDetailsLayout(null, null, null, null);
|
updateDetailsLayout(null, null, null, null);
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import org.eclipse.hawkbit.ui.utils.UIComponentIdProvider;
|
|||||||
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
import com.vaadin.server.Page;
|
import com.vaadin.server.Page;
|
||||||
@@ -59,6 +60,9 @@ public final class DashboardMenu extends CustomComponent {
|
|||||||
|
|
||||||
private static final String ID = "dashboard-menu";
|
private static final String ID = "dashboard-menu";
|
||||||
|
|
||||||
|
private static final String LOGOUT_BASE = "/UI/logout";
|
||||||
|
private static final String LOGIN_BASE = "/UI/login";
|
||||||
|
|
||||||
private final VaadinMessageSource i18n;
|
private final VaadinMessageSource i18n;
|
||||||
|
|
||||||
private final UiProperties uiProperties;
|
private final UiProperties uiProperties;
|
||||||
@@ -108,7 +112,7 @@ public final class DashboardMenu extends CustomComponent {
|
|||||||
final VerticalLayout dashboardMenuLayout = new VerticalLayout();
|
final VerticalLayout dashboardMenuLayout = new VerticalLayout();
|
||||||
dashboardMenuLayout.setSizeFull();
|
dashboardMenuLayout.setSizeFull();
|
||||||
final VerticalLayout menuContent = getMenuLayout();
|
final VerticalLayout menuContent = getMenuLayout();
|
||||||
menuContent.addComponent(buildUserMenu());
|
menuContent.addComponent(buildUserMenu(uiProperties));
|
||||||
menuContent.addComponent(buildToggleButton());
|
menuContent.addComponent(buildToggleButton());
|
||||||
|
|
||||||
final VerticalLayout menus = buildMenuItems();
|
final VerticalLayout menus = buildMenuItems();
|
||||||
@@ -177,34 +181,49 @@ public final class DashboardMenu extends CustomComponent {
|
|||||||
return links;
|
return links;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Resource getImage() {
|
private static Resource getImage(final boolean gravatar) {
|
||||||
|
if (!gravatar) {
|
||||||
|
return new ThemeResource("images/profile-pic-57px.jpg");
|
||||||
|
}
|
||||||
|
|
||||||
return UserDetailsFormatter.getCurrentUserEmail().map(email -> (Resource) new GravatarResource(email))
|
return UserDetailsFormatter.getCurrentUserEmail().map(email -> (Resource) new GravatarResource(email))
|
||||||
.orElse(new ThemeResource("images/profile-pic-57px.jpg"));
|
.orElse(new ThemeResource("images/profile-pic-57px.jpg"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Component buildUserMenu() {
|
private Component buildUserMenu(final UiProperties uiProperties) {
|
||||||
final MenuBar settings = new MenuBar();
|
final MenuBar settings = new MenuBar();
|
||||||
settings.addStyleName("user-menu");
|
settings.addStyleName("user-menu");
|
||||||
settings.setHtmlContentAllowed(true);
|
settings.setHtmlContentAllowed(true);
|
||||||
|
|
||||||
final MenuItem settingsItem = settings.addItem("", getImage(), null);
|
final MenuItem settingsItem = settings.addItem("", getImage(uiProperties.isGravatar()), null);
|
||||||
|
|
||||||
final String formattedTenant = UserDetailsFormatter.formatCurrentTenant();
|
final String formattedTenant = UserDetailsFormatter.formatCurrentTenant();
|
||||||
final String formattedUsername = UserDetailsFormatter.formatCurrentUsername();
|
|
||||||
String tenantAndUsernameHtml = "";
|
|
||||||
if (!StringUtils.isEmpty(formattedTenant)) {
|
if (!StringUtils.isEmpty(formattedTenant)) {
|
||||||
tenantAndUsernameHtml += formattedTenant + "<br>";
|
settingsItem.setText(formattedTenant);
|
||||||
|
UserDetailsFormatter.getCurrentTenant().ifPresent(tenant -> settingsItem.setDescription(i18n
|
||||||
|
.getMessage("menu.user.description", tenant, UserDetailsFormatter.getCurrentUser().getUsername())));
|
||||||
|
} else {
|
||||||
|
settingsItem.setText("...");
|
||||||
}
|
}
|
||||||
tenantAndUsernameHtml += formattedUsername;
|
|
||||||
settingsItem.setText(tenantAndUsernameHtml);
|
|
||||||
settingsItem.setDescription(formattedUsername);
|
|
||||||
settingsItem.setStyleName("user-menuitem");
|
settingsItem.setStyleName("user-menuitem");
|
||||||
|
|
||||||
settingsItem.addItem("Sign Out", selectedItem -> Page.getCurrent().setLocation("/UI/logout"));
|
final String logoutUrl = generateLogoutUrl();
|
||||||
|
|
||||||
|
settingsItem.addItem("Sign Out", selectedItem -> Page.getCurrent().setLocation(logoutUrl));
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String generateLogoutUrl() {
|
||||||
|
final UriComponentsBuilder logout = UriComponentsBuilder.fromPath(LOGOUT_BASE);
|
||||||
|
|
||||||
|
UserDetailsFormatter.getCurrentTenant().ifPresent(tenant -> logout.queryParam("login",
|
||||||
|
UriComponentsBuilder.fromPath(LOGIN_BASE).queryParam("tenant", tenant).build().toUriString()));
|
||||||
|
|
||||||
|
return logout.toUriString();
|
||||||
|
}
|
||||||
|
|
||||||
private Component buildToggleButton() {
|
private Component buildToggleButton() {
|
||||||
final Button valoMenuToggleButton = new Button("Menu", new MenuToggleClickListenerMyClickListener());
|
final Button valoMenuToggleButton = new Button("Menu", new MenuToggleClickListenerMyClickListener());
|
||||||
valoMenuToggleButton.setIcon(FontAwesome.LIST);
|
valoMenuToggleButton.setIcon(FontAwesome.LIST);
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -21,17 +23,19 @@ import com.vaadin.spring.annotation.SpringComponent;
|
|||||||
import com.vaadin.spring.annotation.UIScope;
|
import com.vaadin.spring.annotation.UIScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Menu item for rollout .
|
* Menu item for rollouts.
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
@SpringComponent
|
@SpringComponent
|
||||||
@UIScope
|
@UIScope
|
||||||
@Order(200)
|
@Order(200)
|
||||||
public class RolloutViewMenuItem extends AbstractDashboardMenuItemNotification {
|
public class RolloutViewMenuItem extends AbstractDashboardMenuItemNotification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6112540239655168995L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
RolloutViewMenuItem(final VaadinMessageSource i18n) {
|
||||||
|
super(i18n);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getViewName() {
|
public String getViewName() {
|
||||||
@@ -45,12 +49,12 @@ public class RolloutViewMenuItem extends AbstractDashboardMenuItemNotification {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaption() {
|
public String getDashboardCaption() {
|
||||||
return "Rollout";
|
return getI18n().getMessage("dashboard.rollouts.caption");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaptionLong() {
|
public String getDashboardCaptionLong() {
|
||||||
return "Rollout Management";
|
return getI18n().getMessage("dashboard.rollouts.caption-long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
import org.eclipse.hawkbit.im.authentication.SpPermission;
|
||||||
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
import org.eclipse.hawkbit.ui.management.AbstractDashboardMenuItemNotification;
|
||||||
|
import org.eclipse.hawkbit.ui.utils.VaadinMessageSource;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
|
|
||||||
import com.vaadin.server.FontAwesome;
|
import com.vaadin.server.FontAwesome;
|
||||||
@@ -28,7 +30,12 @@ import com.vaadin.spring.annotation.UIScope;
|
|||||||
@Order(700)
|
@Order(700)
|
||||||
public class TenantConfigurationDashboardViewMenuItem extends AbstractDashboardMenuItemNotification {
|
public class TenantConfigurationDashboardViewMenuItem extends AbstractDashboardMenuItemNotification {
|
||||||
|
|
||||||
private static final long serialVersionUID = 348659206461499664L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TenantConfigurationDashboardViewMenuItem(final VaadinMessageSource i18n) {
|
||||||
|
super(i18n);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getViewName() {
|
public String getViewName() {
|
||||||
@@ -42,12 +49,12 @@ public class TenantConfigurationDashboardViewMenuItem extends AbstractDashboardM
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaption() {
|
public String getDashboardCaption() {
|
||||||
return "System Config";
|
return getI18n().getMessage("dashboard.tenantconfig.caption");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDashboardCaptionLong() {
|
public String getDashboardCaptionLong() {
|
||||||
return "System Configuration";
|
return getI18n().getMessage("dashboard.tenantconfig.caption-long");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
|
||||||
*
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*/
|
|
||||||
// scss-lint:disable ImportantRule, PropertySortOrder
|
|
||||||
|
|
||||||
$view-padding: round($v-unit-size / 1.5) !default;
|
|
||||||
@mixin dashboard-dashboard-view {
|
|
||||||
.dashboard-view.dashboard-view {
|
|
||||||
padding: 1.4px;
|
|
||||||
overflow: auto;
|
|
||||||
.dashboard-panel-toolbar {
|
|
||||||
padding: 1px 0;
|
|
||||||
height: $v-unit-size + 2px;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
.dashboard-panels {
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
margin: 0 round($view-padding / -3);
|
|
||||||
|
|
||||||
//Style of each report widget
|
|
||||||
.card {
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
.v-menubar-menuitem-icon-only {
|
|
||||||
color: $button-icon-color;
|
|
||||||
}
|
|
||||||
.highcharts-background {
|
|
||||||
fill: $widget-bg;
|
|
||||||
}
|
|
||||||
.highcharts-legend > rect {
|
|
||||||
fill: $widget-bg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Each report widget style.Applying padding between the widgets
|
|
||||||
.dashboard-panel-slot {
|
|
||||||
padding-bottom: round($view-padding / 5)*2;
|
|
||||||
padding-left: round($view-padding / 5);
|
|
||||||
padding-right: round($view-padding / 5);
|
|
||||||
padding-top: 0;
|
|
||||||
min-height: 220px;
|
|
||||||
.card {
|
|
||||||
border: 1px solid $widget-border-color;
|
|
||||||
background-color: $widget-bg;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Maximized report widget style
|
|
||||||
.dashboard-panel-slot.max {
|
|
||||||
width: 100% !important;
|
|
||||||
height: 100% !important;
|
|
||||||
padding-top: 0;
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.dashboard-view {
|
|
||||||
@include width-range($max: 480px) {
|
|
||||||
padding-left: round($view-padding / 2);
|
|
||||||
padding-right: round($view-padding / 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Information table displayed when report widget is maximized
|
|
||||||
.info-table {
|
|
||||||
margin-right: 20px;
|
|
||||||
overflow-x: hidden;
|
|
||||||
overflow-y: auto;
|
|
||||||
font-size: $v-font-size--small;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Make information table visible when report widget is maximized
|
|
||||||
.info-table-show {
|
|
||||||
visibility: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Report widget caption style
|
|
||||||
.v-caption-report-caption {
|
|
||||||
margin-top: 4px;
|
|
||||||
color: $widget-caption-color;
|
|
||||||
padding-left: 10px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -55,7 +55,6 @@ $v-animations-enabled: true;
|
|||||||
@import 'customstyles/drop-hint';
|
@import 'customstyles/drop-hint';
|
||||||
@import 'customstyles/popup-window';
|
@import 'customstyles/popup-window';
|
||||||
@import 'customstyles/artifact-upload';
|
@import 'customstyles/artifact-upload';
|
||||||
@import 'customstyles/dashboardview';
|
|
||||||
@import 'customstyles/common';
|
@import 'customstyles/common';
|
||||||
@import 'customstyles/login';
|
@import 'customstyles/login';
|
||||||
@import 'customstyles/filter-layout-styles';
|
@import 'customstyles/filter-layout-styles';
|
||||||
@@ -92,7 +91,6 @@ $v-included-components: remove($v-included-components, form);
|
|||||||
@include drop-hint;
|
@include drop-hint;
|
||||||
@include popup-window;
|
@include popup-window;
|
||||||
@include artifact-upload;
|
@include artifact-upload;
|
||||||
@include dashboard-dashboard-view;
|
|
||||||
@include dashboard-common;
|
@include dashboard-common;
|
||||||
@include login;
|
@include login;
|
||||||
@include systemconfig;
|
@include systemconfig;
|
||||||
|
|||||||
@@ -11,6 +11,20 @@
|
|||||||
# This is the messages.properties file
|
# This is the messages.properties file
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
|
||||||
|
# Menu items
|
||||||
|
dashboard.upload.caption = Upload
|
||||||
|
dashboard.upload.caption-long = Upload Management
|
||||||
|
dashboard.tenantconfig.caption = System Config
|
||||||
|
dashboard.tenantconfig.caption-long = System Configuration
|
||||||
|
dashboard.distributions.caption = Distributions
|
||||||
|
dashboard.distributions.caption-long = Distributions Management
|
||||||
|
dashboard.filters.caption = Target Filters
|
||||||
|
dashboard.filters.caption-long = Target Filter Management
|
||||||
|
dashboard.deployment.caption = Deployment
|
||||||
|
dashboard.deployment.caption-long Deployment Management
|
||||||
|
dashboard.rollouts.caption = Rollout
|
||||||
|
dashboard.rollouts.caption-long = Rollout Management
|
||||||
|
|
||||||
# Button names prefix with - button
|
# Button names prefix with - button
|
||||||
button.save = Save
|
button.save = Save
|
||||||
button.delete = Delete
|
button.delete = Delete
|
||||||
@@ -579,7 +593,7 @@ label.rollout.calculating = Calculating groups ...
|
|||||||
#rollout - end
|
#rollout - end
|
||||||
|
|
||||||
#Menu
|
#Menu
|
||||||
menu.title = Software Provisioning
|
menu.user.description = Tenant: {0} User: {1}
|
||||||
|
|
||||||
#Target Filter Management
|
#Target Filter Management
|
||||||
breadcrumb.target.filter.custom.filters = Custom Filters
|
breadcrumb.target.filter.custom.filters = Custom Filters
|
||||||
|
|||||||
Reference in New Issue
Block a user