Skip to content

Commit eae2fed

Browse files
committed
chore: zwischenstand
1 parent 1d5d3cb commit eae2fed

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
*/
1616

1717
/* global SBA */
18-
import customEndpoint from "./custom-endpoint.vue";
19-
import customSubitem from "./custom-subitem.vue";
20-
import custom from "./custom.vue";
18+
import customEndpoint from './custom-endpoint.vue';
19+
import customSubitem from './custom-subitem.vue';
20+
import custom from './custom.vue';
21+
2122

2223
// tag::customization-ui-toplevel[]
2324
SBA.use({
@@ -78,6 +79,7 @@ SBA.use({
7879
});
7980
},
8081
configure({ i18n }) {
82+
console.log(i18n);
8183
i18n.mergeLocaleMessage("en", {
8284
// <4>
8385
sidebar: {
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { onBeforeMount, onBeforeUnmount, ref } from 'vue';
1+
import { ref } from 'vue';
22

33
import ApplicationStore from '../store.js';
44

@@ -10,7 +10,7 @@ export function createApplicationStore() {
1010
}
1111

1212
export function useApplicationStore() {
13-
const applications = ref(applicationStore.applications);
13+
const applications = ref([]);
1414
const applicationsInitialized = ref(false);
1515
const error = ref(null);
1616

@@ -20,8 +20,8 @@ export function useApplicationStore() {
2020
});
2121

2222
applicationStore.addEventListener('changed', (newApplications) => {
23-
applications.value = newApplications;
2423
applicationsInitialized.value = true;
24+
applications.value = newApplications;
2525
error.value = null;
2626
});
2727

@@ -30,13 +30,5 @@ export function useApplicationStore() {
3030
error.value = errorResponse;
3131
});
3232

33-
onBeforeMount(() => {
34-
return applicationStore.start();
35-
});
36-
37-
onBeforeUnmount(() => {
38-
return applicationStore.stop();
39-
});
40-
4133
return { applications, applicationsInitialized, error, applicationStore };
4234
}

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
import NotificationcenterPlugin from '@stekoe/vue-toast-notificationcenter';
1717
import moment from 'moment';
18-
import { createApp, h, reactive } from 'vue';
18+
import { createApp, h, onBeforeMount, onBeforeUnmount, reactive } from 'vue';
1919
import { useI18n } from 'vue-i18n';
2020

2121

@@ -72,6 +72,14 @@ const app = createApp({
7272
t,
7373
});
7474

75+
onBeforeMount(() => {
76+
applicationStore.start();
77+
})
78+
79+
onBeforeUnmount(() => {
80+
applicationStore.stop();
81+
})
82+
7583
return () => h(sbaShell, props);
7684
},
7785
});
@@ -90,10 +98,10 @@ installables.forEach((view) => {
9098
try {
9199
view.configure
92100
? view.configure({
93-
vue,
94-
i18n: vue.$i18n,
95-
axios,
96-
})
101+
vue,
102+
i18n: vue.$i18n,
103+
axios,
104+
})
97105
: void 0;
98106
} catch (e) {
99107
console.error(`Error configuring view ${view}`, e);

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
</p>
2222
<hex-mesh
2323
v-if="applicationsInitialized"
24-
:items="applications"
2524
:class-for-item="classForApplication"
25+
:items="applications"
2626
@click="select"
2727
>
2828
<template #item="{ item: application }">
@@ -36,7 +36,7 @@
3636
<p
3737
class="application__instances is-muted"
3838
v-text="
39-
$tc('wallboard.instances_count', application.instances.length)
39+
$t('wallboard.instances_count', application.instances.length)
4040
"
4141
/>
4242
</div>
@@ -62,14 +62,10 @@ export default {
6262
type: Error,
6363
default: null,
6464
},
65-
applicationsInitialized: {
66-
type: Boolean,
67-
default: false,
68-
},
6965
},
7066
setup() {
71-
const { applications } = useApplicationStore();
72-
return { applications };
67+
const { applications, applicationsInitialized } = useApplicationStore();
68+
return { applications, applicationsInitialized };
7369
},
7470
methods: {
7571
classForApplication(application) {
@@ -128,6 +124,7 @@ export default {
128124
height: calc(100vh - 52px);
129125
width: 100%;
130126
}
127+
131128
.wallboard .application {
132129
color: #f5f5f5;
133130
font-size: 1em;
@@ -138,6 +135,7 @@ export default {
138135
display: flex;
139136
flex-direction: column;
140137
}
138+
141139
.wallboard .application__name {
142140
width: 100%;
143141
padding: 2.5%;
@@ -146,15 +144,18 @@ export default {
146144
font-weight: 600;
147145
line-height: 1.125;
148146
}
147+
149148
.wallboard .application__version {
150149
color: #f5f5f5;
151150
font-size: 1.25em;
152151
line-height: 1.25;
153152
}
153+
154154
.wallboard .application__header {
155155
width: 90%;
156156
margin-bottom: 0.5em;
157157
}
158+
158159
.wallboard .application__footer {
159160
width: 90%;
160161
margin-top: 0.5em;

0 commit comments

Comments
 (0)