11import React , { useEffect , useState } from 'react'
2- import PropTypes from 'prop-types'
3- import { WHITE , BLACK_RUSSIAN , TRANSPARENT , RICH_BLACK , OPACITY_30 } from '@platformatic/ui-components/src/components/constants'
2+ import { WHITE , BLACK_RUSSIAN , TRANSPARENT , OPACITY_30 } from '@platformatic/ui-components/src/components/constants'
43import styles from './NodeJSMetric.module.css'
54import typographyStyles from '~/styles/Typography.module.css'
65import commonStyles from '~/styles/CommonStyles.module.css'
@@ -9,7 +8,7 @@ import loadingSpinnerStyles from '~/styles/LoadingSpinnerStyles.module.css'
98import NoDataAvailable from '~/components/ui/NoDataAvailable'
109import NodeJSMetricChart from '~/components//metrics/NodeJSMetricChart'
1110import LatencyChart from '~/components//metrics/LatencyChart'
12- import { POSITION_ABSOLUTE , POSITION_FIXED } from '~/ui-constants'
11+ import { POSITION_ABSOLUTE } from '~/ui-constants'
1312import colorSetMem from '~/components/metrics/memory.module.css'
1413import colorSetCpu from '~/components/metrics/cpu.module.css'
1514import colorSetLatency from '~/components/metrics/latency.module.css'
@@ -77,7 +76,7 @@ function NodeJSMetric ({
7776 } else {
7877 setShowNoResult ( true )
7978 }
80- } , [ ] )
79+ } , [ dataValues ] )
8180
8281 function renderComponent ( ) {
8382 if ( initialLoading ) {
@@ -143,55 +142,4 @@ function NodeJSMetric ({
143142 )
144143}
145144
146- NodeJSMetric . propTypes = {
147- /**
148- * title
149- */
150- title : PropTypes . string ,
151- /**
152- * metricURL
153- */
154- metricURL : PropTypes . string ,
155- /**
156- * unit
157- */
158- unit : PropTypes . string ,
159- /**
160- * data
161- */
162- data : PropTypes . object ,
163- /**
164- * initialLoading
165- */
166- initialLoading : PropTypes . bool ,
167- /**
168- * options
169- */
170- options : PropTypes . arrayOf ( PropTypes . shape ( {
171- label : PropTypes . string ,
172- key : PropTypes . string ,
173- unit : PropTypes . string
174- } ) ) ,
175- /**
176- * backgroundColor
177- */
178- backgroundColor : PropTypes . oneOf ( [ BLACK_RUSSIAN , RICH_BLACK ] ) ,
179- /**
180- * chartTooltipPositionPropTypes
181- */
182- chartTooltipPosition : PropTypes . oneOf ( [ POSITION_ABSOLUTE , POSITION_FIXED ] ) ,
183- /**
184- * showLegend
185- */
186- showLegend : PropTypes . bool ,
187- /**
188- * timeline
189- */
190- timeline : PropTypes . bool ,
191- /**
192- * slimCss
193- */
194- slimCss : PropTypes . bool
195- }
196-
197145export default NodeJSMetric
0 commit comments