mirror of
https://github.com/simon987/od-database.git
synced 2025-04-18 01:46:46 +00:00
Added rescan button
This commit is contained in:
parent
073551df3c
commit
80aa8933e6
21
app.py
21
app.py
@ -162,6 +162,27 @@ def admin_delete_website(website_id):
|
||||
abort(403)
|
||||
|
||||
|
||||
@app.route("/website/<int:website_id>/rescan")
|
||||
def admin_rescan_website(website_id):
|
||||
|
||||
if "username" in session:
|
||||
|
||||
website = db.get_website_by_id(website_id)
|
||||
|
||||
if website:
|
||||
priority = request.args.get("priority") if "priority" in request.args else 1
|
||||
task = Task(website_id, website.url, priority)
|
||||
taskDispatcher.dispatch_task(task)
|
||||
|
||||
flash("Enqueued rescan task", "success")
|
||||
else:
|
||||
flash("Website does not exist", "danger")
|
||||
return redirect("/website/" + str(website_id))
|
||||
|
||||
else:
|
||||
abort(403)
|
||||
|
||||
|
||||
@app.route("/search")
|
||||
def search():
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
{% if "username" in session %}
|
||||
<a href="/website/{{ website.id }}/clear" class="btn btn-danger"><i class="fas fa-exclamation"></i> Clear</a>
|
||||
<a href="/website/{{ website.id }}/delete" class="btn btn-danger"><i class="fas fa-trash"></i> Delete</a>
|
||||
<a href="/website/{{ website.id }}/rescan" class="btn btn-secondary"><i class="fas fa-redo"></i> rescan</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user