diff --git a/packages/ocs/dashboards/object-service/data-consumption-card/data-consumption-card.tsx b/packages/ocs/dashboards/object-service/data-consumption-card/data-consumption-card.tsx index 7d773ba92..2cd5b6e50 100644 --- a/packages/ocs/dashboards/object-service/data-consumption-card/data-consumption-card.tsx +++ b/packages/ocs/dashboards/object-service/data-consumption-card/data-consumption-card.tsx @@ -219,7 +219,7 @@ const ServiceTypeRGW: React.FC = ({ queries, metric }) => { const loading = getLoading || putLoading; const error = !!getError || !!putError; const data = !!get && !!put; - const response: Response = React.useMemo(() => { + const response: DataPoint[][] = React.useMemo(() => { return !loading && !error && data ? [...getRangeVectorStats(get), ...getRangeVectorStats(put)] : []; @@ -229,7 +229,7 @@ const ServiceTypeRGW: React.FC = ({ queries, metric }) => { ); diff --git a/packages/ocs/dashboards/object-service/data-consumption-card/performance-graph.tsx b/packages/ocs/dashboards/object-service/data-consumption-card/performance-graph.tsx index a3f53d167..0d6d444cb 100644 --- a/packages/ocs/dashboards/object-service/data-consumption-card/performance-graph.tsx +++ b/packages/ocs/dashboards/object-service/data-consumption-card/performance-graph.tsx @@ -22,7 +22,7 @@ import { convertNaNToNull, getLatestValue } from '../../../utils'; import './data-consumption-card.scss'; type PerformanceGraphProps = { - dataPoints: DataPoint[][][]; + dataPoints: DataPoint[][]; loading: boolean; loadError: boolean; metricType: string; @@ -41,8 +41,8 @@ const PerformanceGraph: React.FC = ({ metricType === Metrics.BANDWIDTH ? humanizeDecimalBytesPerSec : humanizeSeconds; - const getData = getDataArray?.[0]?.map(convertNaNToNull); - const putData = putDataArray?.[0]?.map(convertNaNToNull); + const getData = getDataArray?.map(convertNaNToNull); + const putData = putDataArray?.map(convertNaNToNull); const PUTLatestValue = humanize(getLatestValue(putData)).string; const GETLatestValue = humanize(getLatestValue(getData)).string; @@ -53,10 +53,10 @@ const PerformanceGraph: React.FC = ({ const emptyData = dataPoints.some(_.isEmpty); - if (loadError && emptyData) { + if (loadError || emptyData) { return ; } - if (!loading && !loadError && !emptyData) { + if (!loading) { return ( <>
diff --git a/packages/shared/src/details-page/datetime.ts b/packages/shared/src/details-page/datetime.ts index baaaf049a..7e2c14302 100644 --- a/packages/shared/src/details-page/datetime.ts +++ b/packages/shared/src/details-page/datetime.ts @@ -220,6 +220,9 @@ export const twentyFourHourTime = ( date: Date, showSeconds?: boolean ): string => { + if (!_.isDate(date)) { + date = new Date(0); + } const hours = zeroPad(date.getHours() ?? 0); const minutes = `:${zeroPad(date.getMinutes() ?? 0)}`; const seconds = showSeconds ? `:${zeroPad(date.getSeconds() ?? 0)}` : '';