Skip to content

Commit

Permalink
fix(#2428): add missing property for enabling background wave (#2432)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteKoe committed May 3, 2023
1 parent b0731be commit 8e95938
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 45 deletions.
12 changes: 1 addition & 11 deletions spring-boot-admin-docs/src/site/asciidoc/customize_ui.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,10 @@ include::{samples-dir}/spring-boot-admin-sample-servlet/src/main/resources/appli
| `#42d3a5`
| Used in `meta` tag for setting theme color for user agents. Used to customize the display of the page or of the surrounding user interface.

| `spring.boot.admin.ui.theme.background.enable`
| `spring.boot.admin.ui.theme.background-enabled`
| `true`
| Disable background image in UI

| ``
spring.boot.admin.ui.theme.background.start
spring.boot.admin.ui.theme.background.stop
``
| ``
start: #E5AC9C
stop: #9F2A2A
``
| Start and stop colors of the background image.

| `spring.boot.admin.ui.theme.palette.[50,100,200,300,400,500,600,700,800,900]`
| ``
50: #E8FBEF
Expand Down
Original file line number Diff line number Diff line change
@@ -1,82 +1,79 @@
<template>
<div v-if="enabled" class="bg-wave">
<div v-if="backgroundEnabled" class="bg-wave">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 2000 240"
width="100%"
height="100%"
preserveAspectRatio="none"
viewBox="0 0 2000 240"
width="100%"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<linearGradient
:id="'bg-wave-a-' + id"
gradientTransform="matrix(1680, 0, 0, -916.53, -3571233, 453859.52)"
gradientUnits="userSpaceOnUse"
x1="2125.74"
y1="495.08"
x2="2126.93"
y1="495.08"
y2="495.08"
gradientTransform="matrix(1680, 0, 0, -916.53, -3571233, 453859.52)"
gradientUnits="userSpaceOnUse"
>
<stop offset="0" class="bg-color-start" />
<stop offset="1" class="bg-color-stop" />
<stop class="bg-color-start" offset="0" />
<stop class="bg-color-stop" offset="1" />
</linearGradient>
<linearGradient
:id="'bg-wave-b-' + id"
gradientTransform="matrix(1680, 0, 0, -925.87, -3571233, 458484.7)"
gradientUnits="userSpaceOnUse"
x1="2125.74"
y1="495.08"
x2="2126.93"
y1="495.08"
y2="495.08"
gradientTransform="matrix(1680, 0, 0, -925.87, -3571233, 458484.7)"
gradientUnits="userSpaceOnUse"
>
<stop offset="0" class="bg-color-start" />
<stop offset="1" class="bg-color-stop" />
<stop class="bg-color-start" offset="0" />
<stop class="bg-color-stop" offset="1" />
</linearGradient>
<linearGradient
:id="'bg-wave-c-' + id"
gradientTransform="matrix(1680, 0, 0, -956.3, -3571233, 473553.87)"
gradientUnits="userSpaceOnUse"
x1="2125.74"
y1="495.07"
x2="2126.93"
y1="495.07"
y2="495.07"
gradientTransform="matrix(1680, 0, 0, -956.3, -3571233, 473553.87)"
gradientUnits="userSpaceOnUse"
>
<stop offset="0" class="bg-color-start" />
<stop offset="1" class="bg-color-stop" />
<stop class="bg-color-start" offset="0" />
<stop class="bg-color-stop" offset="1" />
</linearGradient>
</defs>
<path
:style="`fill:url('#bg-wave-a-${id}')`"
d="M0,0V142.67q200,73.8,400,42.5T800,139q200-15,400,36.8t400-5.6q200-57.45,400-18.9V0Z"
style="opacity: 0.2"
:style="`fill:url('#bg-wave-a-${id}')`"
/>
<path
:style="`fill:url('#bg-wave-b-${id}')`"
d="M0,0V152.67q200,64.5,800,29.5a1115.6,1115.6,0,0,1,400,2.4q200,37.35,400,19.1a3681.66,3681.66,0,0,1,400-14.6q200,3.6,400-45.5V0Z"
style="opacity: 0.2"
:style="`fill:url('#bg-wave-b-${id}')`"
/>
<path
:style="`fill:url('#bg-wave-c-${id}')`"
d="M0,0V180.77q200,7.35,400-34.1T800,190q200,84.75,400-8.4t400,11.9q200,105,400-26.9V0Z"
style="opacity: 0.2"
:style="`fill:url('#bg-wave-c-${id}')`"
/>
</svg>
</div>
</template>

<script>
import sbaConfig from '@/sba-config';
export default {
name: 'SbaWave',
props: {
enabled: {
type: Boolean,
default: true,
},
},
data() {
return {
id: this._.uid,
backgroundEnabled: sbaConfig.uiSettings.theme.backgroundEnabled,
};
},
};
Expand Down
7 changes: 2 additions & 5 deletions spring-boot-admin-server-ui/src/main/frontend/sba-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ const DEFAULT_CONFIG = {
uiSettings: {
brand,
theme: {
background: {
start: '#84eacb',
stop: '#3abae0',
},
backgroundEnabled: true,
color: '#42d3a5',
},
notifications: {
Expand Down Expand Up @@ -59,4 +56,4 @@ const DEFAULT_CONFIG = {
},
};

export default merge(DEFAULT_CONFIG, global.SBA);
export default merge(DEFAULT_CONFIG, window.SBA);
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ public CacheControl toCacheControl() {
@Data
public static class UiTheme {

private Boolean backgroundEnabled = true;

private Palette palette = new Palette();

private String color = "#14615A";
Expand Down

0 comments on commit 8e95938

Please sign in to comment.