Select Git revision
Forked from
Video AG Infrastruktur / website
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
jobs_overview.html 6.83 KiB
{% extends "base.html" %}
{% block modals %}
{{ super() }}
<div class="modal fade" id="modal_addjob" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
Neue(n) Job(s) erzeugen
</div>
<div class="modal-body">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#add_thtumbnail" aria-controls="thumbnail" role="tab" data-toggle="tab">Thumbnaile</a></li>
</ul>
<div class="tab-content" style="margin-top: 10px;">
<div role="tabpanel" class="tab-pane active" id="add_thumbnail">
<form class="form-inline" action="{{url_for('jobs_action', action='add', ref=request.url)}}" method="post">
<div class="form-group">
<input type="hidden" name="type" value="thumbnail">
<input type="text" class="form-control" id="thumbnail_lectureid" placeholder="Lecture ID" name="lecture_id">
<button type="submit" class="btn btn-primary">Hinzufügen</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
{% endblock %}
{% block content %}
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">
Worker
</h1>
</div>
<div class="panel-collapse collapse in">
<div class="panel-body">
<table class="table">
<tr>
<th>Hostname</th>
<th>letzter Ping</th>
</tr>
{% for i in worker %}
{% set td = (datetime.now()-(i.last_ping) ) %}
{% if td < timedelta(seconds=10) %}
<tr class="success">
{% elif td < timedelta(seconds=30) %}
<tr class="warning">
{% else %}
<tr class="danger">
{% endif %}
<td>{{i.hostname}}</td>
<td>{{i.last_ping}}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">
Jobs
<a class="btn btn-default" href="javascript:$('#modal_addjob').modal()" >Job(s) erzeugen</a>
<a class="btn btn-default" href="{{url_for('jobs_action', action='clear_failed', ref=request.url)}}" >Alle fehlgeschlagenen Jobs löschen</a>
<a class="btn btn-default" href="{{url_for('jobs_action', action='retry_failed', ref=request.url)}}" >Alle fehlgeschlagenen Jobs neustarten</a>
</h1>
</div>
<div class="panel-collapse collapse in">
<div class="panel-body">
<div class="row">
<form>
<div class="form-group col-xs-12 col-lg-4">
<label for="type">Type</label>
<input list="job_type" name="type" value="{{ filter.type }}">
<datalist id="job_type">
{% for o in filter_values.type %}
<option value="{{ o.type }}">
{% endfor %}
</datalist>
</div>
<div class="form-group col-xs-12 col-lg-4">
<label for="worker">Worker</label>
<input list="job_worker" name="worker" value="{{ filter.worker }}">
<datalist id="job_worker">
{% for o in filter_values.worker %}
<option value="{{ o.worker }}">
{% endfor %}
</datalist>
</div>
<div class="form-group col-xs-12 col-lg-4">
<label for="state">State</label>
<input list="job_state" name="state" value="{{ filter.state }}">
<datalist id="job_state">
{% for o in filter_values.state %}
<option value="{{ o.state }}">
{% endfor %}
</datalist>
</div>
<div class="col-xs-12">
<button type="submit" class="btn btn-primary">Filter</button>
<ul class="pagination pull-right">
<li class="page-item">
<a class="page-link" href="{{url_for('jobs_overview', page=page-1, **(request.args|filterdict(['page','pagesize']))) }}">
<span aria-hidden="true">«</span>
<span class="sr-only">Previous</span>
</a>
</li>
{% for i in range(max(0, page - 5) ,min(pagecount, page + 5)) %}
{% if i == page %}
<li class="page-item active"><a class="page-link" href="{{url_for('jobs_overview', page=i, **(request.args|filterdict(['page','pagesize']))) }}">{{ i }}</a></li>
{% else %}
<li class="page-item"><a class="page-link" href="{{url_for('jobs_overview', page=i, **(request.args|filterdict(['page','pagesize']))) }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
<li class="page-item">
<a class="page-link" href="{{url_for('jobs_overview', page=page+1, **(request.args|filterdict(['page','pagesize']))) }}">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li>
</ul>
</div>
</form>
</div>
<div class="table-responsive">
<table class="table">
<tr>
<th>ID</th>
<th>Type</th>
<th>Priority</th>
<th>Worker</th>
<th>letzter Ping</th>
<th>State</th>
<th>Eingereiht am</th>
<th>Fertig geworden am</th>
<th>Gescheduled am</th>
<th>Daten</th>
<th>Status</th>
<th></th>
</tr>
{% for i in jobs %}
{% if i.last_ping %}
{% set td = (datetime.now()-(i.last_ping) ) %}
{% else %}
{% set td = -1 %}
{% endif %}
{% if (td == -1) or (i.state != "running") %}
<tr>
{% elif td < timedelta(seconds=20) %}
<tr class="success">
{% elif td < timedelta(seconds=60) %}
<tr class="warning">
{% else %}
<tr class="danger">
{% endif %}
<td>{{i.id}}</td>
<td>{{i.type}}</td>
<td>{{i.priority}}</td>
<td>{{i.worker}}</td>
<td>{{i.last_ping}}</td>
<td>{{i.state}}</td>
<td>{{i.time_created}}</td>
<td>{{i.time_finished}}</td>
<td>{{i.time_scheduled}}</td>
<td>{{i.data}}</td>
<td>{{i.status}}</td>
<td>
{% if i.state == "failed" %}
<a class="btn btn-default" href="{{url_for('jobs_action', action='clear_failed', jobid=i.id, ref=request.url)}}" title="Löschen" style="background-color: red;">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
</a>
<a class="btn btn-default" href="{{url_for('jobs_action', action='retry_failed', jobid=i.id, ref=request.url)}}" title="Neustarten">
<span class="fa fa-refresh" aria-hidden="true"></span>
</a>
{% else %}
<a class="btn btn-default" href="{{url_for('jobs_action', action='copy', jobid=i.id, ref=request.url)}}" title="Kopie neu einreihen">
<span class="fa fa-refresh" aria-hidden="true"></span>
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}