2021-01-27 11:39:46 +00:00
{% extends 'base.html' %}
{% block content %}
2024-05-02 09:46:31 +00:00
{% from '_helpers.html' import render_simple_field, render_field, render_nolabel_field, sort_by_title %}
2023-04-30 08:38:50 +00:00
< script src = "{{url_for('static_content', group='js', filename='jquery-3.6.0.min.js')}}" > < / script >
< script src = "{{url_for('static_content', group='js', filename='watch-overview.js')}}" defer > < / script >
2022-05-23 21:44:51 +00:00
2021-01-27 11:39:46 +00:00
< div class = "box" >
2024-12-04 17:25:26 +00:00
< form class = "pure-form" action = "{{ url_for('form_quick_watch_add', tag=active_tag_uuid) }}" method = "POST" id = "new-watch-form" >
2023-04-29 20:29:57 +00:00
< input type = "hidden" name = "csrf_token" value = "{{ csrf_token() }}" >
2021-01-28 17:38:47 +00:00
< fieldset >
2021-01-30 09:40:42 +00:00
< legend > Add a new change detection watch< / legend >
2022-07-28 10:13:26 +00:00
< div id = "watch-add-wrapper-zone" >
2023-11-28 17:11:11 +00:00
{{ render_nolabel_field(form.url, placeholder="https://...", required=true) }}
2024-05-20 13:49:12 +00:00
{{ render_nolabel_field(form.tags, value=active_tag.title if active_tag_uuid else '', placeholder="watch label / tag") }}
2023-11-28 17:11:11 +00:00
{{ render_nolabel_field(form.watch_submit_button, title="Watch this URL!" ) }}
{{ render_nolabel_field(form.edit_and_watch_submit_button, title="Edit first then Watch") }}
2022-07-28 10:13:26 +00:00
< / div >
2023-03-18 19:36:26 +00:00
< div id = "quick-watch-processor-type" >
2023-11-29 09:19:49 +00:00
{{ render_simple_field(form.processor) }}
2023-03-18 19:36:26 +00:00
< / div >
2021-01-28 17:38:47 +00:00
< / fieldset >
2023-04-29 20:29:57 +00:00
< span style = "color:#eee; font-size: 80%;" > < img alt = "Create a shareable link" style = "height: 1em;display:inline-block;" src = "{{url_for('static_content', group='images', filename='spread-white.svg')}}" > Tip: You can also add 'shared' watches. < a href = "https://github.com/dgtlmoon/changedetection.io/wiki/Sharing-a-Watch" > More info< / a > < / span >
2021-01-28 17:38:47 +00:00
< / form >
2022-08-18 12:48:21 +00:00
< form class = "pure-form" action = "{{ url_for('form_watch_list_checkbox_operations') }}" method = "POST" id = "watch-list-form" >
2023-04-29 20:29:57 +00:00
< input type = "hidden" name = "csrf_token" value = "{{ csrf_token() }}" >
2023-06-19 21:29:13 +00:00
< input type = "hidden" id = "op_extradata" name = "op_extradata" value = "" >
2022-08-18 12:48:21 +00:00
< div id = "checkbox-operations" >
2023-03-18 19:36:26 +00:00
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "pause" > Pause< / button >
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "unpause" > UnPause< / button >
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "mute" > Mute< / button >
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "unmute" > UnMute< / button >
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "recheck" > Recheck< / button >
2023-06-19 21:29:13 +00:00
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "assign-tag" id = "checkbox-assign-tag" > Tag< / button >
2023-04-29 17:20:19 +00:00
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "mark-viewed" > Mark viewed< / button >
2023-03-18 19:36:26 +00:00
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "notification-default" > Use default notification< / button >
2024-03-06 18:16:13 +00:00
< button class = "pure-button button-secondary button-xsmall" name = "op" value = "clear-errors" > Clear errors< / button >
2023-05-07 12:19:30 +00:00
< button class = "pure-button button-secondary button-xsmall" style = "background: #dd4242;" name = "op" value = "clear-history" > Clear/reset history< / button >
< button class = "pure-button button-secondary button-xsmall" style = "background: #dd4242;" name = "op" value = "delete" > Delete< / button >
2022-08-18 12:48:21 +00:00
< / div >
2023-04-29 17:24:13 +00:00
{% if watches|length >= pagination.per_page %}
{{ pagination.info }}
{% endif %}
2023-05-16 21:01:32 +00:00
{% if search_q %}< div id = "search-result-info" > Searching "< strong > < i > {{search_q}}< / i > < / strong > "< / div > {% endif %}
2021-01-29 14:51:30 +00:00
< div >
2024-05-20 13:49:12 +00:00
< a href = "{{url_for('index')}}" class = "pure-button button-tag {{'active' if not active_tag_uuid }}" > All< / a >
2024-02-21 09:03:09 +00:00
<!-- tag list -->
{% for uuid, tag in tags %}
{% if tag != "" %}
< a href = "{{url_for('index', tag=uuid) }}" class = "pure-button button-tag {{'active' if active_tag_uuid == uuid }}" > {{ tag.title }}< / a >
{% endif %}
{% endfor %}
2021-01-29 16:50:47 +00:00
< / div >
2021-01-29 14:39:38 +00:00
2023-04-29 15:44:23 +00:00
{% set sort_order = sort_order or 'asc' %}
{% set sort_attribute = sort_attribute or 'last_changed' %}
2022-08-16 08:45:36 +00:00
{% set pagination_page = request.args.get('page', 0) %}
2024-07-12 15:09:42 +00:00
{% set cols_required = 6 %}
{% set any_has_restock_price_processor = datastore.any_watches_have_processor_by_name("restock_diff") %}
{% if any_has_restock_price_processor %}
{% set cols_required = cols_required + 1 %}
{% endif %}
2022-08-16 08:45:36 +00:00
2021-01-28 17:38:47 +00:00
< div id = "watch-table-wrapper" >
2023-04-29 17:24:13 +00:00
2021-01-28 17:38:47 +00:00
< table class = "pure-table pure-table-striped watch-table" >
< thead >
< tr >
2023-04-29 15:44:23 +00:00
{% set link_order = "desc" if sort_order == 'asc' else "asc" %}
2022-08-16 10:49:08 +00:00
{% set arrow_span = "" %}
2024-05-20 13:49:12 +00:00
< th > < input style = "vertical-align: middle" type = "checkbox" id = "check-all" > < a class = "{{ 'active '+link_order if sort_attribute == 'date_created' else 'inactive' }}" href = "{{url_for('index', sort='date_created', order=link_order, tag=active_tag_uuid)}}" > # < span class = 'arrow {{link_order}}' > < / span > < / a > < / th >
2024-07-03 15:13:31 +00:00
< th class = "empty-cell" > < / th >
2024-05-20 13:49:12 +00:00
< th > < a class = "{{ 'active '+link_order if sort_attribute == 'label' else 'inactive' }}" href = "{{url_for('index', sort='label', order=link_order, tag=active_tag_uuid)}}" > Website < span class = 'arrow {{link_order}}' > < / span > < / a > < / th >
2024-07-12 15:09:42 +00:00
{% if any_has_restock_price_processor %}
< th > Restock & Price< / th >
{% endif %}
2024-10-07 07:02:21 +00:00
< th > < a class = "{{ 'active '+link_order if sort_attribute == 'last_checked' else 'inactive' }}" href = "{{url_for('index', sort='last_checked', order=link_order, tag=active_tag_uuid)}}" > < span class = "hide-on-mobile" > Last< / span > Checked < span class = 'arrow {{link_order}}' > < / span > < / a > < / th >
< th > < a class = "{{ 'active '+link_order if sort_attribute == 'last_changed' else 'inactive' }}" href = "{{url_for('index', sort='last_changed', order=link_order, tag=active_tag_uuid)}}" > < span class = "hide-on-mobile" > Last< / span > Changed < span class = 'arrow {{link_order}}' > < / span > < / a > < / th >
2024-07-03 15:13:31 +00:00
< th class = "empty-cell" > < / th >
2021-01-28 17:38:47 +00:00
< / tr >
< / thead >
< tbody >
2023-05-16 21:01:32 +00:00
{% if not watches|length %}
< tr >
2024-07-12 15:09:42 +00:00
< td colspan = "{{ cols_required }}" style = "text-wrap: wrap;" > No website watches configured, please add a URL in the box above, or < a href = "{{ url_for('import_page')}}" > import a list< / a > .< / td >
2023-05-16 21:01:32 +00:00
< / tr >
{% endif %}
2023-05-25 14:38:54 +00:00
{% for watch in (watches|sort(attribute=sort_attribute, reverse=sort_order == 'asc'))|pagination_slice(skip=pagination.skip) %}
2023-11-17 16:21:26 +00:00
{% set is_unviewed = watch.newest_history_key| int > watch.last_viewed and watch.history_n>=2 %}
2021-01-28 17:38:47 +00:00
< tr id = "{{ watch.uuid }}"
2023-03-18 19:36:26 +00:00
class="{{ loop.cycle('pure-table-odd', 'pure-table-even') }} processor-{{ watch['processor'] }}
2021-02-11 09:36:54 +00:00
{% if watch.last_error is defined and watch.last_error != False %}error{% endif %}
2022-02-04 19:54:20 +00:00
{% if watch.last_notification_error is defined and watch.last_notification_error != False %}error{% endif %}
2021-03-29 14:11:22 +00:00
{% if watch.paused is defined and watch.paused != False %}paused{% endif %}
2023-11-17 16:21:26 +00:00
{% if is_unviewed %}unviewed{% endif %}
2024-07-12 15:09:42 +00:00
{% if watch.has_restock_info %} has-restock-info {% if watch['restock']['in_stock'] %}in-stock{% else %}not-in-stock{% endif %} {% else %}no-restock-info{% endif %}
2022-04-21 10:52:45 +00:00
{% if watch.uuid in queued_uuids %}queued{% endif %}">
2023-04-29 20:29:57 +00:00
< td class = "inline checkbox-uuid" > < input name = "uuids" type = "checkbox" value = "{{ watch.uuid}} " > < span > {{ loop.index+pagination.skip }}< / span > < / td >
2022-07-29 19:09:55 +00:00
< td class = "inline watch-controls" >
2022-09-08 15:50:45 +00:00
{% if not watch.paused %}
2024-05-20 13:49:12 +00:00
< a class = "state-off" href = "{{url_for('index', op='pause', uuid=watch.uuid, tag=active_tag_uuid)}}" > < img src = "{{url_for('static_content', group='images', filename='pause.svg')}}" alt = "Pause checks" title = "Pause checks" class = "icon icon-pause" > < / a >
2022-09-08 15:50:45 +00:00
{% else %}
2024-05-20 13:49:12 +00:00
< a class = "state-on" href = "{{url_for('index', op='pause', uuid=watch.uuid, tag=active_tag_uuid)}}" > < img src = "{{url_for('static_content', group='images', filename='play.svg')}}" alt = "UnPause checks" title = "UnPause checks" class = "icon icon-unpause" > < / a >
2022-09-08 15:50:45 +00:00
{% endif %}
2024-05-20 13:49:12 +00:00
< a class = "link-mute state-{{'on' if watch.notification_muted else 'off'}}" href = "{{url_for('index', op='mute', uuid=watch.uuid, tag=active_tag_uuid)}}" > < img src = "{{url_for('static_content', group='images', filename='bell-off.svg')}}" alt = "Mute notifications" title = "Mute notifications" class = "icon icon-mute" > < / a >
2022-07-29 19:09:55 +00:00
< / td >
2021-06-22 00:21:53 +00:00
< td class = "title-col inline" > {{watch.title if watch.title is not none and watch.title|length > 0 else watch.url}}
2022-10-27 11:29:24 +00:00
< a class = "external" target = "_blank" rel = "noopener" href = "{{ watch.link.replace('source:','') }}" > < / a >
2023-04-29 20:29:57 +00:00
< a class = "link-spread" href = "{{url_for('form_share_put_watch', uuid=watch.uuid)}}" > < img src = "{{url_for('static_content', group='images', filename='spread.svg')}}" class = "status-icon icon icon-spread" title = "Create a link to share watch config with others" > < / a >
2021-08-12 10:05:59 +00:00
2023-01-25 17:07:44 +00:00
{% if watch.get_fetch_backend == "html_webdriver"
or ( watch.get_fetch_backend == "system" and system_default_fetcher == 'html_webdriver' )
2023-11-13 15:39:11 +00:00
or "extra_browser_" in watch.get_fetch_backend
2023-01-25 17:07:44 +00:00
%}
2023-11-13 15:39:11 +00:00
< img class = "status-icon" src = "{{url_for('static_content', group='images', filename='Google-Chrome-icon.png')}}" title = "Using a Chrome browser" >
2023-01-25 17:07:44 +00:00
{% endif %}
2023-04-29 20:29:57 +00:00
{%if watch.is_pdf %}< img class = "status-icon" src = "{{url_for('static_content', group='images', filename='pdf-icon.svg')}}" title = "Converting PDF to text" > {% endif %}
2024-01-29 11:36:53 +00:00
{% if watch.has_browser_steps %}< img class = "status-icon status-browsersteps" src = "{{url_for('static_content', group='images', filename='steps.svg')}}" title = "Browser Steps is enabled" > {% endif %}
2021-01-28 17:38:47 +00:00
{% if watch.last_error is defined and watch.last_error != False %}
2022-12-23 21:26:24 +00:00
< div class = "fetch-error" > {{ watch.last_error }}
{% if '403' in watch.last_error %}
{% if has_proxies %}
< a href = "{{ url_for('settings_page', uuid=watch.uuid) }}#proxies" > Try other proxies/location< / a >
{% endif %}
< a href = "{{ url_for('settings_page', uuid=watch.uuid) }}#proxies" > Try adding external proxies/locations< / a >
{% endif %}
2023-09-26 12:10:07 +00:00
{% if 'empty result or contain only an image' in watch.last_error %}
< a href = "https://github.com/dgtlmoon/changedetection.io/wiki/Detecting-changes-in-images" > more help here< / a > .
{% endif %}
2022-12-23 21:26:24 +00:00
< / div >
2021-01-28 17:38:47 +00:00
{% endif %}
2022-02-04 19:54:20 +00:00
{% if watch.last_notification_error is defined and watch.last_notification_error != False %}
2022-11-16 08:17:57 +00:00
< div class = "fetch-error notification-error" > < a href = "{{url_for('notification_logs')}}" > {{ watch.last_notification_error }}< / a > < / div >
2022-02-04 19:54:20 +00:00
{% endif %}
2023-03-18 19:36:26 +00:00
{% if watch['processor'] == 'text_json_diff' %}
{% if watch['has_ldjson_price_data'] and not watch['track_ldjson_price_data'] %}
2024-07-12 15:09:42 +00:00
< div class = "ldjson-price-track-offer" > Switch to Restock & Price watch mode? < a href = "{{url_for('price_data_follower.accept', uuid=watch.uuid)}}" class = "pure-button button-xsmall" > Yes< / a > < a href = "{{url_for('price_data_follower.reject', uuid=watch.uuid)}}" class = "" > No< / a > < / div >
2023-03-18 19:36:26 +00:00
{% endif %}
2022-12-08 16:47:22 +00:00
{% endif %}
2024-07-12 15:09:42 +00:00
{% if watch['processor'] == 'restock_diff' %}
< span class = "tracking-ldjson-price-data" title = "Automatically following embedded price information" > < img src = "{{url_for('static_content', group='images', filename='price-tag-icon.svg')}}" class = "status-icon price-follow-tag-icon" > Price< / span >
2022-12-08 16:47:22 +00:00
{% endif %}
2023-06-19 21:29:13 +00:00
{% for watch_tag_uuid, watch_tag in datastore.get_all_tags_for_watch(watch['uuid']).items() %}
< span class = "watch-tag-list" > {{ watch_tag.title }}< / span >
{% endfor %}
2024-07-12 15:09:42 +00:00
< / td >
<!-- @todo make it so any watch handler obj can expose this - -->
{% if any_has_restock_price_processor %}
< td class = "restock-and-price" >
{% if watch['processor'] == 'restock_diff' %}
{% if watch.has_restock_info %}
< span class = "restock-label {{'in-stock' if watch['restock']['in_stock'] else 'not-in-stock' }}" title = "Detecting restock and price" >
<!-- maybe some object watch['processor'][restock_diff] or.. -->
{% if watch['restock']['in_stock'] %} In stock {% else %} Not in stock {% endif %}
< / span >
{% endif %}
2023-06-19 21:29:13 +00:00
2024-07-12 15:09:42 +00:00
{% if watch.get('restock') and watch['restock']['price'] != None %}
{% if watch['restock']['price'] != None %}
< span class = "restock-label price" title = "Price" >
{{ watch['restock']['price']|format_number_locale }} {{ watch['restock']['currency'] }}
< / span >
{% endif %}
{% elif not watch.has_restock_info %}
< span class = "restock-label error" > No information< / span >
{% endif %}
{% endif %}
2021-01-28 17:38:47 +00:00
< / td >
2024-07-12 15:09:42 +00:00
{% endif %}
2023-10-17 12:03:19 +00:00
< td class = "last-checked" data-timestamp = "{{ watch.last_checked }}" > {{watch|format_last_checked_time|safe}}< / td >
< td class = "last-changed" data-timestamp = "{{ watch.last_changed }}" > {% if watch.history_n >=2 and watch.last_changed >0 %}
2021-02-21 19:14:35 +00:00
{{watch.last_changed|format_timestamp_timeago}}
2021-02-04 12:15:39 +00:00
{% else %}
2021-02-21 19:14:35 +00:00
Not yet
2021-02-04 12:15:39 +00:00
{% endif %}
< / td >
2021-02-21 19:14:35 +00:00
< td >
2022-05-20 14:27:51 +00:00
< a { % if watch . uuid in queued_uuids % } disabled = "true" { % endif % } href = "{{ url_for('form_watch_checknow', uuid=watch.uuid, tag=request.args.get('tag')) }}"
2022-12-04 15:09:09 +00:00
class="recheck pure-button pure-button-primary">{% if watch.uuid in queued_uuids %}Queued{% else %}Recheck{% endif %}< / a >
2024-12-04 17:25:26 +00:00
< a href = "{{ url_for('edit_page', uuid=watch.uuid, tag=active_tag_uuid)}}#general" class = "pure-button pure-button-primary" > Edit< / a >
2022-05-31 21:43:50 +00:00
{% if watch.history_n >= 2 %}
2023-11-17 16:21:26 +00:00
{% if is_unviewed %}
2024-10-05 15:24:29 +00:00
< a href = "{{ url_for('diff_history_page', uuid=watch.uuid, from_version=watch.get_next_snapshot_key_to_last_viewed) }}" target = "{{watch.uuid}}" class = "pure-button pure-button-primary diff-link" > History< / a >
2023-11-17 16:21:26 +00:00
{% else %}
2024-10-05 15:24:29 +00:00
< a href = "{{ url_for('diff_history_page', uuid=watch.uuid)}}" target = "{{watch.uuid}}" class = "pure-button pure-button-primary diff-link" > History< / a >
2023-11-17 16:21:26 +00:00
{% endif %}
2021-04-03 03:55:43 +00:00
{% else %}
2022-08-15 16:56:53 +00:00
{% if watch.history_n == 1 or (watch.history_n ==0 and watch.error_text_ctime )%}
2022-12-04 15:09:09 +00:00
< a href = "{{ url_for('preview_page', uuid=watch.uuid)}}" target = "{{watch.uuid}}" class = "pure-button pure-button-primary" > Preview< / a >
2021-04-03 03:55:43 +00:00
{% endif %}
2021-01-31 18:55:35 +00:00
{% endif %}
2021-01-28 17:38:47 +00:00
< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
2021-03-01 10:25:04 +00:00
< ul id = "post-list-buttons" >
2023-10-23 10:22:43 +00:00
{% if errored_count %}
< li >
< a href = "{{url_for('index', with_errors=1, tag=request.args.get('tag')) }}" class = "pure-button button-tag button-error " > With errors ({{ errored_count }})< / a >
< / li >
{% endif %}
2021-03-01 10:25:04 +00:00
{% if has_unviewed %}
< li >
2023-10-23 10:22:43 +00:00
< a href = "{{url_for('mark_all_viewed',with_errors=request.args.get('with_errors',0)) }}" class = "pure-button button-tag " > Mark all viewed< / a >
2021-03-01 10:25:04 +00:00
< / li >
{% endif %}
< li >
2024-02-21 09:03:09 +00:00
< a href = "{{ url_for('form_watch_checknow', tag=active_tag_uuid, with_errors=request.args.get('with_errors',0)) }}" class = "pure-button button-tag " > Recheck
all {% if active_tag_uuid %} in "{{active_tag.title}}"{%endif%}< / a >
2021-03-01 10:25:04 +00:00
< / li >
2021-03-01 10:51:28 +00:00
< li >
2024-05-20 13:49:12 +00:00
< a href = "{{ url_for('rss', tag=active_tag_uuid, token=app_rss_token)}}" > < img alt = "RSS Feed" id = "feed-icon" src = "{{url_for('static_content', group='images', filename='Generic_Feed-icon.svg')}}" height = "15" > < / a >
2021-03-01 10:51:28 +00:00
< / li >
2021-03-01 10:25:04 +00:00
< / ul >
2023-04-29 17:24:13 +00:00
{{ pagination.links }}
2021-01-28 17:38:47 +00:00
< / div >
2022-08-18 12:48:21 +00:00
< / form >
2021-01-27 11:39:46 +00:00
< / div >
2021-11-12 10:34:19 +00:00
{% endblock %}