kopia lustrzana https://github.com/dgtlmoon/changedetection.io
pull/3183/head
rodzic
02de7e36e7
commit
1bd3068449
|
@ -103,6 +103,7 @@
|
|||
{% set checking_now = is_checking_now(watch) %}
|
||||
<tr id="{{ watch.uuid }}" data-watch-uuid="{{ watch.uuid }}"
|
||||
class="{{ loop.cycle('pure-table-odd', 'pure-table-even') }} processor-{{ watch['processor'] }}
|
||||
{# socket.js also sets these vars on the row for update #}
|
||||
{% if watch.last_error is defined and watch.last_error != False %}error{% endif %}
|
||||
{% if watch.last_notification_error is defined and watch.last_notification_error != False %}error{% endif %}
|
||||
{% if watch.paused is defined and watch.paused != False %}paused{% endif %}
|
||||
|
@ -189,11 +190,11 @@
|
|||
</td>
|
||||
{% endif %}
|
||||
{#last_checked becomes fetch-start-time#}
|
||||
<td class="last-checked" data-timestamp="{{ watch.last_checked }}" {% if checking_now %} data-fetchduration={{ watch.fetch_time }} data-eta_complete="{{ watch.last_checked+watch.fetch_time }}" {% endif %} >
|
||||
|
||||
<span style="display:none;" class="spinner"></span><span class="spinner-text" style="display:none;" > Checking now</span>
|
||||
|
||||
{{watch|format_last_checked_time|safe}}
|
||||
<td class="last-checked" data-timestamp="{{ watch.last_checked }}" data-fetchduration={{ watch.fetch_time }} data-eta_complete="{{ watch.last_checked+watch.fetch_time }}" >
|
||||
<div class="spinner-wrapper" style="display:none;" >
|
||||
<span class="spinner"></span><span> Checking now</span>
|
||||
</div>
|
||||
<span class="innertext">{{watch|format_last_checked_time|safe}}</span>
|
||||
</td>
|
||||
|
||||
|
||||
|
@ -204,9 +205,9 @@
|
|||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a {% if watch.uuid in queued_uuids %}disabled="true"{% endif %} href="{{ url_for('ui.form_watch_checknow', uuid=watch.uuid, tag=request.args.get('tag')) }}"
|
||||
class="recheck pure-button pure-button-primary">{% if watch.uuid in queued_uuids %}Queued{% else %}Recheck{% endif %}</a>
|
||||
<a href="" class="already-in-queue-button recheck pure-button pure-button-primary" style="display: none;" disabled="disabled">Queued</a>
|
||||
|
||||
<a href="{{ url_for('ui.form_watch_checknow', uuid=watch.uuid, tag=request.args.get('tag')) }}" class="recheck pure-button pure-button-primary">Recheck</a>
|
||||
<a href="{{ url_for('ui.ui_edit.edit_page', uuid=watch.uuid, tag=active_tag_uuid)}}#general" class="pure-button pure-button-primary">Edit</a>
|
||||
|
||||
{% if watch.history_n >= 2 %}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import timeago
|
||||
from flask import Flask
|
||||
from flask_socketio import SocketIO
|
||||
import threading
|
||||
|
@ -94,15 +95,19 @@ class ChangeDetectionSocketIO:
|
|||
if hasattr(q_item, 'item') and 'uuid' in q_item.item:
|
||||
queue_list.append(q_item.item['uuid'])
|
||||
|
||||
|
||||
# Create a simplified watch data object to send to clients
|
||||
watch_data = {
|
||||
'uuid': watch.get('uuid'),
|
||||
'last_checked_text': _jinja2_filter_datetime(watch),
|
||||
'last_checked': watch.get('last_checked'),
|
||||
'last_changed': watch.get('last_changed'),
|
||||
'queued': True if watch.get('uuid') in queue_list else False,
|
||||
'checking_now': True if watch.get('uuid') in running_uuids else False,
|
||||
'fetch_time': watch.get('fetch_time'),
|
||||
'has_error': watch.get('last_error') or watch.get('last_notification_error'),
|
||||
'last_changed': watch.get('last_changed'),
|
||||
'last_checked': watch.get('last_checked'),
|
||||
'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.get('uuid') in queue_list else False,
|
||||
'unviewed': watch.has_unviewed,
|
||||
'uuid': watch.get('uuid'),
|
||||
}
|
||||
self.socketio.emit("watch_update", watch_data)
|
||||
logger.debug(f"Socket.IO: Emitted update for watch {watch.get('uuid')}")
|
||||
|
|
|
@ -40,6 +40,12 @@ $(document).ready(function() {
|
|||
$($watchRow).toggleClass('checking-now', watch.checking_now);
|
||||
$($watchRow).toggleClass('queued', watch.queued);
|
||||
$($watchRow).toggleClass('unviewed', watch.unviewed);
|
||||
$($watchRow).toggleClass('error', watch.has_error);
|
||||
$('td.last-changed', $watchRow).text(watch.last_checked_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);
|
||||
$('td.last-checked', $watchRow).data('eta_complete', watch.last_checked + watch.fetch_time);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -52,10 +52,21 @@
|
|||
/* Row with 'checking-now' */
|
||||
tr.checking-now {
|
||||
td.last-checked {
|
||||
.spinner, .spinner-text {
|
||||
.spinner-wrapper {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.innertext {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
tr.queued {
|
||||
a.recheck {
|
||||
display: none !important;
|
||||
}
|
||||
a.already-in-queue-button {
|
||||
display: inline-block !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -551,7 +551,13 @@ body.preview-text-enabled {
|
|||
.watch-table .current-diff-url::after {
|
||||
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
|
||||
margin: 0 3px 0 5px; }
|
||||
.watch-table tr.checking-now td.last-checked .spinner, .watch-table tr.checking-now td.last-checked .spinner-text {
|
||||
.watch-table tr.checking-now td.last-checked .spinner-wrapper {
|
||||
display: inline-block !important; }
|
||||
.watch-table tr.checking-now td.last-checked .innertext {
|
||||
display: none !important; }
|
||||
.watch-table tr.queued a.recheck {
|
||||
display: none !important; }
|
||||
.watch-table tr.queued a.already-in-queue-button {
|
||||
display: inline-block !important; }
|
||||
|
||||
ul#conditions_match_logic {
|
||||
|
|
Ładowanie…
Reference in New Issue