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
36029a22
Commit
36029a22
authored
Feb 05, 2021
by
chaiwith
Browse files
Options
Browse Files
Download
Plain Diff
update
parents
149139f3
6411fe48
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
108 additions
and
27 deletions
+108
-27
.firebase/hosting.YnVpbGQ.cache
+16
-16
src/redux/actions/feedDataAction.js
+92
-11
No files found.
.firebase/hosting.YnVpbGQ.cache
View file @
36029a22
asset-manifest.json,161250
5242026,185e71646529dbc5e055cf95f8e2fb54e64f4715ac2ac2838503b7a12c5ef5f6
index.html,161250
5242026,7cff6108857307ca425131a60e045a00db742a5f88648ddb4d7026d9383468a4
home.png,1612505232919,d3b21fd280b3304b29b980aab96dce3fb728c5a6c31f04c8dcf94480770e19ef
manifest.json,1612505232919,851311324495b7eadd44a9e70f013e60f6ac9965a5a155cb4734894fd0e7dd5
f
precache-manifest.fd840668fc48381e95e282d3d96a3fe7.js,1612505242026,5db8e8037e78a94673955e87400087e3b126a3039c3b81651c2969d16debb2a1
s
ervice-worker.js,1612505242026,bdc094c09035e9f271867f7c4e21243ce0f0c0dc39a86b54d37424da35644bbf
static/css/2.6edff5b1.chunk.css
,1612505242057,d22696c87c057d6462105312ce53dc1dda6a6df0d2a5152df235b068360b1ed4
static/js/main.
49652dd7.chunk.js,1612505242031,9e2c61f371f301f5ff79d833111e582a975910dbeb2aff28dad2f62efa556d57
static/
css/2.6edff5b1.chunk.css.map,1612505242057,756daca795dac6b39811b15d55bd0d5ed0c7b27f065fb9cff5d1b23504658401
static/js/runtime~main.a8a9905a.js,161250
524205
7,e1af5f94fdd13901b2e433d0d7607e27c01458151c35b1fe4b7feda2a32b7aa9
static/js/runtime~main.a8a9905a.js.map,1612505242056,c337bf8b58896da637a6e50ab8cfc779eb1ec42c55f8ec429030a03454a549db
static/css/main.93c33a43.chunk.css,161250
5242027
,20bf61433c569ccd069908c4e498759cb46dfccb12d8bf1aba9ccb8e61bd8b86
static/js/main.
49652dd7.chunk.js.map,1612505242057,2eb8157d557bf6b3e610b0067832bbde235643f449298dcdad5f6a6bb78b09c4
static/css/main.93c33a43.chunk.css.map,161250
524205
7,a48d1e6da1a0ce76bde9786f2a1e10b880e0c11d0a38b09e296cfe0c4ac41c87
static/js/2.7488e465.chunk.js,161250
5242056
,3cbd75e3f40805219ce7989395af40b04a449a7b99fb1c69b6b877c662811ea0
static/js/2.7488e465.chunk.js.map,161250
5242057
,95678fea519e4641787101e03fe2f9997125bafda8a174e5c4f51afbbbb00232
asset-manifest.json,161250
9548167,aaddb2156748ef2ec6451d016b70ce0fd74309e18c06b325bb9b2fecf2e251d0
index.html,161250
9548167,41185791c751a0a2e914d4ec1331bb99154a7e09e00d7cbd88176be71d36c9e6
precache-manifest.1aa28ebbaca16bc1fdd8fedf0fbd2538.js,1612509548167,737329798e48c33790239900419a837271900a1a7a1380a05c3144fbcb7e9e66
home.png,1612509538507,d3b21fd280b3304b29b980aab96dce3fb728c5a6c31f04c8dcf94480770e19e
f
service-worker.js,1612509548167,9d3535bcf7a5c274cd67faa655a9857b1f1e4fc3ee48e126c32d30cf585cfe54
s
tatic/css/2.6edff5b1.chunk.css,1612509548196,d22696c87c057d6462105312ce53dc1dda6a6df0d2a5152df235b068360b1ed4
static/css/2.6edff5b1.chunk.css
.map,1612509548198,756daca795dac6b39811b15d55bd0d5ed0c7b27f065fb9cff5d1b23504658401
static/js/main.
c44c6192.chunk.js,1612509548196,87c7d002410d300ad28c13d16f8677b171dce812a1efa9484a1568fc010a8b2b
static/
js/runtime~main.a8a9905a.js.map,1612509548197,c337bf8b58896da637a6e50ab8cfc779eb1ec42c55f8ec429030a03454a549db
static/js/runtime~main.a8a9905a.js,161250
954816
7,e1af5f94fdd13901b2e433d0d7607e27c01458151c35b1fe4b7feda2a32b7aa9
manifest.json,1612509538508,851311324495b7eadd44a9e70f013e60f6ac9965a5a155cb4734894fd0e7dd5f
static/css/main.93c33a43.chunk.css,161250
9548198
,20bf61433c569ccd069908c4e498759cb46dfccb12d8bf1aba9ccb8e61bd8b86
static/js/main.
c44c6192.chunk.js.map,1612509548197,f761337832692de98219f32b759560891d67e3a6294cf7636214b058d48490a2
static/css/main.93c33a43.chunk.css.map,161250
954819
7,a48d1e6da1a0ce76bde9786f2a1e10b880e0c11d0a38b09e296cfe0c4ac41c87
static/js/2.7488e465.chunk.js,161250
9548198
,3cbd75e3f40805219ce7989395af40b04a449a7b99fb1c69b6b877c662811ea0
static/js/2.7488e465.chunk.js.map,161250
9548198
,95678fea519e4641787101e03fe2f9997125bafda8a174e5c4f51afbbbb00232
src/redux/actions/feedDataAction.js
View file @
36029a22
...
...
@@ -25,14 +25,18 @@ export const getFeedData = () => async (dispatch, getState) => {
const
{
kairosUrl
,
userToken
}
=
fireStoreReducer
.
fireStoreConfig
;
const
{
devices
,
range
,
breakdown
,
location
}
=
selectedFeedReducer
.
selectedFeed
;
const
optiontimestamp
=
{
minutes
:
1000
*
60
*
5
,
hours
:
1000
*
60
*
60
,
days
:
1000
*
60
*
60
*
24
,
weeks
:
1000
*
60
*
60
*
24
*
7
,
months
:
1000
*
60
*
60
*
24
*
31
,
}
// let momentRange = extendMoment(moment);
let
attrList
;
let
metrics
=
[];
let
oldBreakdown
=
breakdown
;
devices
.
forEach
(
device
=>
{
// if (location == "eLNvYvm6YT8LTHrCA7Ne" || location == "fKtBvZyBArnTdlMRXOY0" || location == "yb1udKQSTGBFHKn1m5MQ" || location == "rJLbWBPZoJof30KCE07h" || location == "ZMfFDqiAJhXDqRVopTCT" || location == "hWHZMc1dbzjxDuNeIMYf" || location == "sfE95i3WDGy7W4k5pc9T" || location == "uX8Cq15AkjWgVXqWCbdf" || location == "yILqREcDQu85AD1wGyBP" || location == "1ppp1nJuBlNLOpl67dtZ" || location == "9u2ATildmRThi3eA5zMz" || location == "MIenGAtMgckindwrPE6A" || location == "vP59HiIEhvDooBSV1klc" || location == "mcE8DirvsQhUMdL09nNb" || location == "yXjV2x9uKgYa0DpQHRJ3" || location == "yXQPQvuL64vlD0TfJ3lE" || location == "ue2AxjvfFh7IxeV3iOXS" || location == "n0rIiEhHx7Hd9R3N5abU" || location == "RogL7WhBNwkwSNAlPt8X" || location == "FLDNnlycMGBW9ndP84DP" || location == "fRQvPi3NknMcT7o4LefP" || location == "WsDBpCKW0SJThukN1HvE" || location == "T9sfsC0PdX1E5qm32zxV" || location == "bts8v0Sw9nH6DrY1rDqu" || location == "1IKI77wv6ZK6ptRUR9nQ"
|| location == "5scB5eAz2OPgwLi8QpgQ"
// if (location == "eLNvYvm6YT8LTHrCA7Ne" || location == "fKtBvZyBArnTdlMRXOY0" || location == "yb1udKQSTGBFHKn1m5MQ" || location == "rJLbWBPZoJof30KCE07h" || location == "ZMfFDqiAJhXDqRVopTCT" || location == "hWHZMc1dbzjxDuNeIMYf" || location == "sfE95i3WDGy7W4k5pc9T" || location == "uX8Cq15AkjWgVXqWCbdf" || location == "yILqREcDQu85AD1wGyBP" || location == "1ppp1nJuBlNLOpl67dtZ" || location == "9u2ATildmRThi3eA5zMz" || location == "MIenGAtMgckindwrPE6A" || location == "vP59HiIEhvDooBSV1klc" || location == "mcE8DirvsQhUMdL09nNb" || location == "yXjV2x9uKgYa0DpQHRJ3" || location == "yXQPQvuL64vlD0TfJ3lE" || location == "ue2AxjvfFh7IxeV3iOXS" || location == "n0rIiEhHx7Hd9R3N5abU" || location == "RogL7WhBNwkwSNAlPt8X" || location == "FLDNnlycMGBW9ndP84DP" || location == "fRQvPi3NknMcT7o4LefP" || location == "WsDBpCKW0SJThukN1HvE" || location == "T9sfsC0PdX1E5qm32zxV" || location == "bts8v0Sw9nH6DrY1rDqu" || location == "1IKI77wv6ZK6ptRUR9nQ"
// ) {
attrList
=
[
// { tag: "['Current Cash']", aggregator: 'last' },
...
...
@@ -56,8 +60,9 @@ export const getFeedData = () => async (dispatch, getState) => {
// { tag: 'Keycard', aggregator: 'sum' }
// ]
// }
let
newBreakdown
=
breakdown
!=
"minutes"
?
"hours"
:
breakdown
console
.
log
(
"newBreakdown"
,
newBreakdown
)
//
console.log("newBreakdown", newBreakdown)
attrList
.
forEach
(
element
=>
{
const
metric
=
{
name
:
device
,
...
...
@@ -83,10 +88,13 @@ export const getFeedData = () => async (dispatch, getState) => {
metrics
.
push
(
metric
);
});
});
let
start
=
range
.
startDate
-
3600000
let
start
=
range
.
startDate
-
optiontimestamp
[
oldBreakdown
]
let
end
=
range
.
endDate
console
.
log
(
"start"
,
start
)
console
.
log
(
"end"
,
end
)
// console.log("oldBreakdown",oldBreakdown)
// console.log("optiontimestamp[oldBreakdown]",optiontimestamp[oldBreakdown])
// console.log("range.startDate",range.startDate)
// console.log("start",start)
// console.log("end",end)
const
q_data
=
{
start_absolute
:
start
,
...
...
@@ -109,10 +117,10 @@ export const getFeedData = () => async (dispatch, getState) => {
let
keycardFeedList
=
[];
// console.log(response)
response
.
data
.
queries
.
forEach
(
query
=>
{
// if (location == "eLNvYvm6YT8LTHrCA7Ne" || location == "fKtBvZyBArnTdlMRXOY0" || location == "yb1udKQSTGBFHKn1m5MQ" || location == "rJLbWBPZoJof30KCE07h" || location == "ZMfFDqiAJhXDqRVopTCT" || location == "hWHZMc1dbzjxDuNeIMYf" || location == "sfE95i3WDGy7W4k5pc9T" || location == "uX8Cq15AkjWgVXqWCbdf" || location == "yILqREcDQu85AD1wGyBP" || location == "1ppp1nJuBlNLOpl67dtZ" || location == "9u2ATildmRThi3eA5zMz" || location == "MIenGAtMgckindwrPE6A" || location == "vP59HiIEhvDooBSV1klc" || location == "mcE8DirvsQhUMdL09nNb" || location == "yXjV2x9uKgYa0DpQHRJ3" || location == "yXQPQvuL64vlD0TfJ3lE" || location == "ue2AxjvfFh7IxeV3iOXS" || location == "n0rIiEhHx7Hd9R3N5abU" || location == "RogL7WhBNwkwSNAlPt8X" || location == "FLDNnlycMGBW9ndP84DP" || location == "fRQvPi3NknMcT7o4LefP" || location == "WsDBpCKW0SJThukN1HvE" || location == "T9sfsC0PdX1E5qm32zxV" || location == "bts8v0Sw9nH6DrY1rDqu" || location == "1IKI77wv6ZK6ptRUR9nQ"
|| location == "5scB5eAz2OPgwLi8QpgQ"
// if (location == "eLNvYvm6YT8LTHrCA7Ne" || location == "fKtBvZyBArnTdlMRXOY0" || location == "yb1udKQSTGBFHKn1m5MQ" || location == "rJLbWBPZoJof30KCE07h" || location == "ZMfFDqiAJhXDqRVopTCT" || location == "hWHZMc1dbzjxDuNeIMYf" || location == "sfE95i3WDGy7W4k5pc9T" || location == "uX8Cq15AkjWgVXqWCbdf" || location == "yILqREcDQu85AD1wGyBP" || location == "1ppp1nJuBlNLOpl67dtZ" || location == "9u2ATildmRThi3eA5zMz" || location == "MIenGAtMgckindwrPE6A" || location == "vP59HiIEhvDooBSV1klc" || location == "mcE8DirvsQhUMdL09nNb" || location == "yXjV2x9uKgYa0DpQHRJ3" || location == "yXQPQvuL64vlD0TfJ3lE" || location == "ue2AxjvfFh7IxeV3iOXS" || location == "n0rIiEhHx7Hd9R3N5abU" || location == "RogL7WhBNwkwSNAlPt8X" || location == "FLDNnlycMGBW9ndP84DP" || location == "fRQvPi3NknMcT7o4LefP" || location == "WsDBpCKW0SJThukN1HvE" || location == "T9sfsC0PdX1E5qm32zxV" || location == "bts8v0Sw9nH6DrY1rDqu" || location == "1IKI77wv6ZK6ptRUR9nQ"
// ) {
if
(
query
.
results
[
0
].
tags
.
attr
==
"['Current Cash']"
)
{
currentFeedList
.
push
({
deviceId
:
query
.
results
[
0
].
name
,
value
:
query
.
results
[
0
].
values
});
let
currentFeed
=
{
deviceId
:
query
.
results
[
0
].
name
,
value
:
query
.
results
[
0
].
values
}
let
revenueFeed
=
{
deviceId
:
query
.
results
[
0
].
name
,
value
:
[[
query
.
results
[
0
].
values
[
0
][
0
],
0
]]
}
for
(
let
index
=
1
;
index
<
query
.
results
[
0
].
values
.
length
;
index
++
)
{
const
current
=
query
.
results
[
0
].
values
[
index
][
1
];
...
...
@@ -125,9 +133,35 @@ export const getFeedData = () => async (dispatch, getState) => {
}
if
(
index
==
query
.
results
[
0
].
values
.
length
-
1
)
{
let
i
=
0
;
let
lengthFeedi
=
currentFeed
.
value
.
length
-
1
;
while
(
i
<
lengthFeedi
)
{
if
(
currentFeed
.
value
[
0
][
0
]
>=
range
.
startDate
){
i
+=
1
;
break
}
else
{
currentFeed
.
value
.
shift
();
lengthFeedi
-=
1
}
}
currentFeedList
.
push
(
currentFeed
);
let
j
=
0
;
let
lengthFeedj
=
revenueFeed
.
value
.
length
-
1
;
while
(
i
<
lengthFeedj
)
{
if
(
revenueFeed
.
value
[
0
][
0
]
>=
range
.
startDate
){
i
+=
1
;
break
}
else
{
revenueFeed
.
value
.
shift
();
lengthFeedj
-=
1
}
}
revenueFeedList
.
push
(
revenueFeed
);
}
}
}
else
if
(
query
.
results
[
0
].
tags
.
attr
==
"Remote"
)
{
let
remoteFeed
=
{
deviceId
:
query
.
results
[
0
].
name
,
value
:
[[
query
.
results
[
0
].
values
[
0
][
0
],
0
]]
}
...
...
@@ -141,6 +175,18 @@ export const getFeedData = () => async (dispatch, getState) => {
remoteFeed
.
value
[
remoteFeed
.
value
.
length
]
=
[
query
.
results
[
0
].
values
[
index
][
0
],
current
]
}
if
(
index
==
query
.
results
[
0
].
values
.
length
-
1
)
{
let
i
=
0
;
let
lengthFeed
=
remoteFeed
.
value
.
length
-
1
;
while
(
i
<
lengthFeed
)
{
if
(
remoteFeed
.
value
[
0
][
0
]
>=
range
.
startDate
){
i
+=
1
;
break
}
else
{
remoteFeed
.
value
.
shift
();
lengthFeed
-=
1
}
}
remoteFeedList
.
push
(
remoteFeed
);
}
}
...
...
@@ -157,11 +203,21 @@ export const getFeedData = () => async (dispatch, getState) => {
peopleFeed
.
value
[
peopleFeed
.
value
.
length
]
=
[
query
.
results
[
0
].
values
[
index
][
0
],
current
]
}
if
(
index
==
query
.
results
[
0
].
values
.
length
-
1
)
{
let
i
=
0
;
let
lengthFeed
=
peopleFeed
.
value
.
length
-
1
;
while
(
i
<
lengthFeed
)
{
if
(
peopleFeed
.
value
[
0
][
0
]
>=
range
.
startDate
){
i
+=
1
;
break
}
else
{
peopleFeed
.
value
.
shift
();
lengthFeed
-=
1
}
}
peopleFeedList
.
push
(
peopleFeed
);
}
}
// console.log("peopleFeedList")
// console.log(peopleFeedList)
}
else
if
(
query
.
results
[
0
].
tags
.
attr
==
"Fingerprint"
)
{
let
fingerPrintFeed
=
{
deviceId
:
query
.
results
[
0
].
name
,
value
:
[[
query
.
results
[
0
].
values
[
0
][
0
],
0
]]
}
...
...
@@ -175,7 +231,20 @@ export const getFeedData = () => async (dispatch, getState) => {
fingerPrintFeed
.
value
[
fingerPrintFeed
.
value
.
length
]
=
[
query
.
results
[
0
].
values
[
index
][
0
],
current
]
}
if
(
index
==
query
.
results
[
0
].
values
.
length
-
1
)
{
let
i
=
0
;
let
lengthFeed
=
fingerPrintFeed
.
value
.
length
-
1
;
while
(
i
<
lengthFeed
)
{
if
(
fingerPrintFeed
.
value
[
0
][
0
]
>=
range
.
startDate
){
i
+=
1
;
break
}
else
{
fingerPrintFeed
.
value
.
shift
();
lengthFeed
-=
1
}
}
fingerPrintFeedList
.
push
(
fingerPrintFeed
);
}
}
}
...
...
@@ -191,6 +260,18 @@ export const getFeedData = () => async (dispatch, getState) => {
keycardFeed
.
value
[
keycardFeed
.
value
.
length
]
=
[
query
.
results
[
0
].
values
[
index
][
0
],
current
]
}
if
(
index
==
query
.
results
[
0
].
values
.
length
-
1
)
{
let
i
=
0
;
let
lengthFeed
=
keycardFeed
.
value
.
length
-
1
;
while
(
i
<
lengthFeed
)
{
if
(
keycardFeed
.
value
[
0
][
0
]
>=
range
.
startDate
){
i
+=
1
;
break
}
else
{
keycardFeed
.
value
.
shift
();
lengthFeed
-=
1
}
}
keycardFeedList
.
push
(
keycardFeed
);
}
}
...
...
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