merging v0.39.6

This commit is contained in:
ntmmfts
2022-01-08 01:29:05 -10:00
6 changed files with 61 additions and 871 deletions
+3 -1
View File
@@ -455,6 +455,8 @@ def changedetection_app(config=None, datastore_o=None):
update_obj = {'url': form.url.data.strip(),
'minutes_between_check': form.minutes_between_check.data,
'seconds_between_check': form.seconds_between_check.data,
'minutes_or_seconds': form.minutes_or_seconds.data,
'tag': form.tag.data.strip(),
'title': form.title.data.strip(),
'headers': form.headers.data,
@@ -1107,7 +1109,7 @@ def ticker_thread_check_time_launch_checks():
# If they supplied an individual entry minutes to threshold.
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
max_time = int(watch['minutes_between_check']) * 60
max_time = int(watch['minutes_between_check']) * 60 #(1 if watch['use_seconds'] else 60)
else:
# Default system wide.
max_time = int(copied_datastore.data['settings']['requests']['minutes_between_check']) * 60
+3
View File
@@ -249,6 +249,9 @@ class watchForm(commonSettingsForm):
minutes_between_check = html5.IntegerField('Maximum time in minutes until recheck',
[validators.Optional(), validators.NumberRange(min=1)])
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/XPATH Filter', [ValidateCSSJSONXPATHInput()])
title = StringField('Title')
+41 -6
View File
@@ -1,10 +1,13 @@
// Rewrite this is a plugin.. is all this JS really 'worth it?'
// display correct label and messages for minutes or seconds
document.addEventListener("DOMContentLoaded", function(event) {
use_seconds_change();
});
window.addEventListener('hashchange', function() {
var tabs = document.getElementsByClassName('active');
while (tabs[0]) {
tabs[0].classList.remove('active')
tabs[0].classList.remove('active');
}
set_active_tab();
}, false);
@@ -37,7 +40,7 @@ function focus_error_tab() {
var tabs = document.querySelectorAll('.tabs li a'),i;
for (i = 0; i < tabs.length; ++i) {
var tab_name=tabs[i].hash.replace('#','');
var pane_errors=document.querySelectorAll('#'+tab_name+' .error')
var pane_errors=document.querySelectorAll('#'+tab_name+' .error');
if (pane_errors.length) {
document.location.hash = '#'+tab_name;
return true;
@@ -46,6 +49,38 @@ function focus_error_tab() {
return false;
}
function use_seconds_change() {
// var isChecked = document.querySelectorAll('input[id="use_seconds"]:checked').length
// var labelIntegerField = document.querySelector("label[for=minutes_between_check]");
// var msgDefault = document.getElementById("minutes-message-default");
// var msgNonDefault = document.getElementById("minutes-message-non-default");
// var msgWarning = document.getElementById("seconds-warning");
// if (isChecked) {
// labelIntegerField.innerHTML = "Maximum time in seconds until recheck";
// try {
// msgDefault.style.display = "none";
// } catch(error) {
//continue, won't be present if not default interval
// }
// try {
// msgNonDefault.style.display = "none";
// } catch(error) {
//continue, won't be present if not default interval
// }
// msgWarning.style.display = "";
// }
// else {
// labelIntegerField.innerHTML = "Maximum time in minutes until recheck";
// try {
// msgDefault.style.display = "";
// } catch(error) {
//continue, won't be present if not default interval
// }
// try {
// msgNonDefault.style.display = "";
// } catch(error) {
//continue, won't be present if not default interval
// }
// msgWarning.style.display = "none";
// }
}
File diff suppressed because one or more lines are too long
+3
View File
@@ -69,6 +69,9 @@ class ChangeDetectionStore:
# 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
'minutes_between_check': None,
# #160
'seconds_between_check': None,
'minutes_or_seconds': 'minutes',
'previous_md5': "",
'uuid': str(uuid_builder.uuid4()),
'headers': {}, # Extra headers to send
+10 -4
View File
@@ -32,17 +32,23 @@
<span class="pure-form-message-inline">Organisational tag/group name used in the main listing page</span>
</div>
<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 %}
<span 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>
{% else %}
<span class="pure-form-message-inline">Set to blank to use the <a
<span id="minutes-message-non-default" class="pure-form-message-inline">Set to blank to use the <a
href="{{ url_for('settings_page', uuid=uuid) }}">default global settings</a>.</span>
{% endif %}
</div>
<div class="pure-control-group">
{{ render_field(form.extract_title_as_title) }}
<!-- <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
it allows sufficent time to check the target website before queing the watch again.</span> -->
</div>
</fieldset>
</div>