добавил суперпольззователя, и запуск прям из окна создания задачи
All checks were successful
Deploy timelaps / deploy (push) Successful in 5s
All checks were successful
Deploy timelaps / deploy (push) Successful in 5s
This commit is contained in:
@@ -3,9 +3,31 @@
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Задание #{{ job.id }}</h2>
|
||||
<a class="btn btn-outline-secondary" href="{% url 'camlaps:job_list' %}">Назад</a>
|
||||
<div class="d-flex gap-2">
|
||||
{% if job.status != 'running' %}
|
||||
<form method="post" action="{% url 'camlaps:run_job_now' job.id %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary">Запустить сейчас</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if job.status == 'error' or job.status == 'success' %}
|
||||
<form method="post" action="{% url 'camlaps:retry_job' job.id %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-warning">Запустить снова</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<a class="btn btn-outline-secondary" href="{% url 'camlaps:job_list' %}">Назад</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if run_now == 'started' %}
|
||||
<div class="alert alert-success py-2">Запуск задания инициирован. Обнови страницу через несколько секунд.</div>
|
||||
{% elif run_now == 'running' %}
|
||||
<div class="alert alert-warning py-2">Задача уже выполняется.</div>
|
||||
{% elif run_now == 'error' %}
|
||||
<div class="alert alert-danger py-2">Не удалось запустить задание. Проверь логи.</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<div class="row g-3">
|
||||
|
||||
@@ -3,10 +3,17 @@
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Очередь задач</h2>
|
||||
<form method="post" action="{% url 'camlaps:start_queue' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary btn-sm">Старт очереди</button>
|
||||
</form>
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{% url 'camlaps:worker_logs' %}">Логи</a>
|
||||
<form method="post" action="{% url 'camlaps:clear_worker_logs' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm">Очистить лог</button>
|
||||
</form>
|
||||
<form method="post" action="{% url 'camlaps:start_queue' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-primary btn-sm">Старт очереди</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if queue_started == 'none' %}
|
||||
@@ -19,6 +26,12 @@
|
||||
<div class="alert alert-success py-2">Запущена задача #{{ queue_started }}.</div>
|
||||
{% endif %}
|
||||
|
||||
{% if retried == 'running' %}
|
||||
<div class="alert alert-warning py-2">Нельзя перезапустить задачу, пока она выполняется.</div>
|
||||
{% elif retried %}
|
||||
<div class="alert alert-success py-2">Задача #{{ retried }} снова поставлена в очередь.</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped align-middle">
|
||||
<thead>
|
||||
@@ -30,6 +43,7 @@
|
||||
<th>FPS</th>
|
||||
<th>Статус</th>
|
||||
<th>Прогресс</th>
|
||||
<th>Причина ошибки</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -49,12 +63,27 @@
|
||||
{{ job.progress_percent }}%
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if job.status == 'error' and job.error_message %}
|
||||
<span class="text-danger" title="{{ job.error_message }}">{{ job.error_message|truncatechars:80 }}</span>
|
||||
{% else %}
|
||||
<span class="text-muted">—</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a class="btn btn-sm btn-outline-primary" href="{% url 'camlaps:job_detail' job.id %}">Открыть</a>
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
{% if job.status == 'error' or job.status == 'success' %}
|
||||
<form method="post" action="{% url 'camlaps:retry_job' job.id %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-sm btn-warning">Запустить снова</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<a class="btn btn-sm btn-outline-primary" href="{% url 'camlaps:job_detail' job.id %}">Открыть</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="8">Пока нет задач.</td></tr>
|
||||
<tr><td colspan="9">Пока нет задач.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
26
camlaps/templates/camlaps/worker_logs.html
Normal file
26
camlaps/templates/camlaps/worker_logs.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Логи воркера</h2>
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-outline-secondary btn-sm" href="{% url 'camlaps:job_list' %}">К задачам</a>
|
||||
<form method="post" action="{% url 'camlaps:clear_worker_logs' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm">Очистить лог</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if request.GET.cleared == '1' %}
|
||||
<div class="alert alert-success py-2">Лог очищен.</div>
|
||||
{% elif request.GET.cleared == '0' %}
|
||||
<div class="alert alert-danger py-2">Не удалось очистить лог.</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<pre class="mb-0" style="max-height: 70vh; overflow: auto; white-space: pre-wrap;">{{ log_lines }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user