mirror of https://github.com/CIRCL/AIL-framework
chg: [trackers UI] add admin endpoint
parent
d4766c5adc
commit
f4d20533cc
|
@ -648,6 +648,14 @@ def get_global_trackers_meta(tracker_type=None):
|
|||
metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'}))
|
||||
return metas
|
||||
|
||||
def get_users_trackers_meta():
|
||||
trackers = []
|
||||
for tracker_uuid in get_trackers():
|
||||
tracker = Tracker(tracker_uuid)
|
||||
if tracker.is_level_user():
|
||||
trackers.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'}))
|
||||
return trackers
|
||||
|
||||
def get_trackers_graph_by_day(l_trackers, num_day=31, date_from=None, date_to=None):
|
||||
if date_from and date_to:
|
||||
date_range = Date.substract_date(date_from, date_to)
|
||||
|
|
|
@ -129,6 +129,14 @@ def tracked_menu_typosquatting():
|
|||
return render_template("trackersManagement.html", user_trackers=user_trackers, global_trackers=global_trackers,
|
||||
bootstrap_label=bootstrap_label, tracker_type=tracker_type)
|
||||
|
||||
@hunters.route("/trackers/admin")
|
||||
@login_required
|
||||
@login_admin
|
||||
def tracked_menu_admin():
|
||||
user_trackers = Tracker.get_users_trackers_meta()
|
||||
return render_template("trackersManagement.html", user_trackers=user_trackers, global_trackers=[],
|
||||
bootstrap_label=bootstrap_label)
|
||||
|
||||
|
||||
@hunters.route("/tracker/show")
|
||||
@login_required
|
||||
|
|
Loading…
Reference in New Issue