You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: custom-uis do not work as expected
closes#2304, #2255, #2221, #2219
* add documentation
* copy routes.txt file to target directory to include custom routes in HomepageForwardingFilter
* remove console.log
In case you need to inject custom HTTP headers into the requests made to the monitored application's actuator endpoints you can easily add a `HttpHeadersProvider`:
You can intercept and modify requests and responses made to the monitored application's actuator endpoints by implementing the `InstanceExchangeFilterFunction` interface.
5
+
This can be useful for auditing or adding some extra security checks.
In case you need to inject custom HTTP headers into the requests made to the monitored application's actuator endpoints you can easily add a `HttpHeadersProvider`:
You can intercept and modify requests and responses made to the monitored application's actuator endpoints by implementing the `InstanceExchangeFilterFunction` interface.
29
-
This can be useful for auditing or adding some extra security checks.
It is possible to add custom views to the ui. The views must be implemented as https://vuejs.org/[Vue.js] components.
14
+
It is possible to add custom views to the ui.
15
+
The views must be implemented as https://vuejs.org/[Vue.js] components.
50
16
51
17
The JavaScript-Bundle and CSS-Stylesheet must be placed on the classpath at `/META-INF/spring-boot-admin-server-ui/extensions/{name}/` so the server can pick them up.
52
18
The {github-src}/spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/[spring-boot-admin-sample-custom-ui] module contains a sample which has the necessary maven setup to build such a module.
53
19
54
-
The custom extension registers itself by calling `SBA.use()` and need to expose a `install()` function, which is called by the ui when setting up the routes.
55
-
The `install()` function receives the following parameters in order to register views and/or callbacks:
56
-
57
-
* Object referencing the {github-src}/spring-boot-admin-server-ui/src/main/frontend/viewRegistry.js[viewRegistry]
20
+
The custom extension registers itself by calling:
58
21
59
-
* Object referencing the {github-src}/spring-boot-admin-server-ui/src/main/frontend/store.js[applicationStore]
<3> The imported custom component, which will be rendered on the route.
30
+
<4> The handle for the custom view to be shown in the top navigation bar.
31
+
<5> Order for the view.
32
+
<6> Using `i18n.mergeLocaleMessage` allows to add custom translations.
62
33
63
-
* Object referencing the {github-src}/spring-boot-admin-server-ui/src/main/frontend/utils/axios.js[axios]
34
+
Views in the top navigation bar are sorted by ascending order.
64
35
65
-
If new top level routes are added to the frontend, they also must be known to the backend. Add a `/META-INF/spring-boot-admin-server-ui/extensions/{name}/routes.txt` with all your new toplevel routes (one route per line).
36
+
If new top level routes are added to the frontend, they also must be known to the backend.
37
+
Add a `/META-INF/spring-boot-admin-server-ui/extensions/{name}/routes.txt` with all your new toplevel routes (one route per line).
66
38
67
39
[[customizing-custom-views-top-level]]
68
40
==== Adding a Top-Level View ====
69
41
70
42
Here is a simple top level view just listing all registered applications:
<1> If you define a `applications` prop the component will receive all registered applications.
76
48
77
-
TIP: There are some helpful methods on the application and instances object available. Have a look at {github-src}/spring-boot-admin-server-ui/src/main/frontend/services/application.js[application.js] and {github-src}/spring-boot-admin-server-ui/src/main/frontend/services/instance.js[instance.js]
49
+
<1> By destructuring `applications` of `SBA.useApplicationStore()`, you have reactive access to registered applications.
50
+
51
+
TIP: There are some helpful methods on the application and instances object available.
52
+
Have a look at {github-src}/spring-boot-admin-server-ui/src/main/frontend/services/application.js[application.js] and {github-src}/spring-boot-admin-server-ui/src/main/frontend/services/instance.js[instance.js]
<1> The parent must be 'instances' in order to render the new custom view for a single instance.
122
96
<2> You can group views by assigning them to a group.
123
97
<3> If you add a `isEnabled` callback you can figure out dynamically if the view should be show for the particular instance.
124
-
<4> Register custom i18n translations
125
98
126
99
NOTE: You can override default views by putting the same group and name as the one you want to override.
127
100
128
101
=== Customizing Header Logo and Title ===
102
+
129
103
You can set custom information in the header (i.e. displaying staging information or company name) by using following configuration properties:
130
104
131
105
- **spring.boot.admin.ui.brand**: This HTML snippet is rendered in navigation header and defaults to `<img src="assets/img/icon-spring-boot-admin.svg"><span>Spring Boot Admin</span>`.
132
106
By default it shows the SBA logo followed by it's name.
133
107
If you want to show a custom logo you can set: `spring.boot.admin.ui.brand=<img src="custom/custom-icon.png">`.
134
-
Either you just add the image to your jar-file in `/META-INF/spring-boot-admin-server-ui/` (SBA registers a `ResourceHandler` for this location by default),
135
-
or you must ensure yourself that the image gets served correctly (e.g. by registering your own `ResourceHandler`)
108
+
Either you just add the image to your jar-file in `/META-INF/spring-boot-admin-server-ui/` (SBA registers a `ResourceHandler` for this location by default), or you must ensure yourself that the image gets served correctly (e.g. by registering your own `ResourceHandler`)
136
109
137
110
- **spring.boot.admin.ui.title**: Use this option to customize the browsers window title.
138
111
139
-
=== Customizing Colors ===
112
+
== Customizing Colors ==
113
+
140
114
You can provide a custom color theme to the application by overwriting the following properties:
| Define a color palette that affects the colors in sidebar view
183
-
(e.g shade `600` of palette is used as text color and shade `50` as background color.)
156
+
(e.g shade `600` of palette is used as text color and shade `50` as background color.)
184
157
185
158
|===
186
159
187
-
=== Customizing Login Logo ===
160
+
== Customizing Login Logo ==
161
+
188
162
You can set a custom image to be displayed on the login page.
189
163
190
164
1. Put the image in a resource location which is served via http (e.g. `/META-INF/spring-boot-admin-server-ui/assets/img/`).
191
165
2. Configure the icons to use using the following property:
192
-
- **spring.boot.admin.ui.login-icon**: Used as icon on login page. (e.g `assets/img/custom-login-icon.svg`)
166
+
- **spring.boot.admin.ui.login-icon**: Used as icon on login page. (e.g `assets/img/custom-login-icon.svg`)
193
167
194
-
=== Customizing Favicon ===
195
-
It is possible to use a custom favicon, which is also used for desktop notifications. Spring Boot Admin uses a different icon when one or more application is down.
168
+
== Customizing Favicon ==
169
+
170
+
It is possible to use a custom favicon, which is also used for desktop notifications.
171
+
Spring Boot Admin uses a different icon when one or more application is down.
196
172
197
173
1. Put the favicon (`.png` with at least 192x192 pixels) in a resource location which is served via http (e.g. `/META-INF/spring-boot-admin-server-ui/assets/img/`).
198
174
199
175
2. Configure the icons to use using the following properties:
200
-
- `spring.boot.admin.ui.favicon`: Used as default icon. (e.g `assets/img/custom-favicon.png`
201
-
- `spring.boot.admin.ui.favicon-danger`: Used when one or more service is down. (e.g `assets/img/custom-favicon-danger.png`)
176
+
- `spring.boot.admin.ui.favicon`: Used as default icon. (e.g `assets/img/custom-favicon.png`
177
+
- `spring.boot.admin.ui.favicon-danger`: Used when one or more service is down. (e.g `assets/img/custom-favicon-danger.png`)
178
+
179
+
== Customizing Available Languages ==
202
180
203
-
=== Customizing Available Languages ===
204
181
To filter languages to a subset of all supported languages:
205
182
206
183
- **spring.boot.admin.ui.available-languages**: Used as a filter of existing languages. (e.g `en,de` out of existing `de,en,fr,ko,pt-BR,ru,zh`)
0 commit comments