Commit 07493f88 authored by Andreas Valder's avatar Andreas Valder
Browse files

added gui to only reschedule/delete one failed job; added option to insert a...

added gui to only reschedule/delete one failed job; added option to insert a copy of an existing job
parent d714fd78
......@@ -35,14 +35,17 @@ def jobs_overview():
return render_template('jobs_overview.html',worker=worker,jobs=jobs, filter_values=filter_values, filter=filter, page=page, pagesize=pagesize, pagecount=pagecount)
def jobs_action(action, jobid=None):
if action == 'clear_failed':
query('UPDATE jobs SET state="deleted" WHERE state = "failed" AND (id = ? OR ? IS NULL)',jobid, jobid)
if action == 'retry_failed':
query('UPDATE jobs SET state="ready" WHERE state = "failed" AND (id = ? OR ? IS NULL)', jobid, jobid)
if action == 'copy':
if jobid:
query("INSERT INTO jobs SELECT NULL, type, priority, 'ready', '', '' , ?, '', NULL, data, '{}' FROM jobs where ID=?;",, jobid)
return redirect(request.values.get('ref', url_for('jobs_overview')))
def jobs_api_token_required(func):
......@@ -112,6 +112,7 @@
<th>Gescheduled am</th>
{% for i in jobs %}
{% if i.last_ping %}
......@@ -140,6 +141,20 @@
{% if i.state == "failed" %}
<a class="btn btn-default" href="{{url_for('jobs_action', action='clear_failed',, ref=request.url)}}" title="Löschen" >
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
<a class="btn btn-default" href="{{url_for('jobs_action', action='retry_failed',, ref=request.url)}}" title="Neustarten">
<span class="fa fa-refresh" aria-hidden="true"></span>
{% else %}
<a class="btn btn-default" href="{{url_for('jobs_action', action='copy',, ref=request.url)}}" title="Kopie neu einreihen">
<span class="fa fa-refresh" aria-hidden="true"></span>
{% endif %}
{% endfor %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment