Skip to content

Commit 393370f

Browse files
ulischulteSteKoe
andauthored
break word on wallboard (#2694)
* break word on wallboard * fix: move custom.css to the end of imports --------- Co-authored-by: Stephan Köninger <[email protected]>
1 parent 3299fd7 commit 393370f

File tree

5 files changed

+81
-69
lines changed

5 files changed

+81
-69
lines changed

spring-boot-admin-server-ui/src/main/frontend/global.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ declare global {
1212
SBA: SBASettings;
1313
}
1414

15-
type JSExtension = {
15+
type Extension = {
1616
resourcePath: string;
1717
resourceLocation: string;
1818
};
@@ -79,7 +79,10 @@ declare global {
7979
name: string;
8080
[key: string]: any;
8181
};
82-
extensions: JSExtension[];
82+
extensions: {
83+
js: Extension[];
84+
css: Extension[];
85+
};
8386
csrf: {
8487
headerName: string;
8588
parameterName: string;

spring-boot-admin-server-ui/src/main/frontend/index.html

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,39 @@
1717
<!DOCTYPE html>
1818
<html class='h-full'>
1919
<head>
20-
<base href='/' th:href='${baseUrl}' />
21-
<meta charset='utf-8' />
22-
<title th:text='${uiSettings.title}'>Spring Boot Admin</title>
23-
<link
24-
rel='shortcut icon'
25-
th:href='${uiSettings.favicon}'
26-
type='image/png'
27-
/>
28-
<meta content='width=device-width, initial-scale=1' name='viewport' />
29-
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible' />
30-
<meta content='telephone=no,email=no' name='format-detection' />
31-
<meta
32-
content='#42d3a5'
33-
name='theme-color'
34-
th:content='${uiSettings.theme.color}'
35-
/>
20+
<base href='/' th:href='${baseUrl}'/>
21+
<meta charset='utf-8'/>
22+
<title th:text='${uiSettings.title}'>Spring Boot Admin</title>
23+
<link
24+
rel='shortcut icon'
25+
th:href='${uiSettings.favicon}'
26+
type='image/png'
27+
/>
28+
<meta content='width=device-width, initial-scale=1' name='viewport'/>
29+
<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'/>
30+
<meta content='telephone=no,email=no' name='format-detection'/>
31+
<meta
32+
content='#42d3a5'
33+
name='theme-color'
34+
th:content='${uiSettings.theme.color}'
35+
/>
3636

37-
<link href='./index.css' rel='stylesheet' />
38-
<link href='/variables.css' rel='stylesheet' />
37+
<link href='./index.css' rel='stylesheet'/>
38+
<link href='/variables.css' rel='stylesheet'/>
3939

40-
<link
41-
as='style'
42-
rel='preload'
43-
th:each='cssExtension : ${cssExtensions}'
44-
th:href="'extensions/' + ${cssExtension.resourcePath}"
45-
/>
46-
47-
<link
48-
rel='stylesheet'
49-
th:each='cssExtension : ${cssExtensions}'
50-
th:href="'extensions/' + ${cssExtension.resourcePath}"
51-
/>
52-
<script lang='javascript' src='sba-settings.js'></script>
53-
<link
54-
as='script'
55-
rel='prefetch'
56-
th:each='jsExtension : ${jsExtensions}'
57-
th:src="'extensions/' + ${jsExtension.resourcePath}"
58-
/>
40+
<link
41+
as='style'
42+
rel='preload'
43+
th:each='cssExtension : ${cssExtensions}'
44+
th:href="'extensions/' + ${cssExtension.resourcePath}"
45+
/>
46+
<script lang='javascript' src='sba-settings.js'></script>
47+
<link
48+
as="script"
49+
rel='preload'
50+
th:each='jsExtension : ${jsExtensions}'
51+
th:href="'extensions/' + ${jsExtension.resourcePath}"
52+
/>
5953
</head>
6054
<body class='h-full'>
6155
<div id='app'></div>

spring-boot-admin-server-ui/src/main/frontend/index.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,19 @@ globalThis.SBA.use = ({ install }) => {
6060
});
6161
};
6262

63-
sbaConfig.extensions.forEach((extension) => {
63+
sbaConfig.extensions.js.forEach((extension) => {
6464
const script = document.createElement('script');
6565
script.src = `extensions/${extension.resourcePath}`;
6666
document.head.appendChild(script);
6767
});
6868

69+
sbaConfig.extensions.css.forEach((extension) => {
70+
const link = document.createElement('link');
71+
link.rel = 'stylesheet';
72+
link.href = `extensions/${extension.resourcePath}`;
73+
document.head.appendChild(link);
74+
});
75+
6976
moment.locale(navigator.language.split('-')[0]);
7077

7178
if (process.env.NODE_ENV === 'development') {
@@ -114,7 +121,7 @@ const app = createApp({
114121
applicationsInitialized,
115122
error,
116123
t,
117-
})
124+
}),
118125
);
119126
},
120127
});

