Commit e3c44ddc authored by Julian Rother's avatar Julian Rother

Added more useful interface to add stream forwardings

parent 93cd121b
......@@ -32,7 +32,13 @@ def jobs_overview():
pagecount = math.ceil(query('SELECT count(id) as count FROM jobs WHERE (type like ?) AND (worker like ? OR (worker IS NULL AND ? = "%")) AND (state like ?)', filter['type'], filter['worker'], filter['worker'], filter['state'])[0]['count']/pagesize)
jobs = query('SELECT * FROM jobs WHERE (type like ?) AND (worker like ? OR (worker IS NULL AND ? = "%")) AND (state like ?) ORDER BY `time_created` DESC LIMIT ? OFFSET ?', filter['type'], filter['worker'], filter['worker'], filter['state'], pagesize, page*pagesize)
return render_template('jobs_overview.html',worker=worker,jobs=jobs, filter_values=filter_values, filter=filter, page=page, pagesize=pagesize, pagecount=pagecount)
active_streams = query('SELECT lectures.*, "course" AS sep, courses.*, "job" AS sep, jobs.* FROM lectures JOIN courses ON (courses.id = lectures.course_id) JOIN jobs ON (jobs.id = lectures.stream_job) WHERE lectures.stream_job')
for stream in active_streams:
try:
stream['destbase'] = json.loads((stream['job']['data'] or '{}')).get('destbase')
except:
pass
return render_template('jobs_overview.html',worker=worker,jobs=jobs, filter_values=filter_values, filter=filter, page=page, pagesize=pagesize, pagecount=pagecount, active_streams=active_streams)
@app.route('/internal/jobs/action/<action>', methods=['GET', 'POST'])
@app.route('/internal/jobs/action/<action>/<jobid>', methods=['GET', 'POST'])
......
......@@ -16,7 +16,8 @@
<li role="presentation" class="active"><a href="#add_thumbnail" role="tab" data-toggle="tab">Thumbnail</a></li>
<li role="presentation"><a href="#add_remux" role="tab" data-toggle="tab">Remux</a></li>
<li role="presentation"><a href="#add_reencode" role="tab" data-toggle="tab">Reencode</a></li>
<li role="presentation"><a href="#add_forward" role="tab" data-toggle="tab">Stream-Weiterleitung</a></li>
<li role="presentation"><a href="#add_stream_forward" role="tab" data-toggle="tab">Stream-Weiterleitung</a></li>
<li role="presentation"><a href="#add_forward" role="tab" data-toggle="tab">RTMP-Weiterleitung</a></li>
</ul>
<div class="tab-content" style="margin-top: 10px;">
<div role="tabpanel" class="tab-pane active" id="add_thumbnail">
......@@ -58,6 +59,22 @@
</div>
</form>
</div>
<div role="tabpanel" class="tab-pane" id="add_stream_forward">
<form class="form-inline" action="{{url_for('add_forward_job', ref=request.url)}}" method="post">
<div class="form-group">
<select name="src" class="form-control">
{% for lecture in active_streams %}
<option value="{{ lecture.destbase }}_low">{{ lecture.course.short }}: {{ lecture.title }} (360p)</option>
<option value="{{ lecture.destbase }}_mid">{{ lecture.course.short }}: {{ lecture.title }} (720p)</option>
<option value="{{ lecture.destbase }}_high">{{ lecture.course.short }}: {{ lecture.title }} (1080p)</option>
{% endfor %}
</select>
<input type="text" class="form-control" placeholder="Ziel" name="dest">
<button type="submit" class="btn btn-primary">Livestream weiterleiten</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
......
Markdown is supported
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