From a199148ca707487a02ce31f31a47cc322096c3ea Mon Sep 17 00:00:00 2001 From: terrtia Date: Tue, 1 Oct 2024 10:11:57 +0200 Subject: [PATCH] fix: [tags] fix invalid tag obj_id function --- bin/lib/Tag.py | 1 + ...OcrDaterange.html => QrcodeDaterange.html} | 0 .../ocr/{ShowOcr.html => ShowQrcode.html} | 0 var/www/templates/objects/ocr/card_ocr.html | 167 ------------------ .../templates/objects/ocr/card_qrcode.html | 114 ++++++++++++ 5 files changed, 115 insertions(+), 167 deletions(-) rename var/www/templates/objects/ocr/{OcrDaterange.html => QrcodeDaterange.html} (100%) rename var/www/templates/objects/ocr/{ShowOcr.html => ShowQrcode.html} (100%) delete mode 100644 var/www/templates/objects/ocr/card_ocr.html create mode 100644 var/www/templates/objects/ocr/card_qrcode.html diff --git a/bin/lib/Tag.py b/bin/lib/Tag.py index ae0cb020..5d005ff2 100755 --- a/bin/lib/Tag.py +++ b/bin/lib/Tag.py @@ -1642,6 +1642,7 @@ def _fix_tag_obj_id(date_from): if ';' in tag: print(tag) new_tag = tag.split(';')[0] + tag = tag.replace('"', '\"') print(new_tag) r_tags.hdel(f'tag_metadata:{tag}', 'first_seen') r_tags.hdel(f'tag_metadata:{tag}', 'last_seen') diff --git a/var/www/templates/objects/ocr/OcrDaterange.html b/var/www/templates/objects/ocr/QrcodeDaterange.html similarity index 100% rename from var/www/templates/objects/ocr/OcrDaterange.html rename to var/www/templates/objects/ocr/QrcodeDaterange.html diff --git a/var/www/templates/objects/ocr/ShowOcr.html b/var/www/templates/objects/ocr/ShowQrcode.html similarity index 100% rename from var/www/templates/objects/ocr/ShowOcr.html rename to var/www/templates/objects/ocr/ShowQrcode.html diff --git a/var/www/templates/objects/ocr/card_ocr.html b/var/www/templates/objects/ocr/card_ocr.html deleted file mode 100644 index 3e7292a6..00000000 --- a/var/www/templates/objects/ocr/card_ocr.html +++ /dev/null @@ -1,167 +0,0 @@ - - - -{% with modal_add_tags=ail_tags %} - {% include 'modals/add_tags.html' %} -{% endwith %} - -{% include 'modals/edit_tag.html' %} - - - -
-
-

{{ meta["id"] }} :

-
    -
  • - - - - - - - - -
    - - - - {{ meta["svg_icon"]["icon"] }} - - - {{ meta['type'] }} - First Seen: {% if meta['first_seen'] %}{{ meta['first_seen'][0:4] }}-{{ meta['first_seen'][4:6] }}-{{ meta['first_seen'][6:8] }}{% endif %}Last Seen: {% if meta['last_seen'] %}{{ meta['last_seen'][0:4] }}-{{ meta['last_seen'][4:6] }}-{{ meta['last_seen'][6:8] }}{% endif %}
    -
  • -
  • -
    -
    -
    - -
    -
    -
    - {% include 'objects/image/block_blur_img_slider.html' %} - - - - {% for c in meta['map'] %} - - {% endfor %} - -
    -
    -
    -
    -
  • -
  • -
    {{ meta['content'] }}
    - {% if meta['translation'] %} -
    -
    {{ meta['translation'] }}
    - {% endif %} - - - - {% if not is_correlation %} -
    - - {% set mess_id_escape= meta['id'] | replace("/", "_") %} - -
    -
    -
    - - - Source: - - - - {% if translation_target %} - -     Target:{{translation_target}} - - - {% else %} - - {% endif %} -
    - -
    -
    -
    - {% endif %} - - - - -
  • - -
  • -
    - Tags: - {% for tag in meta['tags'] %} - - {% endfor %} - -
    -
  • -
- - {% with obj_type='ocr', obj_id=meta['id'], obj_subtype='' %} - {% include 'modals/investigations_register_obj.html' %} - {% endwith %} - - - - {% if is_correlation %} - - - - {% else %} - - - - {% endif %} - - -
-
\ No newline at end of file diff --git a/var/www/templates/objects/ocr/card_qrcode.html b/var/www/templates/objects/ocr/card_qrcode.html new file mode 100644 index 00000000..84c789b2 --- /dev/null +++ b/var/www/templates/objects/ocr/card_qrcode.html @@ -0,0 +1,114 @@ + + + +{% with modal_add_tags=ail_tags %} + {% include 'modals/add_tags.html' %} +{% endwith %} + +{% include 'modals/edit_tag.html' %} + + + +
+
+

{{ meta["id"] }} :

+
    +
  • + + + + + + + + +
    + + + + {{ meta["svg_icon"]["icon"] }} + + + {{ meta['type'] }} + First Seen: {% if meta['first_seen'] %}{{ meta['first_seen'][0:4] }}-{{ meta['first_seen'][4:6] }}-{{ meta['first_seen'][6:8] }}{% endif %}Last Seen: {% if meta['last_seen'] %}{{ meta['last_seen'][0:4] }}-{{ meta['last_seen'][4:6] }}-{{ meta['last_seen'][6:8] }}{% endif %}
    +
  • +
  • +
    +
    +
    + +
    +{#
    #} +{#
    #} +{# {% include 'objects/image/block_blur_img_slider.html' %}#} +{##} +{# #} +{# #} +{# {% for c in meta['map'] %}#} +{# #} +{# {% endfor %}#} +{# #} +{#
    #} +{#
    #} +
    +
    +
  • +
  • + + +
  • + +
  • +
    + Tags: + {% for tag in meta['tags'] %} + + {% endfor %} + +
    +
  • +
+ + {% with obj_type='qrcode', obj_id=meta['id'], obj_subtype='' %} + {% include 'modals/investigations_register_obj.html' %} + {% endwith %} + + + + {% if is_correlation %} + + + + {% else %} + + + + {% endif %} + + +
+
\ No newline at end of file