Basic implementation for files app
This commit is contained in:
26
web-container-config/pom.xml
Normal file
26
web-container-config/pom.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<version>1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>web-container-config</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- Spring -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,43 @@
|
||||
package de.nbscloud.webcontainer.shared.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.ui.Model;
|
||||
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "nbs-cloud.web-container.shared")
|
||||
@PropertySource("classpath:/config/shared-application.properties")
|
||||
public class WebContainerSharedConfig {
|
||||
private String version;
|
||||
private boolean darkMode;
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public boolean isDarkMode() {
|
||||
return darkMode;
|
||||
}
|
||||
|
||||
public void setDarkMode(boolean darkMode) {
|
||||
this.darkMode = darkMode;
|
||||
}
|
||||
|
||||
public void addDefaults(Model model) {
|
||||
addDarkMode(model);
|
||||
addVersionAttribute(model);
|
||||
}
|
||||
|
||||
private final void addVersionAttribute(Model model) {
|
||||
model.addAttribute("nbsVersion", this.version);
|
||||
}
|
||||
|
||||
private final void addDarkMode(Model model) {
|
||||
model.addAttribute("darkMode", this.darkMode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
spring.profiles.active=@activeProfiles@
|
||||
|
||||
info.app.name=NoBullShit Cloud - web container config
|
||||
info.app.description=Config for web projects
|
||||
|
||||
nbs-cloud.web-container.shared.version=@project.version@
|
||||
|
||||
# Whether dark mode should be enabled by default
|
||||
# Possible values: true|false
|
||||
nbs-cloud.web-container.shared.darkMode=true
|
||||
Reference in New Issue
Block a user