Skip to content

Commit

Permalink
chg: [Tracker] add more info
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Sep 13, 2019
1 parent a42676f commit fb35be7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions bin/packages/Term.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

sys.path.append(os.path.join(os.environ['AIL_FLASK'], 'modules'))
import Flask_config
from flask import escape

import Date
import Item
Expand Down Expand Up @@ -244,11 +245,11 @@ def add_tracked_term(term , term_type, user_id, level, tags, mails, dashboard=0)

# create term tags list
for tag in tags:
r_serv_term.sadd('tracker:tags:{}'.format(term_uuid), tag)
r_serv_term.sadd('tracker:tags:{}'.format(term_uuid), escape(tag) )

# create term tags mail notification list
for mail in mails:
r_serv_term.sadd('tracker:mail:{}'.format(term_uuid), mail)
r_serv_term.sadd('tracker:mail:{}'.format(term_uuid), escape(mail) )

# toggle refresh module tracker list/set
r_serv_term.set('tracker:refresh:{}'.format(term_type), time.time())
Expand Down
6 changes: 3 additions & 3 deletions var/www/modules/hunter/templates/Add_tracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ <h5 class="card-title">Create a new tracker</h5>
<script>
var chart = {};
$(document).ready(function(){
$("#page-Crawler").addClass("active");
$("#page-Tracker").addClass("active");
$("#nav_manual_crawler").addClass("active");
$("#tracker_desc").hide();
$("#term").hide();
Expand All @@ -117,12 +117,12 @@ <h5 class="card-title">Create a new tracker</h5>
$('#tracker_type').on('change', function() {
var tracker_type = this.value;
if (tracker_type=="word") {
$("#tracker_desc").text("Term to track:");
$("#tracker_desc").text("Token to track. You need to use a regex if you want to use one of the following special characters [<>~!?@#$%^&*|()_-+={}\":;,.\'\n\r\t]/\\ ");
$("#tracker_desc").show();
$("#term").show();
$("#nb_word").hide();
} else if (tracker_type=="set") {
$("#tracker_desc").text("Terms to track (space separated). Select the numbers of different tokens to trigger this tracker");
$("#tracker_desc").text("Set of Terms to track (space separated). This tracker is used to check if an item contain one or more terms specified in a set. If an item contain NB unique terms (by default NB of unique keywords = 1), this tracker is triggered. You need to use a regex if you want to use one of the following special characters [<>~!?@#$%^&*|()_-+={}\":;,.\'\n\r\t]/\\ ");
$("#tracker_desc").show();
$("#term").show();
$("#nb_word").show();
Expand Down
2 changes: 1 addition & 1 deletion var/www/modules/hunter/templates/showTracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ <h4 class="text-secondary">{{ tracker_metadata['uuid'] }} </h4>
$('#myTable_').DataTable({
"aLengthMenu": [[5, 10, 15, -1], [5, 10, 15, "All"]],
"iDisplayLength": 10,
"order": [[ 0, "desc" ]]
"order": [[ 0, "asc" ]]
});

sparkline("sparkline", {{ tracker_metadata['sparkline'] }}, {});
Expand Down

0 comments on commit fb35be7

Please sign in to comment.