File tree Expand file tree Collapse file tree 2 files changed +27
-8
lines changed
spring-boot-admin-server-ui/src/main/frontend/views/instances Expand file tree Collapse file tree 2 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 2626 <p v-text =" error.message" />
2727 </div >
2828 </div >
29+ <div v-if =" isOldAuditevents" class =" message is-warning" >
30+ <div class =" message-body" >
31+ <p >Audit Log is not supported for Spring Boot 1.x applications.</p >
32+ </div >
33+ </div >
2934 <auditevents-list v-if =" events" :instance =" instance" :events =" events" />
3035 </div >
3136 </section >
7984 hasLoaded: false ,
8085 error: null ,
8186 events: null ,
87+ isOldAuditevents: false
8288 }),
8389 methods: {
8490 async fetchAuditevents () {
104110 error : error => {
105111 vm .hasLoaded = true ;
106112 console .warn (' Fetching audit events failed:' , error);
107- vm .error = error;
113+ if (error .response .headers [' content-type' ].includes (' application/vnd.spring-boot.actuator.v2' )) {
114+ vm .error = error;
115+ } else {
116+ vm .isOldAuditevents = true ;
117+ }
108118 }
109119 });
110120 },
Original file line number Diff line number Diff line change 2626 <p v-text =" error.message" />
2727 </div >
2828 </div >
29-
30- <form @submit.prevent =" handleSubmit" class =" field" >
31- <div class =" field" v-if =" availableMetrics.length > 0" >
29+ <div v-if =" isOldMetrics" class =" message is-warning" >
30+ <div class =" message-body" >
31+ <p >Metrics are not supported for Spring Boot 1.x applications.</p >
32+ </div >
33+ </div >
34+ <form @submit.prevent =" handleSubmit" class =" field" v-else-if =" availableMetrics.length > 0" >
35+ <div class =" field" >
3236 <div class =" control" >
3337 <div class =" select" >
3438 <select v-model =" selectedMetric" >
116120 selectedMetric: null ,
117121 stateFetchingTags: null ,
118122 availableTags: null ,
119- selectedTags: null
123+ selectedTags: null ,
124+ isOldMetrics: false
120125 }),
121126 created () {
122127 this .fetchMetricIndex ();
179184 this .error = null ;
180185 try {
181186 const res = await this .instance .fetchMetrics ();
182- this .availableMetrics = res .data .names ;
183- this .availableMetrics .sort ();
184- this .selectedMetric = this .availableMetrics [0 ];
187+ if (res .headers [' content-type' ].includes (' application/vnd.spring-boot.actuator.v2' )) {
188+ this .availableMetrics = res .data .names ;
189+ this .availableMetrics .sort ();
190+ this .selectedMetric = this .availableMetrics [0 ];
191+ } else {
192+ this .isOldMetrics = true ;
193+ }
185194 } catch (error) {
186195 console .warn (' Fetching metric index failed:' , error);
187196 this .hasLoaded = true ;
You can’t perform that action at this time.
0 commit comments