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
ffc2f5df
Commit
ffc2f5df
authored
Oct 21, 2019
by
littleploy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update coinexchange
parent
0e7d55e8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
80 deletions
+113
-80
src/Pages/Home.js
+87
-67
src/components/GetDataSelection.js
+4
-1
src/components/Mapbox.js
+18
-8
src/redux/actions/selectedFeedAction.js
+4
-4
No files found.
src/Pages/Home.js
View file @
ffc2f5df
...
...
@@ -299,6 +299,7 @@ class Home extends Component {
}
}
}
// console.log(allValues);
feeds
.
push
(
mapValues
);
}
...
...
@@ -334,9 +335,93 @@ class Home extends Component {
return
table
;
};
getBox
=
()
=>
{
const
{
currentFeed
,
revenueFeed
,
peopleFeed
,
remoteFeed
,
fingerPrintFeed
,
keycardFeed
}
=
this
.
props
.
feedData
;
if
(
this
.
props
.
selectedFeed
&&
this
.
props
.
selectedFeed
.
type
==
"door"
){
return
(
<
div
>
{
/* <Row>
<Mapbox />
</Row> */
}
<
Row
>
<
DataCard
item
=
{
Data
[
0
]}
feedData
=
{
currentFeed
}
datavalue
=
{[{
title
:
'last'
,
value
:
this
.
state
.
currentLast
}]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
1
]}
feedData
=
{
revenueFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
revenueTotal
},
// { title: 'avg', value: this.state.revenueAvg },
// { title: 'max', value: this.state.revenueMax },
// { title: 'min', value: this.state.revenueMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
2
]}
feedData
=
{
peopleFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
peopleTotal
},
// { title: 'avg', value: this.state.peopleAvg },
// { title: 'max', value: this.state.peopleMax },
// { title: 'min', value: this.state.peopleMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
3
]}
feedData
=
{
remoteFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
remoteTotal
},
// { title: 'avg', value: this.state.remoteAvg },
// { title: 'max', value: this.state.remoteMax },
// { title: 'min', value: this.state.remoteMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
4
]}
feedData
=
{
fingerPrintFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
fingerPrintTotal
},
// { title: 'avg', value: this.state.fingerPrintAvg },
// { title: 'max', value: this.state.fingerPrintMax },
// { title: 'min', value: this.state.fingerPrintMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
5
]}
feedData
=
{
keycardFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
keycardTotal
},
// { title: 'avg', value: this.state.keycardAvg },
// { title: 'max', value: this.state.keycardMax },
// { title: 'min', value: this.state.keycardMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
/Row
>
<
Row
>
<
DataTable
table
=
{
this
.
state
.
table
}
size
=
{
currentFeed
?
currentFeed
.
length
:
0
}
deviceList
=
{
this
.
state
.
deviceList
}
/
>
<
/Row></
div
>
);
}
else
if
(
this
.
props
.
selectedFeed
&&
this
.
props
.
selectedFeed
.
type
==
"coinexchange"
){
return
(
<
div
><
Row
>
<
DataTable
table
=
{
this
.
state
.
table
}
size
=
{
currentFeed
?
currentFeed
.
length
:
0
}
deviceList
=
{
this
.
state
.
deviceList
}
/
>
<
/Row></
div
>
)
}
}
render
()
{
const
{
currentFeed
,
revenueFeed
,
peopleFeed
,
remoteFeed
,
fingerPrintFeed
,
keycardFeed
}
=
this
.
props
.
feedData
;
return
(
<>
<
NavBar
/>
...
...
@@ -348,72 +433,7 @@ class Home extends Component {
<
Row
>
<
Mapbox
/>
<
/Row
>
<
Row
>
<
DataCard
item
=
{
Data
[
0
]}
feedData
=
{
currentFeed
}
datavalue
=
{[{
title
:
'last'
,
value
:
this
.
state
.
currentLast
}]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
1
]}
feedData
=
{
revenueFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
revenueTotal
},
// { title: 'avg', value: this.state.revenueAvg },
// { title: 'max', value: this.state.revenueMax },
// { title: 'min', value: this.state.revenueMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
2
]}
feedData
=
{
peopleFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
peopleTotal
},
// { title: 'avg', value: this.state.peopleAvg },
// { title: 'max', value: this.state.peopleMax },
// { title: 'min', value: this.state.peopleMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
3
]}
feedData
=
{
remoteFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
remoteTotal
},
// { title: 'avg', value: this.state.remoteAvg },
// { title: 'max', value: this.state.remoteMax },
// { title: 'min', value: this.state.remoteMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
4
]}
feedData
=
{
fingerPrintFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
fingerPrintTotal
},
// { title: 'avg', value: this.state.fingerPrintAvg },
// { title: 'max', value: this.state.fingerPrintMax },
// { title: 'min', value: this.state.fingerPrintMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
DataCard
item
=
{
Data
[
5
]}
feedData
=
{
keycardFeed
}
datavalue
=
{[
{
title
:
'total'
,
value
:
this
.
state
.
keycardTotal
},
// { title: 'avg', value: this.state.keycardAvg },
// { title: 'max', value: this.state.keycardMax },
// { title: 'min', value: this.state.keycardMin },
]}
breakdown
=
{
this
.
props
.
selectedFeed
?
this
.
props
.
selectedFeed
.
breakdown
:
"minutes"
}
/
>
<
/Row
>
<
Row
>
<
DataTable
table
=
{
this
.
state
.
table
}
size
=
{
currentFeed
?
currentFeed
.
length
:
0
}
deviceList
=
{
this
.
state
.
deviceList
}
/
>
<
/Row
>
{
this
.
getBox
()}
<
/Container
>
<
/
>
);
...
...
src/components/GetDataSelection.js
View file @
ffc2f5df
...
...
@@ -30,6 +30,7 @@ class GetDataSelection extends Component {
.
endOf
(
'month'
),
],
},
type
:
this
.
props
.
allLocationInfo
[
0
].
type
};
submitSelectedRange
=
()
=>
{
...
...
@@ -38,6 +39,7 @@ class GetDataSelection extends Component {
const
startDateTimeStamp
=
moment
(
startDate
).
valueOf
();
const
endDateTimeStamp
=
moment
(
endDate
).
valueOf
();
const
devices
=
allLocationInfo
.
find
(
element
=>
element
.
locationid
===
location
).
devicesId
;
const
type
=
allLocationInfo
.
find
(
element
=>
element
.
locationid
===
location
).
type
;
this
.
props
.
getSelectedFeed
(
devices
,
location
,
...
...
@@ -45,7 +47,8 @@ class GetDataSelection extends Component {
startDate
:
startDateTimeStamp
,
endDate
:
endDateTimeStamp
,
},
breakdown
breakdown
,
type
);
};
...
...
src/components/Mapbox.js
View file @
ffc2f5df
...
...
@@ -17,15 +17,25 @@ class Mapbox extends Component {
componentDidUpdate
=
(
prevProps
,
prevState
)
=>
{
if
(
this
.
props
.
allLocationInfo
)
{
console
.
log
(
this
.
props
.
selectFeed
)
console
.
log
(
prevProps
.
selectFeed
)
if
(
prevProps
.
selectedFeed
!==
this
.
props
.
selectedFeed
)
{
const
data1
=
this
.
props
.
allLocationInfo
;
const
{
location
}
=
this
.
props
.
selectedFeed
;
const
currentIndex
=
data1
.
findIndex
(
element
=>
element
.
locationid
===
location
);
this
.
setState
({
data
:
data1
,
center
:
data1
[
currentIndex
].
position
,
active
:
data1
[
currentIndex
],
});
if
(
this
.
props
.
selectedFeed
.
type
!=
"door"
){
const
data1
=
this
.
props
.
allLocationInfo
.
filter
(
location
=>
location
.
type
===
"door"
);
const
{
location
}
=
this
.
props
.
selectedFeed
;
const
currentIndex
=
data1
.
findIndex
(
element
=>
element
.
locationid
===
location
);
this
.
setState
({
data
:
data1
,
center
:
data1
[
currentIndex
].
position
,
active
:
data1
[
currentIndex
],
});
}
else
{
this
.
setState
({
data
:
[],
center
:
null
,
active
:
null
,
});
}
}
}
};
...
...
src/redux/actions/selectedFeedAction.js
View file @
ffc2f5df
export
const
GET_RANGE_DATA
=
'GET_RANGE_DATA'
;
export
const
getSelectedFeedAction
=
(
devices
,
location
,
range
,
breakdown
)
=>
({
export
const
getSelectedFeedAction
=
(
devices
,
location
,
range
,
breakdown
,
type
)
=>
({
type
:
GET_RANGE_DATA
,
selectedFeed
:
{
devices
,
location
,
range
,
breakdown
},
selectedFeed
:
{
devices
,
location
,
range
,
breakdown
,
type
},
});
export
const
getSelectedFeed
=
(
devices
,
location
,
range
,
breakdown
)
=>
dispatch
=>
{
return
dispatch
(
getSelectedFeedAction
(
devices
,
location
,
range
,
breakdown
));
export
const
getSelectedFeed
=
(
devices
,
location
,
range
,
breakdown
,
type
)
=>
dispatch
=>
{
return
dispatch
(
getSelectedFeedAction
(
devices
,
location
,
range
,
breakdown
,
type
));
};
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