fix: only show resumable sessions with archives or disk images; pass single first file name not joined list

This commit is contained in:
Claus Lohmar 2026-07-27 07:46:02 +00:00
parent a030a83207
commit 162110b4b1
2 changed files with 6 additions and 1 deletions

View file

@ -164,6 +164,10 @@ def list_sessions():
has_disks = True
if not session_files:
continue
archives = {".7z", ".zip", ".rar", ".tar.gz", ".tgz", ".tar", ".gz", ".bz2", ".xz", ".ova"}
has_source = has_disks or any(f["name"].lower().endswith(tuple(archives)) for f in session_files)
if not has_source:
continue
sessions.append({
"session_id": entry.name,
"files": session_files[:10],

View file

@ -76,11 +76,12 @@ async function loadSessions() {
for (var i = 0; i < sessions.length; i++) {
var s = sessions[i];
var fileNames = s.files.map(function(f) { return f.name; }).join(', ');
var firstFile = s.files[0].name;
html += '<div style="display:flex;align-items:center;justify-content:space-between;padding:0.4rem 0;border-bottom:1px solid var(--pve-border);">';
html += '<div><span class="pve-code">' + s.session_id.substring(0, 8) + '</span> &mdash; ' + fileNames + ' <span class="pve-dim">(' + s.total_size_gb + ' GiB)</span>';
if (s.has_disks) html += ' <span class="pve-badge pve-badge-completed" style="font-size:0.65rem;">extracted</span>';
html += '</div>';
html += '<button class="pve-btn pve-btn-primary pve-btn-small" onclick="resumeSession(\'' + s.session_id + '\', \'' + fileNames.replace(/'/g, "\\'") + '\')">Resume</button>';
html += '<button class="pve-btn pve-btn-primary pve-btn-small" onclick="resumeSession(\'' + s.session_id + '\', \'' + firstFile.replace(/'/g, "\\'") + '\')">Resume</button>';
html += '</div>';
}
list.innerHTML = html;