changed UI to have checkboxes instead of dropdown

This commit is contained in:
bwees
2022-07-28 20:36:53 -04:00
parent 1e265b312e
commit 6f2b7ceddb
4 changed files with 15 additions and 11 deletions
+6 -5
View File
@@ -277,18 +277,19 @@ class perform_site_check():
else:
logging.debug("check_unique_lines: UUID {} had unique content".format(uuid))
print(watch.get("trigger_add"), watch.get("trigger_del"))
if changed_detected:
if watch.get("trigger_type", "all") != "all": # if we are supposed to filter any diff types
if not watch.get("trigger_add", True) or not watch.get("trigger_del", True): # if we are supposed to filter any diff types
# get the diff types present in the watch
diff_types = watch.get_diff_types(text_content_before_ignored_filter)
print("Diff components found: " + str(diff_types))
# Only Additions
if watch["trigger_type"] == "add" and not diff_types["add"] and diff_types["del"]:
# Only Additions (deletions are turned off)
if not watch["trigger_del"] and diff_types["del"] and not diff_types["add"]:
changed_detected = False
# Only Deletions
elif watch["trigger_type"] == "delete" and not diff_types["del"] and diff_types["add"]:
# Only Deletions (additions are turned off)
elif not watch["trigger_add"] and not diff_types["add"] and diff_types["del"]:
changed_detected = False
# Always record the new checksum and the new text
+2 -1
View File
@@ -343,7 +343,8 @@ class watchForm(commonSettingsForm):
check_unique_lines = BooleanField('Only trigger when new lines appear', default=False)
trigger_text = StringListField('Trigger/wait for text', [validators.Optional(), ValidateListRegex()])
text_should_not_be_present = StringListField('Block change-detection if text matches', [validators.Optional(), ValidateListRegex()])
trigger_type = SelectField(u'Trigger On', choices=[("all", "Any Changes"), ("add", "Only Additions"), ("delete", "Only Deletions")], coerce=str, default="add")
trigger_add = BooleanField('Additions', default=True)
trigger_del = BooleanField('Deletions', default=True)
webdriver_js_execute_code = TextAreaField('Execute JavaScript before change detection', render_kw={"rows": "5"}, validators=[validators.Optional()])
+2 -1
View File
@@ -42,7 +42,8 @@ class model(dict):
'fetch_backend': None,
'extract_title_as_title': False,
'check_unique_lines': False, # On change-detected, compare against all history if its something new
'trigger_type': "all",
'trigger_add': True,
'trigger_del': True,
'proxy': None, # Preferred proxy connection
# Re #110, so then if this is set to None, we know to use the default value instead
# Requires setting to None on submit if it's the same as the default
+5 -4
View File
@@ -157,11 +157,12 @@ User-Agent: wonderbra 1.0") }}
</div>
</fieldset>
<fieldset>
<div class="pure-control-group" id="request-method">
{{ render_field(form.trigger_type) }}
<div class="pure-control-group">
<label for="trigger-type">Limit filters and triggers to</label>
{{ render_checkbox_field(form.trigger_add, class="trigger-type") }}
{{ render_checkbox_field(form.trigger_del, class="trigger-type") }}
<span class="pure-form-message-inline">
This filter only compares to the previous snapshot. This is different from the "Only trigger when new lines appear" setting which checks all previous snapshots.</br>
This is good for filtering out notifications that only are showing deleted content. (i.e A notice being removed from a website)</br>
Limits the change-detection of this watch to only this content
</span>
</div>
</fieldset>