mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-03 03:37:45 +00:00
2.7.0
This commit is contained in:
@@ -4,7 +4,7 @@ import { CSpinner } from '@coreui/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { v4 as createUuid } from 'uuid';
|
||||
import axiosInstance from 'utils/axiosInstance';
|
||||
import { useAuth, useDevice } from 'ucentral-libs';
|
||||
import { useAuth } from 'ucentral-libs';
|
||||
import {
|
||||
capitalizeFirstLetter,
|
||||
datesSameDay,
|
||||
@@ -14,11 +14,10 @@ import {
|
||||
} from 'utils/helper';
|
||||
import DeviceStatisticsChart from './DeviceStatisticsChart';
|
||||
|
||||
const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) => {
|
||||
const StatisticsChartList = ({ deviceSerialNumber, setOptions, section, time }) => {
|
||||
const { t } = useTranslation();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const { currentToken, endpoints } = useAuth();
|
||||
const { deviceSerialNumber } = useDevice();
|
||||
const [statOptions, setStatOptions] = useState({
|
||||
interfaceList: [],
|
||||
memory: [],
|
||||
@@ -244,10 +243,6 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
|
||||
}));
|
||||
setOptions([...sectionOptions, { value: 'memory', label: t('statistics.memory') }]);
|
||||
setStatOptions({ ...newOptions });
|
||||
if (sortedData.length > 0) {
|
||||
setStart(new Date(sortedData[0].recorded * 1000));
|
||||
setEnd(new Date(sortedData[sortedData.length - 1].recorded * 1000));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -358,11 +353,10 @@ const StatisticsChartList = ({ setOptions, section, setStart, setEnd, time }) =>
|
||||
};
|
||||
|
||||
StatisticsChartList.propTypes = {
|
||||
deviceSerialNumber: PropTypes.string.isRequired,
|
||||
setOptions: PropTypes.func.isRequired,
|
||||
section: PropTypes.string.isRequired,
|
||||
time: PropTypes.instanceOf(Object).isRequired,
|
||||
setStart: PropTypes.func.isRequired,
|
||||
setEnd: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default React.memo(StatisticsChartList);
|
||||
|
||||
Reference in New Issue
Block a user