Commit 8d792cf1 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

delete-dev added and tested

parent b3de5f00
......@@ -172,6 +172,15 @@ def dev():
return redirect(url_for('app'))
@server.route('/delete-dev')
def delete_dev():
dh = dd.DeviceDao()
dh.delete_datatable(session['appkey'], request.args.get('id'))
res = dh.delete(session['appkey'], request.args.get('id'))
return redirect(url_for('app', appkey=session['appkey']))
if __name__ == '__main__':
server.secret_key = 'sdjfklsjf^$654sd^#sPH'
server.run(debug = True, host='0.0.0.0')
......
......@@ -12,9 +12,9 @@
<p>Description : {{ dev[2] }} </p>
<p>Last time up : {{ ltup }} </p>
<a href="/data"><button type="submit" class="btn btn-primary">Data</button></a>
<a href="/dev-conf"><button type="submit" class="btn btn-primary">Configure</button></a>
<a href="/delete-dev"><button type="submit" class="btn btn-danger" onclick="return conf();">Delete Device</button></a>
<a href="/data?id={{ dev[1] }}"><button type="submit" class="btn btn-primary">Data</button></a>
<a href="/dev-conf={{ dev[1] }}"><button type="submit" class="btn btn-primary">Configure</button></a>
<a href="/delete-dev?id={{ dev[1] }}"><button type="submit" class="btn btn-danger" onclick="return conf();">Delete Device</button></a>
</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