Skip to content

Commit 529a3c8

Browse files
committed
refactor: simplify update key logic by using instance ID directly
1 parent e37180a commit 529a3c8

5 files changed

Lines changed: 6 additions & 22 deletions

File tree

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ export default {
141141
},
142142
methods: {
143143
initCacheMetrics() {
144-
const updateKey =
145-
this.instance.version ??
146-
this.instance.statusTimestamp ??
147-
this.instance.id;
144+
const updateKey = this.instance.id;
148145
const firstInit = this.currentInstanceId === null;
149146
if (
150147
this.instance.id !== this.currentInstanceId ||

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,7 @@ export default {
106106
},
107107
methods: {
108108
initDatasourceMetrics() {
109-
const updateKey =
110-
this.instance.version ??
111-
this.instance.statusTimestamp ??
112-
this.instance.id;
109+
const updateKey = this.instance.id;
113110
const firstInit = this.currentInstanceId === null;
114111
if (
115112
this.instance.id !== this.currentInstanceId ||

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default defineComponent({
123123
error: null,
124124
current: null,
125125
chartData: [],
126-
currentInstanceId: null,
126+
currentInstanceId: '',
127127
currentInstanceUpdateKey: null,
128128
}),
129129
computed: {
@@ -146,10 +146,7 @@ export default defineComponent({
146146
},
147147
methods: {
148148
initMetrics() {
149-
const updateKey =
150-
this.instance.version ??
151-
this.instance.statusTimestamp ??
152-
this.instance.id;
149+
const updateKey = this.instance.id;
153150
const firstInit = this.currentInstanceId === null;
154151
if (
155152
this.instance.id !== this.currentInstanceId ||

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ export default {
117117
},
118118
methods: {
119119
initMetrics() {
120-
const updateKey =
121-
this.instance.version ??
122-
this.instance.statusTimestamp ??
123-
this.instance.id;
120+
const updateKey = this.instance.id;
124121
const firstInit = this.currentInstanceId === null;
125122
if (
126123
this.instance.id !== this.currentInstanceId ||

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ export default {
115115
}),
116116
computed: {
117117
instanceUpdateKey() {
118-
return (
119-
this.instance.version ??
120-
this.instance.statusTimestamp ??
121-
this.instance.id
122-
);
118+
return this.instance.id;
123119
},
124120
hasCaches() {
125121
return this.hasMetric('cache.gets');

0 commit comments

Comments
 (0)