Add 'Compute now' button to job detail File & Geometry card

POST /jobs/{id}/analyse clears the stl_cache entry and re-runs trimesh,
then redirects back to the detail page. Button hidden for .gcode files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Hohenberg
2026-06-18 22:20:01 +02:00
parent 13422ba29b
commit b9710faf73
2 changed files with 23 additions and 4 deletions

View File

@@ -70,8 +70,15 @@
{# ── STL geometry ── #}
<div class="col-md-6">
<div class="card h-100">
<div class="card-header text-secondary small text-uppercase fw-normal" style="border-color:#21262d">
File &amp; Geometry
<div class="card-header border-secondary d-flex align-items-center justify-content-between" style="border-color:#21262d">
<span class="text-secondary small text-uppercase fw-normal">File &amp; Geometry</span>
{% if job.file_name and not job.file_name.endswith('.gcode') %}
<form method="POST" action="/jobs/{{ job.id }}/analyse">
<button type="submit" class="btn btn-outline-secondary btn-sm py-0 px-2" style="font-size:.75rem">
<i class="bi bi-cpu me-1"></i>Compute now
</button>
</form>
{% endif %}
</div>
<div class="card-body">
{% if job.file_name %}
@@ -91,7 +98,7 @@
{% elif job.file_name and job.file_name.endswith('.gcode') %}
<p class="text-secondary small mb-0">Geometry not available for gcode files.</p>
{% elif job.file_name %}
<p class="text-secondary small mb-0">Not yet analysed — will be computed on next upload.</p>
<p class="text-secondary small mb-0">Not yet analysed.</p>
{% else %}
<p class="text-secondary small mb-0">No file attached.</p>
{% endif %}