Пытаемся угомонить превьюшки
All checks were successful
Deploy MES Core / deploy (push) Successful in 10s

This commit is contained in:
2026-04-03 01:58:23 +03:00
parent b76ce4913f
commit 1fe05d41f6
5 changed files with 141 additions and 39 deletions

View File

@@ -22,6 +22,9 @@
<div class="small text-muted">Обработано: <span id="jobProcessed">{% if last_job %}{{ last_job.processed }}{% endif %}</span>/<span id="jobTotal">{% if last_job %}{{ last_job.total }}{% endif %}</span></div>
<div class="small text-muted">Обновлено: <span id="jobUpdated">{% if last_job %}{{ last_job.updated }}{% endif %}</span> · Пропущено: <span id="jobSkipped">{% if last_job %}{{ last_job.skipped }}{% endif %}</span> · Ошибок: <span id="jobErrors">{% if last_job %}{{ last_job.errors }}{% endif %}</span></div>
<div class="small text-muted" id="jobMessage">{% if last_job %}{{ last_job.last_message }}{% endif %}</div>
<div class="small text-muted mt-2">Лог</div>
<div class="small text-muted" id="jobLogPath">{% if last_job and last_job.log_path %}Файл: {{ last_job.log_path }}{% endif %}</div>
<pre id="jobLog" class="border border-secondary rounded p-2 mb-0" style="max-height: 220px; overflow:auto; white-space: pre-wrap;">{% if last_job %}{{ last_job.log_tail }}{% endif %}</pre>
</div>
<form method="post" class="row g-3 align-items-end">
@@ -49,9 +52,12 @@
</div>
</div>
<div class="col-md-3">
<label class="small text-muted">Таймаут на 1 DXF (сек)</label>
<input type="number" step="1" min="5" name="per_task_timeout_sec" class="form-control border-secondary" value="{{ dxf_settings.per_task_timeout_sec|default_if_none:45|unlocalize }}">
<div class="col-md-6">
<label class="small text-muted d-flex justify-content-between">
<span>Таймаут на 1 DXF (сек)</span>
<span id="timeoutValue">{{ dxf_settings.per_task_timeout_sec|default_if_none:45|unlocalize }}</span>
</label>
<input type="range" min="10" max="50" step="1" name="per_task_timeout_sec" id="timeoutRange" class="form-range" value="{{ dxf_settings.per_task_timeout_sec|default_if_none:45|unlocalize }}">
</div>
<div class="col-12 d-flex gap-2">
@@ -64,6 +70,9 @@
<button type="submit" class="btn btn-outline-warning" name="action" value="cancel_job">
<i class="bi bi-stop-circle me-2"></i>Прервать
</button>
<button type="submit" class="btn btn-outline-secondary" name="action" value="clear_log">
<i class="bi bi-eraser me-2"></i>Очистить лог
</button>
</div>
<div class="col-12">
@@ -93,6 +102,17 @@
const skippedEl = document.getElementById('jobSkipped');
const errorsEl = document.getElementById('jobErrors');
const msgEl = document.getElementById('jobMessage');
const logEl = document.getElementById('jobLog');
const logPathEl = document.getElementById('jobLogPath');
const timeoutRange = document.getElementById('timeoutRange');
const timeoutValue = document.getElementById('timeoutValue');
if (timeoutRange && timeoutValue) {
timeoutValue.textContent = timeoutRange.value;
timeoutRange.addEventListener('input', function () {
timeoutValue.textContent = timeoutRange.value;
});
}
async function tick() {
try {
@@ -109,6 +129,8 @@
if (skippedEl) skippedEl.textContent = String(data.job.skipped ?? '');
if (errorsEl) errorsEl.textContent = String(data.job.errors ?? '');
if (msgEl) msgEl.textContent = data.job.last_message || '';
if (logEl) logEl.textContent = data.job.log_tail || '';
if (logPathEl) logPathEl.textContent = data.job.log_path ? `Файл: ${data.job.log_path}` : '';
if (data.job.status === 'running' || data.job.status === 'queued') {
setTimeout(tick, 3000);