Commit 3fb83614 authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

automation rm implemented

parent 683cda7b
......@@ -73,7 +73,6 @@ def get_last_hours(cur, appkey, devid, hours, p):
last = get_last_n(appkey, devid, 1)
utcb = last[1][0][0] - hours*3600*p
utcu = utcb + hours*3600
print(utcb, utcu)
query = """
SELECT * FROM
{}
......
......@@ -603,6 +603,26 @@ def new_automation():
return redirect(url_for('index'))
@app.route('/automation-rm')
def alarm_rm():
if 'name' in session:
nq.delete(session['appkey'], request.args.get('devid'), request.args.get('id'))
tr.delete(session['appkey'], request.args.get('devid'), request.args.get('id'))
tr.delete_function(session['appkey'], request.args.get('devid'), request.args.get('id'))
res = nfs.delete(session['appkey'], request.args.get('devid'), request.args.get('id'))
if res[0]:
flash('Automation removed', 'success')
return redirect(url_for('alerts'))
else:
flash('Automation cannot be removed : {}'.format(res[1]), 'danger')
return redirect(url_for('alerts'))
else:
return redirect(url_for('index'))
def pend_delete_all_ack():
pend.delete_all_ack()
......
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