Scrub single watch

This commit is contained in:
dgtlmoon
2022-06-07 21:51:34 +02:00
parent 1ab70f8e86
commit 541796cd5c
2 changed files with 15 additions and 0 deletions
+13
View File
@@ -458,6 +458,19 @@ def changedetection_app(config=None, datastore_o=None):
return 'OK'
@app.route("/scrub/<string:uuid>", methods=['GET'])
@login_required
def scrub_watch(uuid):
try:
datastore.scrub_watch(uuid)
except KeyError:
flash('Watch not found', 'error')
else:
flash("Cleared snapshot history for watch {}".format(uuid))
#@todo gives 'Not enough saved change detection snapshots to produce a report.' after scrub.. interesting
return redirect(url_for('index'))
@app.route("/scrub", methods=['GET', 'POST'])
@login_required
def scrub_page():
+2
View File
@@ -259,6 +259,8 @@ nav
<a href="{{url_for('form_delete', uuid=uuid)}}"
class="pure-button button-small button-error ">Delete</a>
<a href="{{url_for('scrub_watch', uuid=uuid)}}"
class="pure-button button-small button-error ">Scrub</a>
<a href="{{url_for('form_clone', uuid=uuid)}}"
class="pure-button button-small ">Create Copy</a>
</div>