mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-30 01:42:19 +00:00
Merge pull request #52 from stephb9959/feature/32-statistics
Feature/32 statistics
This commit is contained in:
@@ -3,7 +3,7 @@ import { CFooter } from '@coreui/react';
|
||||
|
||||
const TheFooter = () => (
|
||||
<CFooter fixed={false}>
|
||||
<div>Version 0.0.6</div>
|
||||
<div>Version 0.0.7</div>
|
||||
<div className="mfs-auto">
|
||||
<span className="mr-1">Powered by</span>
|
||||
<a href="https://coreui.io/react" target="_blank" rel="noopener noreferrer">
|
||||
|
||||
@@ -3,12 +3,12 @@ import PropTypes from 'prop-types';
|
||||
import Chart from 'react-apexcharts'
|
||||
|
||||
const DeviceStatisticsChart = ({ data, options }) => (
|
||||
<div>
|
||||
<div style={{height: '360px'}}>
|
||||
<Chart
|
||||
series={data}
|
||||
options={options}
|
||||
type='line'
|
||||
height={360}
|
||||
height='100%'
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -97,28 +97,29 @@ const StatisticsChartList = ({ selectedDeviceId, lastRefresh }) => {
|
||||
}
|
||||
|
||||
const getStatistics = () => {
|
||||
if (loading) return;
|
||||
setLoading(true);
|
||||
if (!loading){
|
||||
setLoading(true);
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${getToken()}`,
|
||||
},
|
||||
params: {
|
||||
serialNumber: "24f5a207a130"
|
||||
}
|
||||
};
|
||||
|
||||
axiosInstance
|
||||
.get(`/device/${selectedDeviceId}/statistics?newest=true&limit=50`, options)
|
||||
.then((response) => {
|
||||
transformIntoDataset(response.data.data);
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
const options = {
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${getToken()}`,
|
||||
},
|
||||
params: {
|
||||
serialNumber: "24f5a207a130"
|
||||
}
|
||||
};
|
||||
|
||||
axiosInstance
|
||||
.get(`/device/${selectedDeviceId}/statistics?newest=true&limit=50`, options)
|
||||
.then((response) => {
|
||||
transformIntoDataset(response.data.data);
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user