diff --git a/lib/job_server.py b/lib/job_server.py index 14ef528..33ce585 100755 --- a/lib/job_server.py +++ b/lib/job_server.py @@ -55,12 +55,13 @@ def job_detail(job_id): found_job = RenderQueue.job_with_id(job_id) if found_job: table_html = json2html.json2html.convert(json=found_job.json(), - table_attributes='class="table is-narrow is-striped"') + table_attributes='class="table is-narrow is-striped is-fullwidth"') media_url = None - if found_job.file_list(): + if found_job.file_list() and found_job.render_status() == RenderStatus.COMPLETED: media_basename = os.path.basename(found_job.file_list()[0]) media_url = f"/api/job/{job_id}/file/{media_basename}" - return render_template('details.html', detail_table=table_html, media_url=media_url) + return render_template('details.html', detail_table=table_html, media_url=media_url, + job_status=found_job.render_status().value.title(), job=found_job) return f'Cannot find job with ID {job_id}', 400 @@ -74,7 +75,7 @@ def job_thumbnail(job_id): thumb_image_path = os.path.join(server.config['THUMBS_FOLDER'], found_job.id + '.jpg') if not os.path.exists(thumb_video_path) and not os.path.exists(thumb_video_path + '_IN-PROGRESS'): - generate_thumbnail_for_job(found_job, thumb_video_path, thumb_image_path, max_width=120) + generate_thumbnail_for_job(found_job, thumb_video_path, thumb_image_path, max_width=240) if os.path.exists(thumb_video_path) and not os.path.exists(thumb_video_path + '_IN-PROGRESS'): return send_file(thumb_video_path, mimetype="video/mp4") diff --git a/lib/server_helper.py b/lib/server_helper.py index 21d4856..5aa501b 100644 --- a/lib/server_helper.py +++ b/lib/server_helper.py @@ -4,7 +4,7 @@ import os import json import threading from utilities.render_worker import RenderStatus -from utilities.ffmpeg_presets import generate_fast_preview, save_first_frame +from utilities.ffmpeg_presets import generate_thumbnail, save_first_frame def post_job_to_server(input_path, job_list, client, server_port=8080): @@ -22,7 +22,7 @@ def generate_thumbnail_for_job(job, thumb_video_path, thumb_image_path, max_widt def generate_thumb_thread(source): in_progress_path = thumb_video_path + '_IN-PROGRESS' subprocess.run(['touch', in_progress_path]) - generate_fast_preview(source_path=source, dest_path=thumb_video_path, max_width=max_width) + generate_thumbnail(source_path=source, dest_path=thumb_video_path, max_width=max_width) os.remove(in_progress_path) # Determine best source file to use for thumbs diff --git a/lib/static/cancelled.png b/lib/static/cancelled.png new file mode 100644 index 0000000..5f3b6a1 Binary files /dev/null and b/lib/static/cancelled.png differ diff --git a/lib/static/error.png b/lib/static/error.png new file mode 100644 index 0000000..1461b9f Binary files /dev/null and b/lib/static/error.png differ diff --git a/lib/static/gears.png b/lib/static/gears.png new file mode 100644 index 0000000..da1f1ed Binary files /dev/null and b/lib/static/gears.png differ diff --git a/lib/static/not_started.png b/lib/static/not_started.png new file mode 100644 index 0000000..56462eb Binary files /dev/null and b/lib/static/not_started.png differ diff --git a/lib/static/scheduled.png b/lib/static/scheduled.png new file mode 100644 index 0000000..b5a91d9 Binary files /dev/null and b/lib/static/scheduled.png differ diff --git a/lib/static/spinner.gif b/lib/static/spinner.gif index 183fe6f..0fa0d3b 100644 Binary files a/lib/static/spinner.gif and b/lib/static/spinner.gif differ diff --git a/templates/details.html b/templates/details.html index a1c8bce..203e413 100644 --- a/templates/details.html +++ b/templates/details.html @@ -24,8 +24,28 @@ -
-{{detail_table|safe}} +
+ {% if media_url: %} + + {% elif job_status == 'Running': %} +
+ + + Rendering - {{ '{0:0.0f}'.format(job.percent_complete() * 100) }}% + +
+ {% else %} +
+ + + {{job_status}} + +
+ {% endif %} + {{detail_table|safe}}
diff --git a/templates/index.html b/templates/index.html index ecc3dc0..a224d3c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -61,8 +61,12 @@ {% for job in all_jobs %} - - {{job.name}} + + + + + + {{job.name}} {{job.renderer}}-{{job.worker.renderer_version}} {{job.priority}} {{job.render_status().value}} @@ -70,7 +74,7 @@ {{ '{0:0.0f}'.format(job.percent_complete() * 100) }}% {{job.frame_count()}} {{job.client}} - {{job.worker.last_output}} + {{job.worker.last_output}}