Erweiterungen
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>de.assecutor.votianlt</groupId>
|
<groupId>de.assecutor.votianlt</groupId>
|
||||||
<artifactId>votianlt</artifactId>
|
<artifactId>votianlt</artifactId>
|
||||||
<version>0.5.1</version>
|
<version>0.5.2</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
|||||||
@@ -1238,7 +1238,6 @@ public class AddJobView extends Main {
|
|||||||
qty.setMax(9999); // Set reasonable maximum
|
qty.setMax(9999); // Set reasonable maximum
|
||||||
qty.setWidth("10%");
|
qty.setWidth("10%");
|
||||||
qty.setRequiredIndicatorVisible(true);
|
qty.setRequiredIndicatorVisible(true);
|
||||||
qty.setPlaceholder("1");
|
|
||||||
// Add validation on blur
|
// Add validation on blur
|
||||||
qty.addBlurListener(e -> {
|
qty.addBlurListener(e -> {
|
||||||
if (qty.getValue() == null || qty.getValue() <= 0) {
|
if (qty.getValue() == null || qty.getValue() <= 0) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
|
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
|
||||||
import com.vaadin.flow.server.VaadinSession;
|
import com.vaadin.flow.server.VaadinSession;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
@Route("login")
|
@Route("login")
|
||||||
@@ -45,6 +46,9 @@ public class LoginView extends VerticalLayout implements BeforeEnterObserver, Af
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AuthenticationManager authenticationManager;
|
private AuthenticationManager authenticationManager;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment environment;
|
||||||
|
|
||||||
@Value("${app.security.two-factor.enabled:false}")
|
@Value("${app.security.two-factor.enabled:false}")
|
||||||
private boolean twoFactorEnabled;
|
private boolean twoFactorEnabled;
|
||||||
|
|
||||||
@@ -108,7 +112,19 @@ public class LoginView extends VerticalLayout implements BeforeEnterObserver, Af
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
private void init() {
|
private void init() {
|
||||||
// Set version after Spring injection
|
// Set version after Spring injection
|
||||||
versionSpan.setText("Version " + appVersion);
|
String[] activeProfiles = environment.getActiveProfiles();
|
||||||
|
String[] defaultProfiles = environment.getDefaultProfiles();
|
||||||
|
|
||||||
|
String profileInfo = "";
|
||||||
|
if (activeProfiles.length > 0) {
|
||||||
|
profileInfo = " (" + String.join(", ", activeProfiles) + ")";
|
||||||
|
} else if (defaultProfiles.length > 0) {
|
||||||
|
profileInfo = " (" + String.join(", ", defaultProfiles) + ")";
|
||||||
|
} else {
|
||||||
|
profileInfo = " (default)";
|
||||||
|
}
|
||||||
|
|
||||||
|
versionSpan.setText("Version " + appVersion + profileInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handlePasswordLogin(String username, String password) {
|
private void handlePasswordLogin(String username, String password) {
|
||||||
|
|||||||
10
src/main/resources/application-dev.properties
Normal file
10
src/main/resources/application-dev.properties
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Development-specific configuration
|
||||||
|
|
||||||
|
# MongoDB - Development database
|
||||||
|
spring.data.mongodb.uri=mongodb://192.168.180.25:27017/votianlt_dev
|
||||||
|
|
||||||
|
# Enable browser launch in development
|
||||||
|
vaadin.launch-browser=true
|
||||||
|
|
||||||
|
# Development logging levels
|
||||||
|
logging.level.de.assecutor.votianlt=DEBUG
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
server.port=${PORT:8080}
|
server.port=${PORT:8080}
|
||||||
server.address=0.0.0.0
|
server.address=0.0.0.0
|
||||||
|
|
||||||
|
# Default active profile
|
||||||
|
spring.profiles.active=dev
|
||||||
logging.level.org.atmosphere=warn
|
logging.level.org.atmosphere=warn
|
||||||
logging.level.de.assecutor.votianlt=INFO
|
logging.level.de.assecutor.votianlt=INFO
|
||||||
logging.level.de.assecutor.votianlt.controller.MessageController=DEBUG
|
logging.level.de.assecutor.votianlt.controller.MessageController=DEBUG
|
||||||
@@ -15,7 +18,7 @@ vaadin.allowed-packages=com.vaadin,org.vaadin,de.assecutor.votianlt
|
|||||||
# Open-in-view is only needed if you use lazy-loaded entities in your Flow views.
|
# Open-in-view is only needed if you use lazy-loaded entities in your Flow views.
|
||||||
spring.jpa.open-in-view=false
|
spring.jpa.open-in-view=false
|
||||||
|
|
||||||
# MongoDB - Development database by default
|
# MongoDB - Default configuration (override in profile-specific files)
|
||||||
spring.data.mongodb.uri=mongodb://192.168.180.25:27017/votianlt_dev
|
spring.data.mongodb.uri=mongodb://192.168.180.25:27017/votianlt_dev
|
||||||
spring.data.mongodb.auto-index-creation=true
|
spring.data.mongodb.auto-index-creation=true
|
||||||
spring.data.mongodb.socket-timeout=30000
|
spring.data.mongodb.socket-timeout=30000
|
||||||
|
|||||||
Reference in New Issue
Block a user