Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toiletcoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
atichat
toiletcoin
Commits
54d5df6e
Commit
54d5df6e
authored
Aug 08, 2019
by
Chaiwith Santaweesuk
Browse files
Options
Browse Files
Download
Plain Diff
update
parents
5eb0847e
4fbbc1ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
+7
-12
src/Pages/Home.js
+5
-10
src/components/DataCard.js
+1
-1
src/components/GetDataSelection/GetDataSelection.js
+1
-1
No files found.
src/Pages/Home.js
View file @
54d5df6e
...
@@ -183,7 +183,7 @@ class Home extends Component {
...
@@ -183,7 +183,7 @@ class Home extends Component {
loopFeedData
=
async
(
deviceId
,
selectedRange
,
breakdown
)
=>
{
loopFeedData
=
async
(
deviceId
,
selectedRange
,
breakdown
)
=>
{
clearInterval
(
this
.
looper
);
clearInterval
(
this
.
looper
);
await
this
.
getFeedData
(
deviceId
,
selectedRange
,
breakdown
);
await
this
.
getFeedData
(
deviceId
,
selectedRange
,
breakdown
);
this
.
looper
=
setInterval
(
async
()
=>
await
this
.
getFeedData
(
deviceId
,
selectedRange
,
breakdown
),
6
0000
);
this
.
looper
=
setInterval
(
async
()
=>
await
this
.
getFeedData
(
deviceId
,
selectedRange
,
breakdown
),
30
0000
);
};
};
getFeedData
=
async
(
getFeedData
=
async
(
...
@@ -193,14 +193,11 @@ class Home extends Component {
...
@@ -193,14 +193,11 @@ class Home extends Component {
)
=>
{
)
=>
{
const
{
kairosUrl
,
userToken
}
=
this
.
state
;
const
{
kairosUrl
,
userToken
}
=
this
.
state
;
const
{
startDate
,
endDate
}
=
selectedRange
;
const
{
startDate
,
endDate
}
=
selectedRange
;
const
now
=
moment
().
valueOf
();
//
const now = moment().valueOf();
// tags = ['Current Cash']
// ["Revenue", "Reset" ,"Remote" ,"People" ,"Fingerprint"]
const
q_data
=
{
const
q_data
=
{
start_absolute
:
startDate
||
now
,
start_absolute
:
startDate
,
end_absolute
:
endDate
||
now
,
end_absolute
:
endDate
,
metrics
:
[
metrics
:
[
{
{
name
:
deviceId
||
this
.
state
.
allDevicesId
[
0
],
name
:
deviceId
||
this
.
state
.
allDevicesId
[
0
],
...
@@ -284,7 +281,7 @@ class Home extends Component {
...
@@ -284,7 +281,7 @@ class Home extends Component {
fingerPrintMax
:
Math
.
round
(
this
.
getMax
(
fingerPrintFeed
)
*
100
)
/
100
,
fingerPrintMax
:
Math
.
round
(
this
.
getMax
(
fingerPrintFeed
)
*
100
)
/
100
,
fingerPrintMin
:
Math
.
round
(
this
.
getMin
(
fingerPrintFeed
)
*
100
)
/
100
,
fingerPrintMin
:
Math
.
round
(
this
.
getMin
(
fingerPrintFeed
)
*
100
)
/
100
,
fingerPrintAvg
:
Math
.
round
(
this
.
getAvg
(
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
,
keycardMax
:
Math
.
round
(
this
.
getMax
(
keycardFeed
)
*
100
)
/
100
,
keycardMin
:
Math
.
round
(
this
.
getMin
(
keycardFeed
)
*
100
)
/
100
,
keycardMin
:
Math
.
round
(
this
.
getMin
(
keycardFeed
)
*
100
)
/
100
,
keycardAvg
:
Math
.
round
(
this
.
getAvg
(
keycardFeed
)
*
100
)
/
100
,
keycardAvg
:
Math
.
round
(
this
.
getAvg
(
keycardFeed
)
*
100
)
/
100
,
...
@@ -352,10 +349,8 @@ class Home extends Component {
...
@@ -352,10 +349,8 @@ class Home extends Component {
current
:
data
[
3
][
i
][
1
],
current
:
data
[
3
][
i
][
1
],
timestamp
:
moment
(
data
[
1
][
i
][
0
]).
format
(
'D/M/YY HH:mm'
),
timestamp
:
moment
(
data
[
1
][
i
][
0
]).
format
(
'D/M/YY HH:mm'
),
};
};
table
.
unshift
(
v
);
table
.
unshift
(
v
);
}
}
return
table
;
return
table
;
};
};
...
...
src/components/DataCard.js
View file @
54d5df6e
...
@@ -38,7 +38,7 @@ const DataCard = props => {
...
@@ -38,7 +38,7 @@ const DataCard = props => {
if
(
props
.
feedData
)
{
if
(
props
.
feedData
)
{
var
dataObj
=
props
.
feedData
.
map
(
value
=>
({
var
dataObj
=
props
.
feedData
.
map
(
value
=>
({
xAxis
:
moment
(
value
[
0
]).
format
(
'D/M/YY H:mm'
),
xAxis
:
moment
(
value
[
0
]).
format
(
'D/M/YY H
H
:mm'
),
yAxis
:
value
[
1
],
yAxis
:
value
[
1
],
}));
}));
}
}
...
...
src/components/GetDataSelection/GetDataSelection.js
View file @
54d5df6e
...
@@ -8,7 +8,7 @@ class GetDataSelection extends PureComponent {
...
@@ -8,7 +8,7 @@ class GetDataSelection extends PureComponent {
device
:
null
,
device
:
null
,
range
:
{
range
:
{
startDate
:
moment
()
startDate
:
moment
()
.
s
ubtract
(
1
,
'days
'
)
.
s
tartOf
(
'day
'
)
.
valueOf
(),
.
valueOf
(),
endDate
:
moment
().
valueOf
(),
endDate
:
moment
().
valueOf
(),
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment