fix: [Tracker] edit tracker filters

This commit is contained in:
Terrtia 2023-07-31 16:00:31 +02:00
parent ccf490a3f2
commit 64252ddf75
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0
3 changed files with 17 additions and 5 deletions

View file

@ -207,6 +207,13 @@ class Tracker:
if filters: if filters:
self._set_field('filters', json.dumps(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): def get_tracked(self):
return self._get_field('tracked') return self._get_field('tracked')
@ -513,6 +520,7 @@ class Tracker:
self._set_mails(mails) self._set_mails(mails)
# Filters # Filters
self.del_filters(old_type, old_to_track)
if not filters: if not filters:
filters = {} filters = {}
for obj_type in get_objects_tracked(): for obj_type in get_objects_tracked():

View file

@ -45,9 +45,9 @@ sender = sender@example.com
sender_host = smtp.example.com sender_host = smtp.example.com
sender_port = 1337 sender_port = 1337
sender_pw = None 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 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 = ca_file =
# Only needed when the credentials for email server needs a username instead of an email address # Only needed when the credentials for email server needs a username instead of an email address
#sender_user = sender #sender_user = sender

View file

@ -76,7 +76,7 @@
{# </div>#} {# </div>#}
<div class="custom-control custom-switch mt-1"> <div class="custom-control custom-switch mt-1">
<input class="custom-control-input" type="checkbox" name="decoded_obj" id="decoded_obj" checked=""> <input class="custom-control-input" type="checkbox" name="decoded_obj" id="decoded_obj" checked="">
<label class="custom-control-label" for="decoded_obj"><i class="fas fa-lock-open"></i>&nbsp;Decoded</label> <label class="custom-control-label" for="decoded_obj"><i class="fas fa-lock-open"></i>&nbsp;Decoded <i class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="right" title="Content that has been decoded from an encoded format, such as base64"></i></label>
</div> </div>
{# <div class="custom-control custom-switch mt-1">#} {# <div class="custom-control custom-switch mt-1">#}
{# <input class="custom-control-input" type="checkbox" name="domain_obj" id="domain_obj" checked="">#} {# <input class="custom-control-input" type="checkbox" name="domain_obj" id="domain_obj" checked="">#}
@ -84,7 +84,7 @@
{# </div>#} {# </div>#}
<div class="custom-control custom-switch mt-1"> <div class="custom-control custom-switch mt-1">
<input class="custom-control-input" type="checkbox" name="item_obj" id="item_obj" checked=""> <input class="custom-control-input" type="checkbox" name="item_obj" id="item_obj" checked="">
<label class="custom-control-label" for="item_obj"><i class="fas fa-file"></i>&nbsp;Item</label> <label class="custom-control-label" for="item_obj"><i class="fas fa-file"></i>&nbsp;Item <i class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="right" title="Text that has been processed by AIL. It can include various types of extracted information"></i></label>
</div> </div>
<div class="card border-dark mb-4" id="sources_item_div"> <div class="card border-dark mb-4" id="sources_item_div">
<div class="card-body"> <div class="card-body">
@ -101,7 +101,7 @@
<div class="custom-control custom-switch mt-1"> <div class="custom-control custom-switch mt-1">
<input class="custom-control-input" type="checkbox" name="pgp_obj" id="pgp_obj" checked=""> <input class="custom-control-input" type="checkbox" name="pgp_obj" id="pgp_obj" checked="">
<label class="custom-control-label" for="pgp_obj"><i class="fas fa-key"></i>&nbsp;PGP</label> <label class="custom-control-label" for="pgp_obj"><i class="fas fa-key"></i>&nbsp;PGP <i class="fas fa-info-circle text-info" data-toggle="tooltip" data-placement="right" title="PGP key/block metadata"></i></label>
</div> </div>
<div class="card border-dark mb-4" id="sources_pgp_div"> <div class="card border-dark mb-4" id="sources_pgp_div">
<div class="card-body"> <div class="card-body">
@ -351,6 +351,10 @@ $(document).ready(function(){
}); });
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
function toggle_sidebar(){ function toggle_sidebar(){
if($('#nav_menu').is(':visible')){ if($('#nav_menu').is(':visible')){
$('#nav_menu').hide(); $('#nav_menu').hide();