Commit dcbba1e7 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

device config remove fixed

parent 58739b2e
......@@ -2,6 +2,8 @@
{% block title %} HPC&A IoT - Device Configuration {% endblock %}
{% block header %} <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> {% endblock %}
{% block location %} <a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="./applications">Applications</a>
<p class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"> &nbsp;-&nbsp; </p>
<a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="/application/{{ app[1] }}">{{ app[0] }}</a>
......@@ -60,7 +62,7 @@
{% endif %}
</span>
</td>
<td> <a href="/dev-conf-rm?conf={{ c[3] }}"> <span class="glyphicon glyphicon-remove"</span> </a> </td>
<td> <a href="/application/{{ app[1] }}/device/{{ dev[1] }}/remove-configuration?conf={{ c[3] }}"> <span class="fa fa-remove"</span> </a> </td>
</tr>
{% endfor %}
</tbody>
......
......@@ -423,19 +423,19 @@ def dev_conf():
else:
return redirect(url_for('index'))
@app.route('/dev-conf-rm')
def dev_conf_rm():
if 'name' in session and 'appkey' in session and 'devid' in session:
res = pend.delete(session['appkey'], session['devid'], request.args.get('conf')+'_')
@app.route('/application/<appkey>/device/<devid>/remove-configuration')
def dev_conf_rm(appkey, devid):
if 'name' in session:
res = pend.delete(appkey, devid, request.args.get('conf')+'_')
if res[0]:
flash('Configuration message successfully removed.','success')
return redirect(url_for('dev_conf'))
return redirect(url_for('applications'))
else:
flash('Error removing configuration message: {}'.format(res[1]), 'danger')
return redirect(url_for('dev_conf'))
return redirect(url_for('applications'))
else:
return redirect(url_for('index'))
return redirect(url_for('login'))
@app.route('/delete-dev')
......
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