Skip to content

Commit 3c34e39

Browse files
committed
chore: do not wrap tags to achieve a nicer ui result
1 parent bea308e commit 3c34e39

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/resources/application.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ spring:
4545
metadata:
4646
tags:
4747
environment: test
48+
de-service-test-1: A large content
49+
de-service-test-2: A large content
50+
de-service-test-3: A large content
51+
de-service-test-4: A large content
52+
de-service-test-5: A large content
53+
de-service-test-6: A large content
4854
kubectl.kubernetes.io/last-applied-configuration: '{"name":"jvm.threads.peak","description":"The peak live thread count since the Java virtual machine started or peak was reset","baseUnit":"threads","measurements":[{"statistic":"VALUE","value":64.0}],"availableTags":[]}'
4955
config:
5056
import: optional:configserver:http://localhost:8888/

spring-boot-admin-server-ui/src/main/frontend/components/sba-tag.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<template>
22
<span
3-
class="inline-flex leading-none rounded shadow-sm text-sm overflow-hidden"
43
:class="{
54
'py-1 border border-gray-300 bg-white': !small,
6-
'py-1 border text-xs': small,
5+
'py-1 border text-xs bg-white': small,
76
}"
7+
class="inline-flex leading-none rounded shadow-sm text-sm overflow-hidden"
88
>
99
<span
1010
v-if="label"
11-
class="inline-flex bg-sba-200 rounded text-sba-900 justify-center items-center transition-all"
1211
:class="{
1312
'py-1.5 px-2 ml-1': !small,
1413
'py-1.5 px-1.5 ml-1': small,
1514
}"
15+
class="inline-flex bg-sba-200 rounded text-sba-900 justify-center items-center transition-all whitespace-nowrap"
1616
v-text="label"
1717
/>
1818
<span
19-
class="inline-flex px-2 justify-center items-center whitespace-nowrap"
2019
:class="{
2120
'pl-2': !!label,
2221
'bg-white pl-1.5': small,
2322
}"
23+
class="inline-flex px-2 justify-center items-center whitespace-nowrap"
2424
v-text="value"
2525
/>
2626
</span>

spring-boot-admin-server-ui/src/main/frontend/components/sba-tags.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515
-->
1616

1717
<template>
18-
<div class="inline-flex gap-1">
18+
<div :class="classNames('inline-flex gap-1', { 'flex-wrap': wrap })">
1919
<template v-for="(value, key) in tags" :key="key">
20-
<sba-tag :small="small" :label="key" :value="value" />
20+
<sba-tag :label="key" :small="small" :value="value" />
2121
</template>
2222
</div>
2323
</template>
2424

2525
<script>
26+
import classNames from 'classnames';
27+
2628
export default {
2729
props: {
2830
tags: {
@@ -33,6 +35,13 @@ export default {
3335
type: Boolean,
3436
default: false,
3537
},
38+
wrap: {
39+
type: Boolean,
40+
default: true,
41+
},
42+
},
43+
methods: {
44+
classNames: classNames,
3645
},
3746
};
3847
</script>

spring-boot-admin-server-ui/src/main/frontend/views/applications/instances-list.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
>
2424
<div class="pr-3 md:w-16 text-center">
2525
<sba-status
26-
:status="instance.statusInfo.status"
2726
:date="instance.statusTimestamp"
27+
:status="instance.statusInfo.status"
2828
/>
2929
</div>
3030
<div class="flex-1">
@@ -40,14 +40,14 @@
4040
<span class="text-sm italic" v-text="instance.id" />
4141
</div>
4242
<div class="hidden xl:block w-1/4 overflow-x-scroll">
43-
<sba-tags :tags="instance.tags" :small="true" />
43+
<sba-tags :small="true" :tags="instance.tags" :wrap="false" />
4444
</div>
4545
<div
4646
class="hidden xl:block w-1/4 text-center"
4747
v-text="instance.buildVersion"
4848
/>
4949
<div class="instance-list-item__actions text-right">
50-
<slot name="actions" :instance="instance" />
50+
<slot :instance="instance" name="actions" />
5151
</div>
5252
</li>
5353
</template>

spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-hero.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<small><em v-text="instance.id" /></small>
99
</div>
1010
<div class="mt-4 text-center">
11-
<sba-tags v-if="instance" :tags="instance.tags" />
11+
<sba-tags v-if="instance" :tags="instance.tags" class="justify-center" />
1212
</div>
1313
</div>
1414
</template>

0 commit comments

Comments
 (0)