spring-boot-admin-server-ui/src/main/frontend/sba-settings.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
var SBA = {
2020
uiSettings: /*[[${uiSettings}]]*/ {},
2121
user: /*[[${user}]]*/ null,
22-
extensions: /*[[${jsExtensions}]]*/ [],
22+
extensions: {
23+
js: /*[[${jsExtensions}]]*/ [],
24+
css: /*[[${cssExtensions}]]*/ [],
25+
},
2326
csrf: {
2427
parameterName: /*[[${_csrf} ? ${_csrf.parameterName} : 'null']]*/ null,
2528
headerName: /*[[${_csrf} ? ${_csrf.headerName} : 'null']]*/ null,

spring-boot-admin-server-ui/src/main/frontend/views/wallboard/index.vue

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,18 @@
1616

1717
<template>
1818
<section class="wallboard section">
19-
<div class="flex gap-2 justify-end absolute w-full md:w-[28rem] top-14 right-0 bg-black/20 py-3 px-4 rounded-bl">
19+
<div
20+
class="flex gap-2 justify-end absolute w-full md:w-[28rem] top-14 right-0 bg-black/20 py-3 px-4 rounded-bl"
21+
>
2022
<sba-input
21-
class="flex-1"
2223
v-model="termFilter"
24+
class="flex-1"
2325
:placeholder="$t('term.filter')"
2426
name="filter"
2527
type="search"
2628
>
2729
<template #prepend>
28-
<font-awesome-icon icon="filter"/>
30+
<font-awesome-icon icon="filter" />
2931
</template>
3032
</sba-input>
3133

@@ -34,7 +36,7 @@
3436
v-model="statusFilter"
3537
class="relative focus:z-10 focus:ring-indigo-500 focus:border-indigo-500 block sm:text-sm border-gray-300 rounded"
3638
>
37-
<option selected value="none" v-text="$t('term.all')"/>
39+
<option selected value="none" v-text="$t('term.all')" />
3840
<optgroup :label="t('health.label')">
3941
<option
4042
v-for="status in healthStatus"
@@ -54,16 +56,18 @@
5456
severity="WARN"
5557
/>
5658

57-
<sba-loading-spinner
58-
v-if="!applicationsInitialized"
59-
/>
59+
<sba-loading-spinner v-if="!applicationsInitialized" />
6060

6161
<template v-if="applicationsInitialized">
62-
<div class="flex w-full h-full items-center text-center text-white text-xl"
63-
v-if="termFilter.length > 0 && applications.length === 0"
64-
v-text="t('term.no_results_for_term', {
65-
term: termFilter
66-
})"/>
62+
<div
63+
v-if="termFilter.length > 0 && applications.length === 0"
64+
class="flex w-full h-full items-center text-center text-white text-xl"
65+
v-text="
66+
t('term.no_results_for_term', {
67+
term: termFilter,
68+
})
69+
"
70+
/>
6771
<hex-mesh
6872
v-if="applicationsInitialized"
6973
:class-for-item="classForApplication"
@@ -72,12 +76,12 @@
7276
>
7377
<template #item="{ item: application }">
7478
<div :key="application.name" class="hex__body application">
75-
<div class="application__status-indicator"/>
79+
<div class="application__status-indicator" />
7680
<div class="application__header application__time-ago is-muted">
77-
<sba-time-ago :date="application.statusTimestamp"/>
81+
<sba-time-ago :date="application.statusTimestamp" />
7882
</div>
7983
<div class="application__body">
80-
<h1 class="application__name" v-text="application.name"/>
84+
<h1 class="application__name" v-text="application.name" />
8185
<p
8286
class="application__instances is-muted"
8387
v-text="
@@ -98,21 +102,21 @@
98102

99103
<script>
100104
import Fuse from 'fuse.js';
101-
import {computed, ref} from 'vue';
102-
import {useI18n} from 'vue-i18n';
105+
import { computed, ref } from 'vue';
106+
import { useI18n } from 'vue-i18n';
103107
104-
import {HealthStatus} from '@/HealthStatus';
105-
import {useApplicationStore} from '@/composables/useApplicationStore';
108+
import { HealthStatus } from '@/HealthStatus';
109+
import { useApplicationStore } from '@/composables/useApplicationStore';
106110
import hexMesh from '@/views/wallboard/hex-mesh';
107111
108112
export default {
109-
components: {hexMesh},
113+
components: { hexMesh },
110114
setup() {
111-
const {t} = useI18n();
115+
const { t } = useI18n();
112116
const termFilter = ref('');
113117
const statusFilter = ref('none');
114118
115-
const {applications, applicationsInitialized, error} =
119+
const { applications, applicationsInitialized, error } =
116120
useApplicationStore();
117121
118122
const fuse = computed(
@@ -122,7 +126,7 @@ export default {
122126
useExtendedSearch: true,
123127
threshold: 0.25,
124128
keys: ['name', 'buildVersion', 'instances.name', 'instances.id'],
125-
})
129+
}),
126130
);
127131
128132
const filteredApplications = computed(() => {
@@ -137,7 +141,7 @@ export default {
137141
function filterByStatus(result) {
138142
if (statusFilter.value !== 'none') {
139143
return result.filter(
140-
(application) => application.status === statusFilter.value
144+
(application) => application.status === statusFilter.value,
141145
);
142146
}
143147
@@ -193,17 +197,17 @@ export default {
193197
if (application.instances.length === 1) {
194198
this.$router.push({
195199
name: 'instances/details',
196-
params: {instanceId: application.instances[0].id},
200+
params: { instanceId: application.instances[0].id },
197201
});
198202
} else {
199203
this.$router.push({
200204
name: 'applications',
201-
params: {selected: application.name},
205+
params: { selected: application.name },
202206
});
203207
}
204208
},
205209
},
206-
install({viewRegistry}) {
210+
install({ viewRegistry }) {
207211
viewRegistry.addView({
208212
path: '/wallboard',
209213
name: 'wallboard',
@@ -237,6 +241,7 @@ export default {
237241
width: 100%;
238242
padding: 2.5%;
239243
color: #fff;
244+
word-break: break-word;
240245
font-size: 2em;
241246
font-weight: 600;
242247
line-height: 1.125;

0 commit comments

Comments
 (0)