Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
:root {
--main-50: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade50())})]*/ #e8fbef;
--main-100: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade100())})]*/ #d0f7df;
--main-200: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade200())})]*/ #a1efbd;
--main-300: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade300())})]*/ #71e69c;
--main-400: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade400())})]*/ #41de7b;
--main-500: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade500())})]*/ #22c55e;
--main-600: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade600())})]*/ #1a9547;
--main-700: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade700())})]*/ #116530;
--main-800: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade800())})]*/ #09351a;
--main-900: /*[(${@cssColorUtils.hexToRgb(uiSettings.theme.palette.getShade900())})]*/ #010603;
--main-50: /*[(${cssColors.shade50Rgb})]*/ #e8fbef;
--main-100: /*[(${cssColors.shade100Rgb})]*/ #d0f7df;
--main-200: /*[(${cssColors.shade200Rgb})]*/ #a1efbd;
--main-300: /*[(${cssColors.shade300Rgb})]*/ #71e69c;
--main-400: /*[(${cssColors.shade400Rgb})]*/ #41de7b;
--main-500: /*[(${cssColors.shade500Rgb})]*/ #22c55e;
--main-600: /*[(${cssColors.shade600Rgb})]*/ #1a9547;
--main-700: /*[(${cssColors.shade700Rgb})]*/ #116530;
--main-800: /*[(${cssColors.shade800Rgb})]*/ #09351a;
--main-900: /*[(${cssColors.shade900Rgb})]*/ #010603;

--bg-color-start: /*[(${uiSettings.theme.palette.getShade300()})]*/ #71e69c;
--bg-color-stop: /*[(${uiSettings.theme.palette.getShade700()})]*/ #09351a;
--bg-color-start: /*[(${uiSettings.theme.palette.shade300})]*/ #71e69c;
--bg-color-stop: /*[(${uiSettings.theme.palette.shade700})]*/ #09351a;
}

.bg-color-start {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.springframework.http.MediaType;
import org.springframework.web.reactive.config.WebFluxConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.thymeleaf.spring6.dialect.SpringStandardDialect;
import org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.templatemode.TemplateMode;

Expand Down Expand Up @@ -95,6 +96,13 @@ public CssColorUtils cssColorUtils() {
return new CssColorUtils();
}

@Bean
public SpringStandardDialect springStandardDialect() {
SpringStandardDialect dialect = new SpringStandardDialect();
dialect.setEnableSpringELCompiler(true);
return dialect;
}

@Bean
@ConditionalOnMissingBean
public UiController homeUiController(UiExtensions uiExtensions) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.PollTimer;
import de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties.UiTheme;
import de.codecentric.boot.admin.server.ui.config.CssColorUtils;
import de.codecentric.boot.admin.server.ui.extensions.UiExtension;
import de.codecentric.boot.admin.server.ui.extensions.UiExtensions;
import de.codecentric.boot.admin.server.web.AdminController;
Expand All @@ -50,10 +51,13 @@ public class UiController {

private final Settings uiSettings;

public UiController(String publicUrl, UiExtensions uiExtensions, Settings uiSettings) {
private final CssColorUtils cssColorUtils;

public UiController(String publicUrl, UiExtensions uiExtensions, Settings uiSettings, CssColorUtils cssColorUtils) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you have extended/changed the controller constructor, check all parts where this is used. I guess that at least the tests are broken.

Copy link
Copy Markdown
Contributor

@cdprete cdprete Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EIHEI2

Error: Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.47:validate (default) on project spring-boot-admin-server-ui: Formatting violations found in the following files:
Error: * /home/runner/work/spring-boot-admin/spring-boot-admin/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/web/UiController.java

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to build this PR locally ... compile error:

./mvnw clean install -DskipTests -Dspring-javaformat.skip=true

INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Dev/git/privat/spring-boot-admin/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java:[135,24] constructor UiController in class de.codecentric.boot.admin.server.ui.web.UiController cannot be applied to given types;
  required: java.lang.String,de.codecentric.boot.admin.server.ui.extensions.UiExtensions,de.codecentric.boot.admin.server.ui.web.UiController.Settings,de.codecentric.boot.admin.server.ui.config.CssColorUtils
  found:    java.lang.String,de.codecentric.boot.admin.server.ui.extensions.UiExtensions,de.codecentric.boot.admin.server.ui.web.UiController.Settings
  reason: actual and formal argument lists differ in length
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Spring Boot Admin 4.1.0-SNAPSHOT:
[INFO]
[INFO] Spring Boot Admin .................................. SUCCESS [  4.128 s]
[INFO] Spring Boot Admin Dependencies ..................... SUCCESS [  0.292 s]
[INFO] Spring Boot Admin Build ............................ SUCCESS [  0.453 s]
[INFO] Spring Boot Admin Server ........................... SUCCESS [01:18 min]
[INFO] Spring Boot Admin Server UI ........................ FAILURE [02:41 min]
[INFO] Spring Boot Admin Client ........................... SKIPPED
[INFO] Spring Boot Admin Docs ............................. SKIPPED
[INFO] Spring Boot Admin Server Cloud ..................... SKIPPED
[INFO] Spring Boot Admin Server Starter ................... SKIPPED
[INFO] Spring Boot Admin Client Starter ................... SKIPPED
[INFO] Spring Boot Admin Samples .......................... SKIPPED
[INFO] Spring Boot Admin Server custom UI ................. SKIPPED
[INFO] Spring Boot Admin Sample Servlet ................... SKIPPED
[INFO] Spring Boot Admin Sample Reactive .................. SKIPPED
[INFO] Spring Boot Admin Sample War ....................... SKIPPED
[INFO] Spring Boot Admin Sample Hazelcast ................. SKIPPED
[INFO] Spring Boot Admin Sample Eureka .................... SKIPPED
[INFO] Spring Boot Admin Sample Consul .................... SKIPPED
[INFO] Spring Boot Admin Sample Zookeeper ................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  04:05 min
[INFO] Finished at: 2026-04-20T11:08:36+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile (default-compile) on project spring-boot-admin-server-ui: Compilation failure
[ERROR] /D:/Dev/git/privat/spring-boot-admin/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java:[135,24] constructor UiController in class de.codecentric.boot.admin.server.ui.web.UiController cannot be applied to given types;
[ERROR]   required: java.lang.String,de.codecentric.boot.admin.server.ui.extensions.UiExtensions,de.codecentric.boot.admin.server.ui.web.UiController.Settings,de.codecentric.boot.admin.server.ui.config.CssColorUtils
[ERROR]   found:    java.lang.String,de.codecentric.boot.admin.server.ui.extensions.UiExtensions,de.codecentric.boot.admin.server.ui.web.UiController.Settings
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :spring-boot-admin-server-ui

AD001+hoehmann@dinmPF5F7PQ0 • 2026-04-20 • 11:08 • MINGW64 /d/Dev/git/privat/spring-boot-admin (fix-issue-47) •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed the expectations from @SteKoe were correct then.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahoehma the bean is already registered in the context.
Therefore, for the sake of testing, you can just add it as parameter in https://github.com/codecentric/spring-boot-admin/blob/master/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java#L100 and then pass that parameter to https://github.com/codecentric/spring-boot-admin/blob/master/spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java#L127.

Moreover, I would suggest you to run it with -Dmaven.test.skip=true instead of -DskipTests so that Maven doesn't even try to compile the tests (which maybe would fail as well).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the few compile errors by myself ... now I try to include the 4.1.0-SNAPSHOT into my project ... keep you informed asap :-)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm ... I'm using the snapshot now ... build is fine ... startup also fine .. but then when I try to open sba ...

2026-04-20 12:42:12 [          http-nio-9090-exec-9] ERROR - [] - org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet]:170 - Servlet.service() for servlet [dispatcherServlet] threw exception
org.thymeleaf.exceptions.ConfigurationException: Conflicting execution attribute. Two or more dialects specify an execution attribute with the same name "StandardExpressionParser".
	at org.thymeleaf.DialectSetConfiguration.build(DialectSetConfiguration.java:268)
	at org.thymeleaf.EngineConfiguration.<init>(EngineConfiguration.java:123)
	at org.thymeleaf.TemplateEngine.initialize(TemplateEngine.java:341)
	at org.thymeleaf.TemplateEngine.getConfiguration(TemplateEngine.java:411)
	at org.thymeleaf.spring6.view.ThymeleafView.renderFragment(ThymeleafView.java:265)
	at org.thymeleaf.spring6.view.ThymeleafView.render(ThymeleafView.java:193)
	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1305)
	at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1042)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:980)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:866)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1000)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:892)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:622)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:874)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:128)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:107)

