before v0.39.6

pull/317/head
ntmmfts 3 years ago
parent a7763ae9a3
commit 51acfbdbda

@ -456,7 +456,8 @@ def changedetection_app(config=None, datastore_o=None):
update_obj = {'url': form.url.data.strip(), update_obj = {'url': form.url.data.strip(),
'minutes_between_check': form.minutes_between_check.data, 'minutes_between_check': form.minutes_between_check.data,
'use_seconds': form.use_seconds.data, 'seconds_between_check': form.seconds_between_check.data,
'minutes_or_seconds': form.minutes_or_seconds.data,
'tag': form.tag.data.strip(), 'tag': form.tag.data.strip(),
'title': form.title.data.strip(), 'title': form.title.data.strip(),
'headers': form.headers.data, 'headers': form.headers.data,
@ -974,7 +975,7 @@ def ticker_thread_check_time_launch_checks():
# If they supplied an individual entry minutes to threshold. # If they supplied an individual entry minutes to threshold.
if 'minutes_between_check' in watch and watch['minutes_between_check'] is not None: if 'minutes_between_check' in watch and watch['minutes_between_check'] is not None:
# Cast to int just incase #160, kluge for checks in seconds # Cast to int just incase #160, kluge for checks in seconds
max_time = int(watch['minutes_between_check']) * (1 if watch['use_seconds'] else 60) max_time = int(watch['minutes_between_check']) * 60 #(1 if watch['use_seconds'] else 60)
else: else:
# Default system wide. # Default system wide.
max_time = int(copied_datastore.data['settings']['requests']['minutes_between_check']) * 60 max_time = int(copied_datastore.data['settings']['requests']['minutes_between_check']) * 60

@ -229,7 +229,9 @@ class watchForm(commonSettingsForm):
minutes_between_check = html5.IntegerField('Maximum time in minutes until recheck', minutes_between_check = html5.IntegerField('Maximum time in minutes until recheck',
[validators.Optional(), validators.NumberRange(min=1)]) [validators.Optional(), validators.NumberRange(min=1)])
use_seconds = BooleanField('Use seconds') seconds_between_check = html5.IntegerField('Maximum time in seconds until recheck',
[validators.Optional(), validators.NumberRange(min=1,max=59)])
minutes_or_seconds = RadioField('Minutes or Seconds', choices=[('minutes','Minutes'),('seconds','Seconds')])
css_filter = StringField('CSS/JSON Filter', [ValidateCSSJSONInput()]) css_filter = StringField('CSS/JSON Filter', [ValidateCSSJSONInput()])
title = StringField('Title') title = StringField('Title')

@ -50,37 +50,37 @@ function focus_error_tab() {
} }
function use_seconds_change() { function use_seconds_change() {
var isChecked = document.querySelectorAll('input[id="use_seconds"]:checked').length // var isChecked = document.querySelectorAll('input[id="use_seconds"]:checked').length
var labelIntegerField = document.querySelector("label[for=minutes_between_check]"); // var labelIntegerField = document.querySelector("label[for=minutes_between_check]");
var msgDefault = document.getElementById("minutes-message-default"); // var msgDefault = document.getElementById("minutes-message-default");
var msgNonDefault = document.getElementById("minutes-message-non-default"); // var msgNonDefault = document.getElementById("minutes-message-non-default");
var msgWarning = document.getElementById("seconds-warning"); // var msgWarning = document.getElementById("seconds-warning");
if (isChecked) { // if (isChecked) {
labelIntegerField.innerHTML = "Maximum time in seconds until recheck"; // labelIntegerField.innerHTML = "Maximum time in seconds until recheck";
try { // try {
msgDefault.style.display = "none"; // msgDefault.style.display = "none";
} catch(error) { // } catch(error) {
// continue, won't be present if not default interval //continue, won't be present if not default interval
} // }
try { // try {
msgNonDefault.style.display = "none"; // msgNonDefault.style.display = "none";
} catch(error) { // } catch(error) {
// continue, won't be present if not default interval //continue, won't be present if not default interval
} // }
msgWarning.style.display = ""; // msgWarning.style.display = "";
} // }
else { // else {
labelIntegerField.innerHTML = "Maximum time in minutes until recheck"; // labelIntegerField.innerHTML = "Maximum time in minutes until recheck";
try { // try {
msgDefault.style.display = ""; // msgDefault.style.display = "";
} catch(error) { // } catch(error) {
// continue, won't be present if not default interval //continue, won't be present if not default interval
} // }
try { // try {
msgNonDefault.style.display = ""; // msgNonDefault.style.display = "";
} catch(error) { // } catch(error) {
// continue, won't be present if not default interval //continue, won't be present if not default interval
} // }
msgWarning.style.display = "none"; // msgWarning.style.display = "none";
} // }
} }

@ -68,7 +68,8 @@ class ChangeDetectionStore:
# Requires setting to None on submit if it's the same as the default # Requires setting to None on submit if it's the same as the default
'minutes_between_check': None, 'minutes_between_check': None,
# #160 # #160
'use_seconds': False, 'seconds_between_check': None,
'minutes_or_seconds': 'minutes',
'previous_md5': "", 'previous_md5': "",
'uuid': str(uuid_builder.uuid4()), 'uuid': str(uuid_builder.uuid4()),
'headers': {}, # Extra headers to send 'headers': {}, # Extra headers to send

@ -32,7 +32,10 @@
<span class="pure-form-message-inline">Organisational tag/group name used in the main listing page</span> <span class="pure-form-message-inline">Organisational tag/group name used in the main listing page</span>
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.minutes_between_check) }} <span id="duration">
{{ render_field(form.minutes_between_check) }}
{{ render_field(form.minutes_or_seconds, onchange="minutes_or_seconds_change()") }}
</span>
{% if using_default_minutes %} {% if using_default_minutes %}
<span id="minutes-message-default" class="pure-form-message-inline">Currently using the <a <span id="minutes-message-default" class="pure-form-message-inline">Currently using the <a
href="{{ url_for('settings_page', uuid=uuid) }}">default global settings</a>, change to another value if you want to be specific.</span> href="{{ url_for('settings_page', uuid=uuid) }}">default global settings</a>, change to another value if you want to be specific.</span>
@ -42,10 +45,10 @@
{% endif %} {% endif %}
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.use_seconds, onchange="use_seconds_change()") }}
<span id="seconds-warning" class="pure-form-message-inline" style="display:{{'' if watch.use_seconds == True else 'none'}};">Warning: Setting the recheck duration too short can overload the queue and lead to <!-- <span id="seconds-warning" class="pure-form-message-inline" style="display:{{'' if watch.use_seconds == True else 'none'}};">Warning: Setting the recheck duration too short can overload the queue and lead to
unstable performance and application crashes. Test and adjust the duration to ensure unstable performance and application crashes. Test and adjust the duration to ensure
it allows sufficent time to check the target website before queing the watch again.</span> it allows sufficent time to check the target website before queing the watch again.</span> -->
</div> </div>
</fieldset> </fieldset>
</div> </div>

Loading…
Cancel
Save