mirror of
				https://github.com/dgtlmoon/changedetection.io.git
				synced 2025-10-31 06:37:41 +00:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			update-pyp
			...
			test-notif
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 6f26241785 | ||
|   | 1ae59551be | ||
|   | a176468fb8 | ||
|   | 8fac593201 | ||
|   | e3b8c0f5af | ||
|   | 514fd7f91e | 
| @@ -2,7 +2,7 @@ Contributing is always welcome! | ||||
|  | ||||
| I am no professional flask developer, if you know a better way that something can be done, please let me know! | ||||
|  | ||||
| Otherwise, it's always best to PR into the `dev` branch. | ||||
| Otherwise, it's always best to PR into the `master` branch. | ||||
|  | ||||
| Please be sure that all new functionality has a matching test! | ||||
|  | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  | ||||
| # Read more https://github.com/dgtlmoon/changedetection.io/wiki | ||||
|  | ||||
| __version__ = '0.45.16' | ||||
| __version__ = '0.45.17' | ||||
|  | ||||
| from distutils.util import strtobool | ||||
| from json.decoder import JSONDecodeError | ||||
|   | ||||
| @@ -516,21 +516,35 @@ def changedetection_app(config=None, datastore_o=None): | ||||
|  | ||||
|         watch = datastore.data['watching'].get(watch_uuid) if watch_uuid else None | ||||
|  | ||||
|         # validate URLS | ||||
|         if not len(request.form['notification_urls'].strip()): | ||||
|         notification_urls = request.form['notification_urls'].strip().splitlines() | ||||
|  | ||||
|         if not notification_urls: | ||||
|             logger.debug("Test notification - Trying by group/tag") | ||||
|             if request.form['tags'].strip(): | ||||
|                 for k in request.form['tags'].split(','): | ||||
|                     tag = datastore.tag_exists_by_name(k.strip()) | ||||
|                     notification_urls = tag.get('notifications_urls') if tag and tag.get('notifications_urls') else None | ||||
|  | ||||
|         if not notification_urls: | ||||
|             logger.debug("Test notification - Trying by global system settings notifications") | ||||
|             if datastore.data['settings']['application'].get('notification_urls'): | ||||
|                 notification_urls = datastore.data['settings']['application']['notification_urls'] | ||||
|  | ||||
|  | ||||
|         if not notification_urls: | ||||
|             return make_response({'error': 'No Notification URLs set'}, 400) | ||||
|  | ||||
|         for server_url in request.form['notification_urls'].splitlines(): | ||||
|             if len(server_url.strip()): | ||||
|                 if not apobj.add(server_url): | ||||
|                     message = '{} is not a valid AppRise URL.'.format(server_url) | ||||
|         for n_url in notification_urls: | ||||
|             if len(n_url.strip()): | ||||
|                 if not apobj.add(n_url): | ||||
|                     message = '{} is not a valid AppRise URL.'.format(n_url) | ||||
|                     return make_response({'error': message}, 400) | ||||
|  | ||||
|         try: | ||||
|             # use the same as when it is triggered, but then override it with the form test values | ||||
|             n_object = { | ||||
|                 'watch_url': request.form['window_url'], | ||||
|                 'notification_urls': request.form['notification_urls'].splitlines() | ||||
|                 'notification_urls': notification_urls | ||||
|             } | ||||
|  | ||||
|             # Only use if present, if not set in n_object it should use the default system value | ||||
|   | ||||
| @@ -28,15 +28,11 @@ $(document).ready(function() { | ||||
|       notification_format: $('#notification_format').val(), | ||||
|       notification_title: $('#notification_title').val(), | ||||
|       notification_urls: $('.notification-urls').val(), | ||||
|       tags: $('#tags').val(), | ||||
|       window_url: window.location.href, | ||||
|     } | ||||
|  | ||||
|  | ||||
|     if (!data['notification_urls'].length) { | ||||
|       alert("Notification URL list is empty, cannot send test.") | ||||
|       return; | ||||
|     } | ||||
|  | ||||
|     $.ajax({ | ||||
|       type: "POST", | ||||
|       url: notification_base_url, | ||||
|   | ||||
| @@ -657,7 +657,10 @@ class ChangeDetectionStore: | ||||
|         return res | ||||
|  | ||||
|     def tag_exists_by_name(self, tag_name): | ||||
|         return any(v.get('title', '').lower() == tag_name.lower() for k, v in self.__data['settings']['application']['tags'].items()) | ||||
|         # Check if any tag dictionary has a 'title' attribute matching the provided tag_name | ||||
|         tags = self.__data['settings']['application']['tags'].values() | ||||
|         return next((v for v in tags if v.get('title', '').lower() == tag_name.lower()), | ||||
|                     None) | ||||
|  | ||||
|     def get_updates_available(self): | ||||
|         import inspect | ||||
|   | ||||
| @@ -323,6 +323,7 @@ nav | ||||
|                     <span class="pure-form-message-inline"> | ||||
|                         <ul> | ||||
|                           <li> Remove HTML element(s) by CSS selector before text conversion. </li> | ||||
|                           <li> Don't paste HTML here, use only CSS selectors </li> | ||||
|                           <li> Add multiple elements or CSS selectors per line to ignore multiple parts of the HTML. </li> | ||||
|                         </ul> | ||||
|                       </span> | ||||
| @@ -436,7 +437,7 @@ Unavailable") }} | ||||
|                     <div class="pure-control-group"> | ||||
|                         {% if visualselector_enabled %} | ||||
|                             <span class="pure-form-message-inline"> | ||||
|                                 The Visual Selector tool lets you select the <i>text</i> elements that will be used for the change detection ‐ after the <i>Browser Steps</i> has completed.<br><br> | ||||
|                                 The Visual Selector tool lets you select the <i>text</i> elements that will be used for the change detection ‐ after the <i>Browser Steps</i> has completed, this tool is a helper to manage filters in the  "CSS/JSONPath/JQ/XPath Filters" box of the <a href="#filters-and-triggers">Filters & Triggers</a> tab. | ||||
|                             </span> | ||||
|  | ||||
|                             <div id="selector-header"> | ||||
|   | ||||
| @@ -75,7 +75,7 @@ pillow | ||||
| # playwright is installed at Dockerfile build time because it's not available on all platforms | ||||
|  | ||||
| # experimental release | ||||
| pyppeteer-ng==2.0.0rc2 | ||||
| pyppeteer-ng==2.0.0rc5 | ||||
|  | ||||
| # Include pytest, so if theres a support issue we can ask them to run these tests on their setup | ||||
| pytest ~=7.2 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user