Skip to content

Commit 53e7643

Browse files
committed
fix(#2595): show loading spinner after 250ms
1 parent a065961 commit 53e7643

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

spring-boot-admin-server-ui/src/main/frontend/views/instances/shell/sba-instance-section.vue

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<section :class="{ loading: showLoadingSpinner }">
2+
<section :class="{ loading: loading }" class="relative">
33
<slot name="before" />
44

55
<div
@@ -23,7 +23,7 @@
2323
class="mb-6 w-full"
2424
/>
2525

26-
<div v-if="showLoadingSpinner" class="loading-spinner-wrapper">
26+
<div v-if="loading" class="loading-spinner-wrapper">
2727
<div class="loading-spinner-wrapper-container">
2828
<sba-loading-spinner size="sm" />
2929
{{ $t('term.fetching_data') }}
@@ -60,20 +60,6 @@ export default {
6060
}),
6161
},
6262
},
63-
data() {
64-
return {
65-
showLoadingSpinner: false,
66-
debouncedLoader: null,
67-
};
68-
},
69-
watch: {
70-
loading: function (newVal) {
71-
window.clearTimeout(this.debouncedLoader);
72-
this.debouncedLoader = window.setTimeout(() => {
73-
this.showLoadingSpinner = newVal;
74-
}, 250);
75-
},
76-
},
7763
methods: {
7864
classNames: classNames,
7965
},
@@ -82,10 +68,26 @@ export default {
8268

8369
<style scoped>
8470
.loading-spinner-wrapper {
85-
@apply w-full h-full flex flex-col bg-black/30 absolute z-50 top-0 left-0 justify-center items-center backdrop-blur-sm;
71+
@apply absolute w-full h-screen flex flex-col z-50 top-0 left-0 justify-center items-center opacity-0;
72+
73+
animation-name: show;
74+
animation-duration: 0ms;
75+
animation-fill-mode: forwards;
76+
animation-delay: 250ms;
77+
animation-iteration-count: 1;
8678
}
8779
8880
.loading-spinner-wrapper-container {
89-
@apply rounded-md bg-black/30 py-4 px-5 flex w-auto gap-4 flex items-center text-white backdrop-blur;
81+
@apply rounded-md bg-black/30 py-4 px-5 flex w-auto gap-4 items-center text-white;
82+
}
83+
84+
@keyframes show {
85+
from {
86+
@apply opacity-0;
87+
}
88+
89+
to {
90+
@apply opacity-100;
91+
}
9092
}
9193
</style>

0 commit comments

Comments
 (0)