From 6ec73bc879aa19f4974a1d8222b4158a47d14aff Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 20 Oct 2023 10:52:45 +0200 Subject: [PATCH] Adding [stats] tab --- changedetectionio/model/Watch.py | 1 + changedetectionio/store.py | 4 +++- changedetectionio/templates/edit.html | 31 ++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index b7dfcd30..a965ae94 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -26,6 +26,7 @@ base_config = { 'extract_title_as_title': False, 'fetch_backend': 'system', # plaintext, playwright etc 'processor': 'text_json_diff', # could be restock_diff or others from .processors + 'fetch_time': 0.0, 'filter_failure_notification_send': strtobool(os.getenv('FILTER_FAILURE_NOTIFICATION_SEND_DEFAULT', 'True')), 'filter_text_added': True, 'filter_text_replaced': True, diff --git a/changedetectionio/store.py b/changedetectionio/store.py index 9f376df9..89a84575 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -244,8 +244,10 @@ class ChangeDetectionStore: import pathlib self.__data['watching'][uuid].update({ - 'last_checked': 0, + 'check_count': 0, + 'fetch_time' : 0.0, 'has_ldjson_price_data': None, + 'last_checked': 0, 'last_error': False, 'last_notification_error': False, 'last_viewed': 0, diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 3471e4bd..8abe08fe 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -49,6 +49,7 @@
  • Restock Detection
  • {% endif %}
  • Notifications
  • +
  • Stats
  • @@ -441,7 +442,35 @@ Unavailable") }} {% endif %} - +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Check count{{ watch.check_count }}
    Consecutive filter failures{{ watch.consecutive_filter_failures }}
    History length{{ watch.history|length }}
    Last fetch time{{ watch.fetch_time }}s
    +
    +
    {{ render_button(form.save_button) }}