From 64252ddf752bacb4cb9c362c3213b81a7de7fdb5 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Mon, 31 Jul 2023 16:00:31 +0200 Subject: [PATCH] fix: [Tracker] edit tracker filters --- bin/lib/Tracker.py | 8 ++++++++ configs/core.cfg.sample | 4 ++-- var/www/templates/hunter/tracker_add.html | 10 +++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bin/lib/Tracker.py b/bin/lib/Tracker.py index b7ca5e77..f1588137 100755 --- a/bin/lib/Tracker.py +++ b/bin/lib/Tracker.py @@ -207,6 +207,13 @@ class Tracker: if filters: self._set_field('filters', json.dumps(filters)) + def del_filters(self, tracker_type, to_track): + filters = self.get_filters() + for obj_type in filters: + r_tracker.srem(f'trackers:objs:{tracker_type}:{obj_type}', to_track) + r_tracker.srem(f'trackers:uuid:{tracker_type}:{to_track}', f'{self.uuid}:{obj_type}') + r_tracker.hdel(f'tracker:{self.uuid}', 'filters') + def get_tracked(self): return self._get_field('tracked') @@ -513,6 +520,7 @@ class Tracker: self._set_mails(mails) # Filters + self.del_filters(old_type, old_to_track) if not filters: filters = {} for obj_type in get_objects_tracked(): diff --git a/configs/core.cfg.sample b/configs/core.cfg.sample index 9bdf40a4..3278033f 100644 --- a/configs/core.cfg.sample +++ b/configs/core.cfg.sample @@ -45,9 +45,9 @@ sender = sender@example.com sender_host = smtp.example.com sender_port = 1337 sender_pw = None -# Only needed for SSL if the mail server don't support TLS (used by default). use this option to validate the server certificate. +# Only needed for SMTP over SSL if the mail server don't support TLS (used by default). use this option to validate the server certificate. cert_required = False -# Only needed for the SSL if you want to validate your self signed certificate for SSL +# Only needed for SMTP over SSL if you want to validate your self signed certificate for SSL ca_file = # Only needed when the credentials for email server needs a username instead of an email address #sender_user = sender diff --git a/var/www/templates/hunter/tracker_add.html b/var/www/templates/hunter/tracker_add.html index 9233e4ad..7cc690ba 100644 --- a/var/www/templates/hunter/tracker_add.html +++ b/var/www/templates/hunter/tracker_add.html @@ -76,7 +76,7 @@ {# #}
- +
{#
#} {# #} @@ -84,7 +84,7 @@ {#
#}
- +
@@ -101,7 +101,7 @@
- +
@@ -351,6 +351,10 @@ $(document).ready(function(){ }); +$(function () { + $('[data-toggle="tooltip"]').tooltip() +}) + function toggle_sidebar(){ if($('#nav_menu').is(':visible')){ $('#nav_menu').hide();