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
45ee557e
Commit
45ee557e
authored
Aug 09, 2019
by
OuiAtichat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ccb7132c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
src/Pages/Home.js
+3
-4
src/components/DataCard.js
+0
-1
src/components/GetDataSelection/GetDataSelection.js
+14
-6
No files found.
src/Pages/Home.js
View file @
45ee557e
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
// import { db } from '../firebase';
import
{
Row
,
Container
}
from
'react-bootstrap'
;
import
{
Row
,
Container
}
from
'react-bootstrap'
;
import
DataTable
from
'../components/DataTable'
;
import
DataTable
from
'../components/DataTable'
;
import
NavBar
from
'../components/NavBar'
;
import
NavBar
from
'../components/NavBar'
;
...
@@ -120,11 +119,11 @@ class Home extends Component {
...
@@ -120,11 +119,11 @@ class Home extends Component {
const
{
uid
}
=
this
.
props
.
fireStoreCurrentUser
;
const
{
uid
}
=
this
.
props
.
fireStoreCurrentUser
;
this
.
props
.
getAllDevicesInfo
(
uid
);
this
.
props
.
getAllDevicesInfo
(
uid
);
};
};
looper
=
null
;
componentDidUpdate
=
async
(
prevProps
,
prevState
)
=>
{
componentDidUpdate
=
(
prevProps
,
prevState
)
=>
{
const
{
device
,
range
,
breakdown
}
=
this
.
props
.
selectedFeed
;
const
{
device
,
range
,
breakdown
}
=
this
.
props
.
selectedFeed
;
if
(
prevProps
.
selectedFeed
!==
this
.
props
.
selectedFeed
)
{
if
(
prevProps
.
selectedFeed
!==
this
.
props
.
selectedFeed
)
{
console
.
log
(
this
.
props
.
selectedFeed
);
this
.
loopFeedData
(
device
,
range
,
breakdown
);
this
.
loopFeedData
(
device
,
range
,
breakdown
);
}
}
};
};
...
@@ -280,7 +279,7 @@ class Home extends Component {
...
@@ -280,7 +279,7 @@ class Home extends Component {
axios
.
defaults
.
headers
.
common
[
'Authorization'
]
=
`Bearer
${
userToken
}
`
;
axios
.
defaults
.
headers
.
common
[
'Authorization'
]
=
`Bearer
${
userToken
}
`
;
const
response
=
await
axios
.
post
(
kairosUrl
,
q_data
);
const
response
=
await
axios
.
post
(
kairosUrl
,
q_data
);
this
.
setState
({
await
this
.
setState
({
currentFeed
:
response
.
data
.
queries
[
0
].
results
[
0
].
values
||
[],
currentFeed
:
response
.
data
.
queries
[
0
].
results
[
0
].
values
||
[],
revenueFeed
:
response
.
data
.
queries
[
1
].
results
[
0
].
values
||
[],
revenueFeed
:
response
.
data
.
queries
[
1
].
results
[
0
].
values
||
[],
remoteFeed
:
response
.
data
.
queries
[
2
].
results
[
0
].
values
||
[],
remoteFeed
:
response
.
data
.
queries
[
2
].
results
[
0
].
values
||
[],
...
...
src/components/DataCard.js
View file @
45ee557e
...
@@ -3,7 +3,6 @@ import { Card, Col, Row } from 'react-bootstrap';
...
@@ -3,7 +3,6 @@ import { Card, Col, Row } from 'react-bootstrap';
import
{
FaMoneyBillAlt
,
FaArrowUp
,
FaArrowDown
,
FaUserFriends
}
from
'react-icons/fa'
;
import
{
FaMoneyBillAlt
,
FaArrowUp
,
FaArrowDown
,
FaUserFriends
}
from
'react-icons/fa'
;
import
{
AreaChart
,
Area
,
XAxis
,
YAxis
,
ResponsiveContainer
,
Tooltip
}
from
'recharts'
;
import
{
AreaChart
,
Area
,
XAxis
,
YAxis
,
ResponsiveContainer
,
Tooltip
}
from
'recharts'
;
import
withWindowDimensions
from
'../utils/withWindowDimensions'
;
import
withWindowDimensions
from
'../utils/withWindowDimensions'
;
// import { CSVLink } from 'react-csv';
import
moment
from
'moment'
;
import
moment
from
'moment'
;
export
const
SmCard
=
props
=>
{
export
const
SmCard
=
props
=>
{
...
...
src/components/GetDataSelection/GetDataSelection.js
View file @
45ee557e
...
@@ -10,12 +10,12 @@ import { getSelectedFeed } from '../../redux/actions/selectedFeedAction';
...
@@ -10,12 +10,12 @@ import { getSelectedFeed } from '../../redux/actions/selectedFeedAction';
class
GetDataSelection
extends
Component
{
class
GetDataSelection
extends
Component
{
state
=
{
state
=
{
device
:
this
.
props
.
allDeviceId
[
0
],
device
:
this
.
props
.
allDeviceId
[
0
],
range
:
{
//
range: {
startDate
:
moment
()
//
startDate: moment()
.
startOf
(
'day'
)
//
.startOf('day')
.
valueOf
(),
//
.valueOf(),
endDate
:
moment
().
valueOf
(),
//
endDate: moment().valueOf(),
},
//
},
breakdown
:
'minutes'
,
breakdown
:
'minutes'
,
startDate
:
moment
().
startOf
(
'day'
),
startDate
:
moment
().
startOf
(
'day'
),
endDate
:
moment
(),
endDate
:
moment
(),
...
@@ -62,6 +62,14 @@ class GetDataSelection extends Component {
...
@@ -62,6 +62,14 @@ class GetDataSelection extends Component {
this
.
submitSelectedRange
();
this
.
submitSelectedRange
();
};
};
componentDidUpdate
=
(
prevProps
,
prevState
)
=>
{
if
(
prevProps
)
{
if
(
prevState
!==
this
.
state
)
{
this
.
submitSelectedRange
();
}
}
};
render
()
{
render
()
{
const
{
allDeviceId
,
allDeviceInfo
}
=
this
.
props
;
const
{
allDeviceId
,
allDeviceInfo
}
=
this
.
props
;
let
start
=
this
.
state
.
startDate
.
format
(
'DD MMM YY'
);
let
start
=
this
.
state
.
startDate
.
format
(
'DD MMM YY'
);
...
...
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