Basic implementation for files app
This commit is contained in:
@@ -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