UI - Realtime - Fixing 'last_changed' status re #3224

pull/3227/head
dgtlmoon 2025-06-03 10:44:15 +02:00
rodzic 73f3beda00
commit 08728d7d03
2 zmienionych plików z 6 dodań i 9 usunięć

Wyświetl plik

@ -170,12 +170,10 @@ def handle_watch_update(socketio, **kwargs):
error_texts = ""
# Get the error texts from the watch
error_texts = watch.compile_error_texts()
# Create a simplified watch data object to send to clients
watch_uuid = watch.get('uuid')
watch_data = {
'checking_now': True if watch_uuid in running_uuids else False,
'checking_now': True if watch.get('uuid') in running_uuids else False,
'fetch_time': watch.get('fetch_time'),
'has_error': True if error_texts else False,
'last_changed': watch.get('last_changed'),
@ -183,13 +181,12 @@ def handle_watch_update(socketio, **kwargs):
'error_text': error_texts,
'history_n': watch.history_n,
'last_checked_text': _jinja2_filter_datetime(watch),
'last_changed_text': timeago.format(int(watch['last_changed']), time.time()) if watch.history_n >= 2 and int(
watch.get('last_changed', 0)) > 0 else 'Not yet',
'queued': True if watch_uuid in queue_list else False,
'last_changed_text': timeago.format(int(watch.last_changed), time.time()) if watch.history_n >= 2 and int(watch.last_changed) > 0 else 'Not yet',
'queued': True if watch.get('uuid') in queue_list else False,
'paused': True if watch.get('paused') else False,
'notification_muted': True if watch.get('notification_muted') else False,
'unviewed': watch.has_unviewed,
'uuid': watch_uuid,
'uuid': watch.get('uuid'),
'event_timestamp': time.time()
}

Wyświetl plik

@ -102,7 +102,7 @@ $(document).ready(function () {
$('td.title-col .error-text', $watchRow).html(watch.error_text)
$('td.last-changed', $watchRow).text(watch.last_checked_text)
$('td.last-changed', $watchRow).text(watch.last_changed_text)
$('td.last-checked .innertext', $watchRow).text(watch.last_checked_text)
$('td.last-checked', $watchRow).data('timestamp', watch.last_checked).data('fetchduration', watch.fetch_time);