diff --git a/ffmap/web/application.py b/ffmap/web/application.py index 75bac3f..daaea69 100755 --- a/ffmap/web/application.py +++ b/ffmap/web/application.py @@ -278,10 +278,20 @@ def router_info(dbid): if request.form.get("blocked") == "true": added = mysql.utcnow() mysql.execute("INSERT INTO blocked (mac, added) VALUES (%s, %s)",(mac,added,)) + mysql.execute(""" + INSERT INTO router_events (router, time, type, comment) + VALUES (%s, %s, %s, %s) + """,(dbid,mysql.utcnow(),"admin","Marked as blocked",)) mysql.commit() else: mysql.execute("DELETE FROM blocked WHERE mac = %s",(mac,)) + mysql.execute(""" + INSERT INTO router_events (router, time, type, comment) + VALUES (%s, %s, %s, %s) + """,(dbid,mysql.utcnow(),"admin","Removed blocked status",)) mysql.commit() + router["events"] = mysql.fetchall("""SELECT * FROM router_events WHERE router = %s""",(dbid,)) + router["events"] = mysql.utcawaretuple(router["events"],"time") else: flash("You are not authorized to perform this action!", "danger") elif request.form.get("act") == "report": diff --git a/ffmap/web/filters.py b/ffmap/web/filters.py index 2dcc167..7fdc88f 100644 --- a/ffmap/web/filters.py +++ b/ffmap/web/filters.py @@ -157,6 +157,7 @@ def status2css(status): "netmon": "primary", "update": "primary", "orphaned": "default", + "admin": "warning", } return "label label-%s" % status_map.get(status, "default")