File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
spring-boot-admin-server-ui/src/main/frontend/views/instances/metrics Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 111111
112112<script >
113113import {sortBy } from ' lodash-es' ;
114- import Instance from ' @/services/instance.js' ;
115114import Metric from ' ./metric.vue' ;
116115import {VIEW_GROUP } from ' ../../ViewGroup.js' ;
117- import SbaInstanceSection from ' @/views/instances/shell/sba-instance-section.vue' ;
116+ import SbaInstanceSection from ' @/views/instances/shell/sba-instance-section' ;
117+ import Instance from " ../../../services/instance" ;
118+
119+ const ApiVersion = Object .freeze ({
120+ V2 : ' application/vnd.spring-boot.actuator.v2' ,
121+ V3 : ' application/vnd.spring-boot.actuator.v3'
122+ });
123+
124+ function isActuatorApiVersionSupported (headerContentType ) {
125+ return headerContentType .includes (ApiVersion .V2 ) || headerContentType .includes (ApiVersion .V2 );
126+ }
118127
119128export default {
120129 components: {SbaInstanceSection, Metric},
@@ -202,7 +211,7 @@ export default {
202211 this .error = null ;
203212 try {
204213 const res = await this .instance .fetchMetrics ();
205- if (res .headers [' content-type' ]. includes ( ' application/vnd.spring-boot.actuator.v2 ' )) {
214+ if (isActuatorApiVersionSupported ( res .headers [' content-type' ])) {
206215 this .availableMetrics = res .data .names ;
207216 this .availableMetrics .sort ();
208217 this .selectedMetric = this .availableMetrics [0 ];
You can’t perform that action at this time.
0 commit comments