vm-bench/frontend/templates/polling.html
Claus Lohmar 989807f29e fix: innerHTML script execution bug — confirm form and polling now work
Root cause: innerHTML does not execute <script> tags in modern browsers.
The _analysis.html and polling.html fragments had inline <script> blocks
that were silently dropped, causing:
- Confirm form's submitJob() undefined → form submitted as normal GET
  back to '/' (user saw 'New Conversion Session' instead of polling)
- Polling page's poll() never started → stuck on 'Waiting for backend...'

Fix:
- Stripped all <script> tags from _analysis.html and polling.html
- Moved all JS logic into index.html (executed on page load)
- initConfirmForm() attaches submit/change listeners after analysis HTML
  is injected via innerHTML
- initPolling() attaches poll timer + reuse button handlers after
  polling fragment is injected
- Polling fragment replaces step1/analysis content while keeping
  base.html header/footer intact
- Reuse buttons now use onclick attached via JS (not inline)
2026-07-21 18:43:16 +00:00

30 lines
1.1 KiB
HTML

<div class="container" id="polling-container"
data-job-id="{{ job_id }}" data-vmid="{{ vmid }}"
data-source-filename="{{ source_filename }}" data-vm-name="{{ vm_name }}">
<div class="panel poll-panel">
<h2>Converting VM {{ vmid }}</h2>
<p class="dim">Job: <code>{{ job_id }}</code> &nbsp;|&nbsp; {{ vm_name }}</p>
<div id="status-badge" class="badge badge-queued">
<span class="spinner"></span> Queued
</div>
<div class="progress-bar">
<div class="progress-fill" id="conversion-fill" style="width:0%">0%</div>
</div>
<p id="status-message" class="dim">Waiting for backend...</p>
<p id="elapsed" class="dim">Elapsed: 0s</p>
<div id="error-block" class="error hidden"></div>
</div>
<div id="reuse-section" class="panel hidden">
<h2>Conversion Complete</h2>
<p>Use the same source image to create another VM?</p>
<div class="btn-row">
<button id="btn-reuse-yes" class="btn">Yes — Create Another VM</button>
<button id="btn-reuse-no" class="btn btn-secondary">No — Clean Up &amp; Finish</button>
</div>
</div>
</div>