Skip to content

Commit ea657f9

Browse files
committed
chore(#2582): add example how to use SBA components in custom UI
1 parent df6726d commit ea657f9

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.mx-1 {
2+
margin-left: .5rem;
3+
margin-right: .5rem;
4+
}
5+
6+
.m-4 {
7+
margin: 2rem;
8+
}

spring-boot-admin-samples/spring-boot-admin-sample-custom-ui/src/custom.vue

+22-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,32 @@
1515
-->
1616

1717
<template>
18-
<pre v-text="stringify(applications, null, 4)" />
18+
<div class="m-4">
19+
<template v-for="application in applications" :key="application.name">
20+
<sba-panel :title="application.name">
21+
This application has the following instances:
22+
23+
<ul>
24+
<template v-for="instance in application.instances">
25+
<li>
26+
<span class="mx-1" v-text="instance.registration.name"></span>
27+
28+
<!-- SBA components are registered globally and can be used without importing them! -->
29+
<!-- They are defined in spring-boot-admin-server-ui -->
30+
<sba-status :status="instance.statusInfo.status" class="mx-1" />
31+
<sba-tag :value="instance.id" class="mx-1" label="id" />
32+
</li>
33+
</template>
34+
</ul>
35+
</sba-panel>
36+
</template>
37+
<pre v-text="applications"></pre>
38+
</div>
1939
</template>
2040

2141
<script>
2242
/* global SBA */
43+
import "./custom.css";
2344

2445
export default {
2546
setup() {

0 commit comments

Comments
 (0)