diff --git a/camlaps/templates/camlaps/job_list.html b/camlaps/templates/camlaps/job_list.html index 309e228..def7e34 100644 --- a/camlaps/templates/camlaps/job_list.html +++ b/camlaps/templates/camlaps/job_list.html @@ -1,6 +1,9 @@ {% extends 'base.html' %} {% block content %} +{% if has_active_jobs %} + +{% endif %}

Очередь задач

@@ -56,12 +59,19 @@ {{ job.get_sampling_preset_display }} {{ job.fps }} {{ job.get_status_display }} - - {% if job.status == 'success' %} - 100% - {% else %} - {{ job.progress_percent }}% - {% endif %} + +
+
+ {% if job.status == 'success' %} + 100% + {% else %} + {{ job.progress_percent }}% + {% endif %} +
+
{% if job.status == 'error' and job.error_message %} diff --git a/camlaps/views.py b/camlaps/views.py index 1f25393..765e452 100644 --- a/camlaps/views.py +++ b/camlaps/views.py @@ -64,6 +64,7 @@ def job_list(request): if camera_id: qs = qs.filter(camera_id=camera_id) jobs = qs.order_by('-created_at')[:200] + has_active_jobs = qs.filter(status__in=[TimelapseJob.Status.PLANNED, TimelapseJob.Status.RUNNING]).exists() return render( request, 'camlaps/job_list.html', @@ -71,6 +72,7 @@ def job_list(request): 'jobs': jobs, 'queue_started': request.GET.get('started'), 'retried': request.GET.get('retried'), + 'has_active_jobs': has_active_jobs, }, )