Skip to content

Commit 6953b4d

Browse files
authored
feat(#4242): use info endpoint to gather additional information for process info (#4300)
1 parent e0d9400 commit 6953b4d

File tree

15 files changed

+380
-238
lines changed

15 files changed

+380
-238
lines changed

spring-boot-admin-server-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build-storybook": "storybook build",
1414
"lint": "eslint --ext .js,.ts,.vue src/main/frontend",
1515
"lint:fix": "eslint --ext .js,.ts,.vue --fix src/main/frontend",
16-
"format": "prettier src/main/frontend",
16+
"format": "prettier src/main/frontend --check",
1717
"format:fix": "prettier src/main/frontend --write"
1818
},
1919
"dependencies": {
Lines changed: 36 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<dl
3-
v-for="(value, key, index) in map"
3+
v-for="(value, key, index) in filteredMap"
44
:key="key"
55
class="px-4 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6"
66
:class="{ 'bg-white': index % 2 === 0, 'bg-gray-50': index % 2 !== 0 }"
@@ -17,25 +17,40 @@
1717
</dl>
1818
</template>
1919

20-
<script>
21-
export default {
22-
name: 'SbaKeyValueTable',
23-
props: {
24-
map: {
25-
type: Object,
26-
required: true,
27-
},
28-
},
29-
methods: {
30-
getSlotName(key, value) {
31-
return value?.id || key.replace(/[^a-zA-Z]/gi, '').toLowerCase();
32-
},
33-
getLabel(key, value) {
34-
return value?.label || key;
35-
},
36-
getValue(value) {
37-
return value?.value || value;
38-
},
39-
},
20+
<script setup lang="ts">
21+
import { computed } from 'vue';
22+
23+
const { map, skipNullValues = false } = defineProps<{
24+
map: Record<string, any>;
25+
skipNullValues?: boolean;
26+
}>();
27+
28+
const filteredMap = computed(() => {
29+
return Object.entries(map)
30+
.filter(([, value]) => {
31+
if (skipNullValues) {
32+
return value && value.value !== null;
33+
}
34+
return true;
35+
})
36+
.reduce(
37+
(acc, [key, value]) => {
38+
acc[key] = value;
39+
return acc;
40+
},
41+
{} as Record<string, any>,
42+
);
43+
});
44+
45+
const getSlotName = (key: string, value: any) => {
46+
return value?.id || key.replace(/[^a-zA-Z]/gi, '').toLowerCase();
47+
};
48+
49+
const getLabel = (key: string, value: any) => {
50+
return value?.label || key;
51+
};
52+
53+
const getValue = (value: any) => {
54+
return value?.value || value;
4055
};
4156
</script>

0 commit comments

Comments
 (0)