Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Rykov
THSO.server
Commits
4b2748f1
Commit
4b2748f1
authored
Apr 15, 2020
by
Vladislav Rykov
Browse files
data dump files cleaning + dev no data view fixed
parent
345294e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
data/0fcaa6df_1.csv
deleted
100644 → 0
View file @
345294e8
rh,temp,
40.3,20.2,
41.3,22.2,
21.5,55.2,
71.5,33.2,
31.5,53.2,
21.5,13.2,
81.5,23.2,
11.5,93.2,
data/0fcaa6df_5.csv
deleted
100644 → 0
View file @
345294e8
server.py
View file @
4b2748f1
...
@@ -8,6 +8,7 @@ import dao.device.device as dd
...
@@ -8,6 +8,7 @@ import dao.device.device as dd
import
dao.pend.pend
as
pend
import
dao.pend.pend
as
pend
import
dao.data.data
as
data
import
dao.data.data
as
data
import
binascii
import
binascii
import
os
APP_KEY_LEN
=
8
APP_KEY_LEN
=
8
...
@@ -102,6 +103,14 @@ def app():
...
@@ -102,6 +103,14 @@ def app():
app
=
ah
.
get
(
session
[
'appkey'
])
app
=
ah
.
get
(
session
[
'appkey'
])
devs
=
dh
.
get_list
(
app
[
1
][
1
])
devs
=
dh
.
get_list
(
app
[
1
][
1
])
try
:
filelist
=
[
f
for
f
in
os
.
listdir
(
DATA_DOWNLOAD_DIR
)
if
f
.
startswith
(
session
[
'appkey'
])]
print
(
filelist
)
for
f
in
filelist
:
os
.
remove
(
DATA_DOWNLOAD_DIR
+
'/'
+
f
)
except
OSError
:
pass
# print('devs : ', devs)
# print('devs : ', devs)
return
render_template
(
'app.html'
,
app
=
app
[
1
],
devs
=
devs
[
1
])
return
render_template
(
'app.html'
,
app
=
app
[
1
],
devs
=
devs
[
1
])
else
:
else
:
...
@@ -240,7 +249,7 @@ def dev_data():
...
@@ -240,7 +249,7 @@ def dev_data():
if
count
[
1
][
0
]
>
0
:
if
count
[
1
][
0
]
>
0
:
return
render_template
(
'dev-data.html'
,
data
=
last
[
1
],
total
=
count
[
1
][
0
],
lastctr
=
last_ctr
,
devname
=
session
[
'devname'
])
return
render_template
(
'dev-data.html'
,
data
=
last
[
1
],
total
=
count
[
1
][
0
],
lastctr
=
last_ctr
,
devname
=
session
[
'devname'
])
else
:
else
:
return
render_template
(
'dev-data.html'
)
return
render_template
(
'dev-data.html'
,
devname
=
session
[
'devname'
]
)
@
server
.
route
(
'/data-csv'
)
@
server
.
route
(
'/data-csv'
)
def
data_csv
():
def
data_csv
():
...
...
templates/dev-data.html
View file @
4b2748f1
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<a
href=
"/data-csv"
><button
type=
"submit"
class=
"btn btn-primary"
>
Download CSV
</button></a>
<a
href=
"/data-csv"
><button
type=
"submit"
class=
"btn btn-primary"
>
Download CSV
</button></a>
</center>
</center>
{% else %}
{% else %}
<h3>
Device have not sent any data yet.
</h3>
<h3>
<center>
Device have not sent any data yet.
</
center></
h3>
{% endif %}
{% endif %}
</div>
</div>
</div>
</div>
...
...
Write
Preview
Supports
Markdown
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