Skip to content

Commit 1c6b4ff

Browse files
herley-shaoriherleySteKoe
authored
fix: prevent audit log view from shaking on periodic refresh (#5211)
Co-authored-by: herley <herleys@xlsmart.co.id> Co-authored-by: Stephan Köninger <stephan.koeninger@codecentric.de>
1 parent 2047f8a commit 1c6b4ff

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

  • spring-boot-admin-server-ui/src/main/frontend/views/instances/auditevents

spring-boot-admin-server-ui/src/main/frontend/views/instances/auditevents/index.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export default {
124124
},
125125
data: () => ({
126126
isLoading: false,
127+
hasLoadedInitially: false,
127128
error: null,
128129
events: [],
129130
filter: {
@@ -148,14 +149,19 @@ export default {
148149
return moment(value, moment.HTML5_FMT.DATETIME_LOCAL, true).toDate();
149150
},
150151
async fetchAuditevents() {
151-
this.isLoading = true;
152-
const response = await this.instance.fetchAuditevents(this.filter);
153-
const converted = response.data.events.map(
154-
(event) => new Auditevent(event),
155-
);
156-
converted.reverse();
157-
this.isLoading = false;
158-
return converted;
152+
this.isLoading = !this.hasLoadedInitially;
153+
154+
try {
155+
const response = await this.instance.fetchAuditevents(this.filter);
156+
const converted = response.data.events.map(
157+
(event) => new Auditevent(event),
158+
);
159+
converted.reverse();
160+
return converted;
161+
} finally {
162+
this.isLoading = false;
163+
this.hasLoadedInitially = true;
164+
}
159165
},
160166
createSubscription() {
161167
this.filterChanged = new Subject();

0 commit comments

Comments
 (0)