I am looking to add a custom tab to spring boot admin server following the documentation at http://codecentric.github.io/spring-boot-admin/2.1.1/#customizing-custom-views-in
Did a successfull try to add custom tab in Spring Boot Admin Server.
Pre Requisites :
Followed these steps(Generate-build the custom UI/Integrate Custom UI in server/Implement Endpoint at client side) :
Generate/build the custom UI:
cd <spring-boot-admin-custom-sample-ui-directory>
npm install
npm install package-name@version-number
) peer dependencies manually. These are npm package depdencies.exec-maven-plugin
and a target/dist directory would be created. If any error comes then try to resolve that. I was getting few errors like Node Version issue/vue-template-compiler not found. npm install vue-template-compiler@2.5.16
spring-boot-admin-sample-custom-ui
on local repo as well.Integrate custome UI in Admin Server
Just add new properties in application.properties(In order to inject new UI):
spring.boot.admin.ui.cache.no-cache=true
spring.boot.admin.ui.extension-resource-locations=file:spring-boot-admin-sample-custom-ui-directory-path/target/dist/
spring.boot.admin.ui.cache-templates=false
Add the dependency for spring-boot-admin-sample-custom-ui
in server pom.xml. This was built on step 4.
Start the Admin Server.
Implement Endpoint at client Side :
Add the below endpoint :
@Endpoint(id = "custom") public class CustomEndpoint { @ReadOperation public String getHello(){ return "Hello" ; } }
@Bean public CustomEndpoint customEndpoint() { return new CustomEndpoint(); }
Start the client. You should see something like below on Server :
This was all about a sample end point. You can write your own View and follow the similar steps. The views must be implemented as Vue.js components.
Hope this will ease down the process to add new custom tab in spring boot admin.