Copy link
Copy Markdown
Contributor

@cdprete cdprete Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please try removing the spring standard dialect bean which was added in the PR?
I suspect there is already one coming from Spring Boot itself, therefore now Thymeleaf doesn't know which one to use.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Now its up and running - CSS issues gone! 👍

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.publicUrl = publicUrl;
this.uiExtensions = uiExtensions;
this.uiSettings = uiSettings;
this.cssColorUtils = cssColorUtils;
}

@ModelAttribute(value = "baseUrl", binding = false)
Expand Down Expand Up @@ -97,6 +101,23 @@ public Map<String, Object> getUser(@Nullable Principal principal) {
return emptyMap();
}

@ModelAttribute(value = "cssColors", binding = false)
public Map<String, String> getCssColors() {
var palette = uiSettings.getTheme().getPalette();
return Map.of(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the values here come from the configuration, I would personally just compute this map once in the constructor when the controller is created and just reuse that value every time the endpoint gets called.

That's just a small optimisation :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the properties may be changed at runtime (via Spring Boot Admin's Properties UI + Spring Cloud mechanisms), i tend to have it in a method instead of a constructor.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. I was not aware of this possibility.
Makes sense then.

"shade50Rgb", cssColorUtils.hexToRgb(palette.getShade50()),
"shade100Rgb", cssColorUtils.hexToRgb(palette.getShade100()),
"shade200Rgb", cssColorUtils.hexToRgb(palette.getShade200()),
"shade300Rgb", cssColorUtils.hexToRgb(palette.getShade300()),
"shade400Rgb", cssColorUtils.hexToRgb(palette.getShade400()),
"shade500Rgb", cssColorUtils.hexToRgb(palette.getShade500()),
"shade600Rgb", cssColorUtils.hexToRgb(palette.getShade600()),
"shade700Rgb", cssColorUtils.hexToRgb(palette.getShade700()),
"shade800Rgb", cssColorUtils.hexToRgb(palette.getShade800()),
"shade900Rgb", cssColorUtils.hexToRgb(palette.getShade900())
);
}

@GetMapping(path = "/", produces = MediaType.TEXT_HTML_VALUE)
@RegisterReflectionForBinding(String.class)
public String index() {
Expand Down
Loading