FIX dbadmin pages
This commit is contained in:
parent
e35834a21d
commit
d7fcdd3f09
1 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,7 @@ def home():
|
||||||
|
|
||||||
@db.route('/list')
|
@db.route('/list')
|
||||||
def list():
|
def list():
|
||||||
model = current_app.larigira.monitor.source.model
|
model = current_app.larigira.controller.monitor.model
|
||||||
alarms = tuple(model.get_all_alarms())
|
alarms = tuple(model.get_all_alarms())
|
||||||
events = [(alarm, model.get_actions_by_alarm(alarm))
|
events = [(alarm, model.get_actions_by_alarm(alarm))
|
||||||
for alarm in alarms]
|
for alarm in alarms]
|
||||||
|
@ -39,7 +39,7 @@ def addtime_kind(kind):
|
||||||
form = Form()
|
form = Form()
|
||||||
if request.method == 'POST' and form.validate():
|
if request.method == 'POST' and form.validate():
|
||||||
data = receiver(form)
|
data = receiver(form)
|
||||||
model = current_app.larigira.monitor.source.model
|
model = current_app.larigira.controller.monitor.model
|
||||||
eid = model.add_alarm(data)
|
eid = model.add_alarm(data)
|
||||||
return redirect(url_for('db.edit_event', alarmid=eid))
|
return redirect(url_for('db.edit_event', alarmid=eid))
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ def addaudio_kind(kind):
|
||||||
form = Form()
|
form = Form()
|
||||||
if request.method == 'POST' and form.validate():
|
if request.method == 'POST' and form.validate():
|
||||||
data = receiver(form)
|
data = receiver(form)
|
||||||
model = current_app.larigira.monitor.source.model
|
model = current_app.larigira.controller.monitor.model
|
||||||
eid = model.add_action(data)
|
eid = model.add_action(data)
|
||||||
return jsonify(dict(inserted=eid, data=data))
|
return jsonify(dict(inserted=eid, data=data))
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ def addaudio_kind(kind):
|
||||||
|
|
||||||
@db.route('/edit/event/<alarmid>')
|
@db.route('/edit/event/<alarmid>')
|
||||||
def edit_event(alarmid):
|
def edit_event(alarmid):
|
||||||
model = current_app.larigira.monitor.source.model
|
model = current_app.larigira.controller.monitor.model
|
||||||
alarm = model.get_alarm_by_id(int(alarmid))
|
alarm = model.get_alarm_by_id(int(alarmid))
|
||||||
if alarm is None:
|
if alarm is None:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
@ -84,7 +84,7 @@ def change_actions(alarmid):
|
||||||
new_actions = request.form.getlist('actions[]')
|
new_actions = request.form.getlist('actions[]')
|
||||||
if new_actions is None:
|
if new_actions is None:
|
||||||
new_actions = []
|
new_actions = []
|
||||||
model = current_app.larigira.monitor.source.model
|
model = current_app.larigira.controller.monitor.model
|
||||||
ret = model.update_alarm(int(alarmid),
|
ret = model.update_alarm(int(alarmid),
|
||||||
new_fields={'actions': [int(a) for a in
|
new_fields={'actions': [int(a) for a in
|
||||||
new_actions]})
|
new_actions]})
|
||||||
|
|
Loading…
Reference in a new issue