Commit 4b2748f1 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

data dump files cleaning + dev no data view fixed

parent 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,
......@@ -8,6 +8,7 @@ import dao.device.device as dd
import dao.pend.pend as pend
import dao.data.data as data
import binascii
import os
APP_KEY_LEN = 8
......@@ -102,6 +103,14 @@ def app():
app = ah.get(session['appkey'])
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)
return render_template('app.html', app=app[1], devs=devs[1])
else:
......@@ -240,7 +249,7 @@ def dev_data():
if count[1][0] > 0:
return render_template('dev-data.html', data=last[1], total=count[1][0], lastctr=last_ctr, devname=session['devname'])
else:
return render_template('dev-data.html')
return render_template('dev-data.html', devname=session['devname'])
@server.route('/data-csv')
def data_csv():
......
......@@ -35,7 +35,7 @@
<a href="/data-csv"><button type="submit" class="btn btn-primary">Download CSV</button></a>
</center>
{% else %}
<h3>Device have not sent any data yet.</h3>
<h3><center>Device have not sent any data yet.</center></h3>
{% endif %}
</div>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment