Commit 4fbbc1ee by OuiAtichat

fix bug edit interval to 5min

parent eda3bc4b
......@@ -183,7 +183,7 @@ class Home extends Component {
loopFeedData = async (deviceId, selectedRange, breakdown) => {
clearInterval(this.looper);
await this.getFeedData(deviceId, selectedRange, breakdown);
this.looper = setInterval(async () => await this.getFeedData(deviceId, selectedRange, breakdown), 60000);
this.looper = setInterval(async () => await this.getFeedData(deviceId, selectedRange, breakdown), 300000);
};
getFeedData = async (
......@@ -193,14 +193,11 @@ class Home extends Component {
) => {
const { kairosUrl, userToken } = this.state;
const { startDate, endDate } = selectedRange;
const now = moment().valueOf();
// const now = moment().valueOf();
// tags = ['Current Cash']
// ["Revenue", "Reset" ,"Remote" ,"People" ,"Fingerprint"]
const q_data = {
start_absolute: startDate || now,
end_absolute: endDate || now,
start_absolute: startDate,
end_absolute: endDate,
metrics: [
{
name: deviceId || this.state.allDevicesId[0],
......@@ -352,10 +349,8 @@ class Home extends Component {
current: data[3][i][1],
timestamp: moment(data[1][i][0]).format('D/M/YY HH:mm'),
};
table.unshift(v);
}
return table;
};
......
......@@ -38,7 +38,7 @@ const DataCard = props => {
if (props.feedData) {
var dataObj = props.feedData.map(value => ({
xAxis: moment(value[0]).format('D/M/YY H:mm'),
xAxis: moment(value[0]).format('D/M/YY HH:mm'),
yAxis: value[1],
}));
}
......
......@@ -8,7 +8,7 @@ class GetDataSelection extends PureComponent {
device: null,
range: {
startDate: moment()
.subtract(1, 'days')
.startOf('day')
.valueOf(),
endDate: moment().valueOf(),
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment