diff --git a/core/src/main/kotlin/de/otto/babbage/core/loggers/LoggerController.kt b/core/src/main/kotlin/de/otto/babbage/core/loggers/LoggerController.kt index 14dd52e..9e16332 100644 --- a/core/src/main/kotlin/de/otto/babbage/core/loggers/LoggerController.kt +++ b/core/src/main/kotlin/de/otto/babbage/core/loggers/LoggerController.kt @@ -1,6 +1,5 @@ package de.otto.babbage.core.loggers -import org.springframework.beans.factory.annotation.Value import org.springframework.boot.actuate.logging.LoggersEndpoint import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.stereotype.Controller @@ -11,17 +10,11 @@ import org.springframework.web.bind.annotation.RequestMapping @Controller @RequestMapping(path = ["\${management.endpoints.web.base-path}/logger"]) @ConditionalOnProperty("management.endpoints.loggers.enabled", havingValue = "true", matchIfMissing = false) -class LoggerController( - val loggersEndpoint: LoggersEndpoint, - @Value("\${spring.webflux.base-path:}") val basePath: String, - @Value("\${management.endpoints.web.base-path}") val managementBasePath: String -) { +class LoggerController(val loggersEndpoint: LoggersEndpoint) { @GetMapping suspend fun listLoggers(model: Model): String { model.addAttribute("loggers", loggersEndpoint.loggers()) - model.addAttribute("basePath", basePath) - model.addAttribute("managementBasePath", managementBasePath) return "logger-console" } } diff --git a/core/src/main/kotlin/de/otto/babbage/core/status/GlobalModelAttributes.kt b/core/src/main/kotlin/de/otto/babbage/core/status/GlobalModelAttributes.kt index 4fe68df..9d7fefa 100644 --- a/core/src/main/kotlin/de/otto/babbage/core/status/GlobalModelAttributes.kt +++ b/core/src/main/kotlin/de/otto/babbage/core/status/GlobalModelAttributes.kt @@ -9,12 +9,14 @@ import org.springframework.web.bind.annotation.ModelAttribute @ControllerAdvice class GlobalModelAttributes( private val webEndpointProperties: WebEndpointProperties, - @Value("\${info.app.name}") private val applicationName: String + @Value("\${info.app.name}") private val applicationName: String, + @Value("\${spring.webflux.base-path:}") val basePath: String, ) { @ModelAttribute fun addAttributes(model: Model) { - model.addAttribute("webEndpointBasePath", webEndpointProperties.basePath) + model.addAttribute("managementBasePath", webEndpointProperties.basePath) + model.addAttribute("basePath", basePath) model.addAttribute("applicationName", applicationName) } diff --git a/core/src/main/kotlin/de/otto/babbage/core/status/StatusController.kt b/core/src/main/kotlin/de/otto/babbage/core/status/StatusController.kt index 7d1d579..ea9c858 100644 --- a/core/src/main/kotlin/de/otto/babbage/core/status/StatusController.kt +++ b/core/src/main/kotlin/de/otto/babbage/core/status/StatusController.kt @@ -17,7 +17,7 @@ class StatusController( @Autowired(required = false) private val gitProperties: GitProperties?, private val statusProperties: StatusProperties, - @Value("\${info.app.name}")private val applicationName: String + @Value("\${info.app.name}") private val applicationName: String ) { @GetMapping("\${management.endpoints.web.base-path}/status")