File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/pybind/mgr/dashboard/frontend/src/app/shared/api Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,6 @@ export class PrometheusService {
143143 }
144144 this . timerGetPrometheusDataSub = timer ( 0 , this . timerTime ) . subscribe ( ( ) => {
145145 selectedTime = this . updateTimeStamp ( selectedTime ) ;
146-
147146 for ( const queryName in queries ) {
148147 if ( queries . hasOwnProperty ( queryName ) ) {
149148 const query = queries [ queryName ] ;
@@ -163,13 +162,12 @@ export class PrometheusService {
163162 queriesResults [ queryName ] !== '' &&
164163 checkNan
165164 ) {
166- queriesResults [ queryName ] . forEach ( ( valueArray : string [ ] ) => {
167- if ( valueArray . includes ( 'NaN' ) ) {
168- const index = valueArray . indexOf ( 'NaN' ) ;
169- if ( index !== - 1 ) {
170- valueArray [ index ] = '0' ;
165+ queriesResults [ queryName ] . forEach ( ( valueArray : any [ ] ) => {
166+ valueArray . forEach ( ( val , index ) => {
167+ if ( isNaN ( parseFloat ( val [ 1 ] ) ) ) {
168+ valueArray [ index ] [ 1 ] = '0' ;
171169 }
172- }
170+ } ) ;
173171 } ) ;
174172 }
175173 } ) ;
You can’t perform that action at this time.
0 commit comments