Skip to content

Commit 2c573e4

Browse files
committed
style: update health group icon and improve collapsible logic for better UX
1 parent 978bdc6 commit 2c573e4

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@
6666
>
6767
<font-awesome-icon
6868
v-if="isHealthGroupCollapsible(healthGroup.name)"
69-
icon="chevron-down"
70-
class="transition-[transform] mr-2 h-4"
69+
:icon="faChevronRight()"
70+
class="transition-transform mr-2 h-4"
7171
:class="{
72-
'-rotate-90': !isHealthGroupOpen(healthGroup.name),
72+
'rotate-90': isHealthGroupOpen(healthGroup.name),
7373
}"
7474
/>
7575
<span v-text="$t('instances.details.health_group.title')"></span
@@ -91,15 +91,16 @@
9191
</template>
9292

9393
<script lang="ts">
94-
import { faHistory, faScroll } from '@fortawesome/free-solid-svg-icons';
94+
import { faChevronRight, faScroll } from '@fortawesome/free-solid-svg-icons';
9595
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
96+
import { defineComponent } from 'vue';
9697
9798
import SbaAccordion from '@/components/sba-accordion.vue';
9899
99100
import Instance from '@/services/instance';
100101
import healthDetails from '@/views/instances/details/health-details';
101102
102-
export default {
103+
export default defineComponent({
103104
components: { SbaAccordion, FontAwesomeIcon, healthDetails },
104105
props: {
105106
instance: {
@@ -136,8 +137,8 @@ export default {
136137
faScroll() {
137138
return faScroll;
138139
},
139-
faHistory() {
140-
return faHistory;
140+
faChevronRight() {
141+
return faChevronRight;
141142
},
142143
reloadHealth() {
143144
const updateKey =
@@ -228,10 +229,13 @@ export default {
228229
name: string;
229230
data: { details: string } | undefined;
230231
}) => {
232+
const components =
233+
group.data?.details || group.data?.components;
234+
231235
return {
232236
[group.name]: {
233-
isOpen: group.data?.details === undefined,
234-
collapsible: group.data?.details !== undefined,
237+
isOpen: components === undefined,
238+
collapsible: components !== undefined,
235239
},
236240
};
237241
},
@@ -253,5 +257,5 @@ export default {
253257
}
254258
},
255259
},
256-
};
260+
});
257261
</script>

0 commit comments

Comments
 (0)