add version in login page
All checks were successful
Builder / Build-Project (push) Successful in 2m47s

This commit is contained in:
alex 2024-11-14 23:15:17 -05:00
parent b9320a3d6a
commit 50fd791449
2 changed files with 9 additions and 1 deletions

Binary file not shown.

View File

@ -2,6 +2,7 @@ package com.primefactorsolutions.views;
import com.vaadin.flow.component.html.Anchor; import com.vaadin.flow.component.html.Anchor;
import com.vaadin.flow.component.html.H1; import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.login.LoginForm; import com.vaadin.flow.component.login.LoginForm;
import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.BeforeEnterEvent; import com.vaadin.flow.router.BeforeEnterEvent;
@ -9,6 +10,9 @@ import com.vaadin.flow.router.BeforeEnterObserver;
import com.vaadin.flow.router.PageTitle; import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route; import com.vaadin.flow.router.Route;
import com.vaadin.flow.server.auth.AnonymousAllowed; import com.vaadin.flow.server.auth.AnonymousAllowed;
import com.vaadin.flow.theme.lumo.LumoUtility;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@Route("login") @Route("login")
@PageTitle("PFS Intra") @PageTitle("PFS Intra")
@ -17,7 +21,7 @@ public class LoginView extends VerticalLayout implements BeforeEnterObserver {
private final LoginForm login = new LoginForm(); private final LoginForm login = new LoginForm();
public LoginView() { public LoginView(@Autowired @Value("${git.commit.id.abbrev}") final String commitId) {
addClassName("login-view"); addClassName("login-view");
setSizeFull(); setSizeFull();
setAlignItems(Alignment.CENTER); setAlignItems(Alignment.CENTER);
@ -29,6 +33,10 @@ public class LoginView extends VerticalLayout implements BeforeEnterObserver {
add(new H1("PFS Intra")); add(new H1("PFS Intra"));
add(login); add(login);
add(new Anchor("/password-recovery", "Reset password?")); add(new Anchor("/password-recovery", "Reset password?"));
final Span version = new Span(String.format("v.%s", commitId));
version.addClassName(LumoUtility.FontSize.XSMALL);
add(version);
} }
@Override @Override