Commit 54d5df6e by Chaiwith Santaweesuk

update

parents 5eb0847e 4fbbc1ee
......@@ -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],
......@@ -284,7 +281,7 @@ class Home extends Component {
fingerPrintMax: Math.round(this.getMax(fingerPrintFeed) * 100) / 100,
fingerPrintMin: Math.round(this.getMin(fingerPrintFeed) * 100) / 100,
fingerPrintAvg: Math.round(this.getAvg(fingerPrintFeed) * 100) / 100,
keycardTotal: Math.round((this.getTotal(keycardFeed) * 100) / 100,
keycardTotal: Math.round(this.getTotal(keycardFeed) * 100) / 100,
keycardMax: Math.round(this.getMax(keycardFeed) * 100) / 100,
keycardMin: Math.round(this.getMin(keycardFeed) * 100) / 100,
keycardAvg: Math.round(this.getAvg(keycardFeed) * 100) / 100,
......@@ -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