mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 00:28:22 +00:00
chg: [trackers UI] add admin endpoint
This commit is contained in:
parent
d4766c5adc
commit
f4d20533cc
2 changed files with 16 additions and 0 deletions
|
@ -648,6 +648,14 @@ def get_global_trackers_meta(tracker_type=None):
|
||||||
metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'}))
|
metas.append(tracker.get_meta(options={'mails', 'sparkline', 'tags'}))
|
||||||
return metas
|
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):
|
def get_trackers_graph_by_day(l_trackers, num_day=31, date_from=None, date_to=None):
|
||||||
if date_from and date_to:
|
if date_from and date_to:
|
||||||
date_range = Date.substract_date(date_from, 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,
|
return render_template("trackersManagement.html", user_trackers=user_trackers, global_trackers=global_trackers,
|
||||||
bootstrap_label=bootstrap_label, tracker_type=tracker_type)
|
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")
|
@hunters.route("/tracker/show")
|
||||||
@login_required
|
@login_required
|
||||||
|
|
Loading…
Reference in a new issue