From 13dc96375d625fdc9441c0064eb8c897717a1e1a Mon Sep 17 00:00:00 2001 From: Claus Lohmar Date: Mon, 27 Jul 2026 10:48:59 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20remove=20VM=20Name/ID=20from=20down?= =?UTF-8?q?load=20and=20SCP=20forms=20=E2=80=94=20moved=20to=20configure?= =?UTF-8?q?=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/templates/index.html | 31 ++++++------------------------- frontend/templates/scp.html | 22 ++++------------------ 2 files changed, 10 insertions(+), 43 deletions(-) diff --git a/frontend/templates/index.html b/frontend/templates/index.html index fc69292..585f903 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -34,24 +34,11 @@
-
-
- - -
-
- - - Range 21000–21100. Must be unique on host. -
-
- Direct URL to a disk image or archive (.vmdk, .7z, .zip, etc.) + Direct URL to a disk image or archive (.vmdk, .7z, .zip, .ova, etc.)
@@ -124,22 +111,20 @@ function resumeSession(sessionId, firstFile) { document.getElementById('card-scp').style.display = 'none'; document.getElementById('download-section').classList.remove('pve-hidden'); document.getElementById('download-title').textContent = 'Resume Session'; - document.getElementById('url-group').classList.add('pve-hidden'); var btn = document.getElementById('start-btn'); btn.textContent = 'Resume Analysis'; + var urlGroup = document.getElementById('url-group'); + if (urlGroup) urlGroup.classList.add('pve-hidden'); + document.getElementById('source-url').required = false; btn.onclick = function(e) { e.preventDefault(); - var vmid = document.getElementById('vmid').value; - var vmName = document.getElementById('vm-name').value.trim(); - if (!vmid) { alert('Please enter a VM ID.'); return; } window.RESUMED_SID = sessionId; document.getElementById('resume-sessions').classList.add('pve-hidden'); var status = document.getElementById('session-status'); status.classList.remove('pve-hidden'); setPhase('Analysing source image...', 0, true); - runAnalysis(vmid, firstFile, vmName, sessionId); + runAnalysis(0, firstFile, '', sessionId); }; - document.getElementById('source-url').required = false; } function cleanupSession(sessionId, btn) { @@ -190,15 +175,11 @@ async function startSession(e) { polling.innerHTML = ''; document.getElementById('session-error').textContent = ''; - const vmid = document.getElementById('vmid').value; - const vmName = document.getElementById('vm-name').value.trim(); const url = document.getElementById('source-url').value.trim(); if (!url) { showError('Please enter a download URL.'); btn.disabled = false; return; } const sessionId = window.VM_BENCH_SID || ''; const formData = new FormData(); - formData.append('vmid', vmid); - formData.append('vm_name', vmName); formData.append('source_type', 'url'); formData.append('source_url', url); formData.append('session_id', sessionId); @@ -232,7 +213,7 @@ async function handleDownload(formData) { if (pdata.phase === 'complete') { setPhase('Download complete (' + (pdata.file_size_gb || 0) + ' GiB)', 100, false); await sleep(500); - await runAnalysis(data.vmid, filename, data.vm_name); + await runAnalysis(0, filename, ''); return; } if (pdata.phase === 'error') { throw new Error(pdata.error); } diff --git a/frontend/templates/scp.html b/frontend/templates/scp.html index 7a2ab9c..92d604f 100644 --- a/frontend/templates/scp.html +++ b/frontend/templates/scp.html @@ -40,18 +40,6 @@ placeholder="/mnt/vmware/exchange-server.vmdk"> Full path to the disk image or archive on the remote server.
-
-
- - -
-
- - -
-
@@ -107,10 +95,10 @@ async function startScpPull(e) { await new Promise(r => setTimeout(r, 500)); setScpPhase('Step 2/2: Analysing source image...', 0, true); var fd = new FormData(); - fd.append('vmid', document.getElementById('scp-vmid').value); fd.append('filename', filename); - fd.append('vm_name', document.getElementById('scp-vm-name').value.trim()); fd.append('session_id', SESSION_ID); + fd.append('vmid', '0'); + fd.append('vm_name', ''); var ar = await fetch('/session/analyze', { method: 'POST', body: fd }); var adata = await ar.json(); if (adata.phase === 'error') { @@ -121,11 +109,9 @@ async function startScpPull(e) { var analysisId = adata.analysis_id; if (!analysisId) { setScpPhase('Analysis failed', 0, false); - showScpError('Backend returned invalid response — may need restart.'); + showScpError('Backend returned invalid response.'); btn.disabled = false; return; } - var vmid = document.getElementById('scp-vmid').value; - var vmName = document.getElementById('scp-vm-name').value.trim(); var astart = Date.now(); var pollErrs = 0; for (;;) { @@ -135,7 +121,7 @@ async function startScpPull(e) { var elapsed = Math.round((Date.now() - astart) / 1000); setScpPhase('Analysing... ' + (sdata.message || '') + ' (' + elapsed + 's)', sdata.status === 'completed' ? 100 : 50, sdata.status !== 'completed'); if (sdata.status === 'completed') { - window.location.href = '/session/configure/' + analysisId + '?source_filename=' + encodeURIComponent(filename) + '&vm_name=' + encodeURIComponent(vmName) + '&vmid=' + vmid + '&session_id=' + SESSION_ID; + window.location.href = '/session/configure/' + analysisId + '?source_filename=' + encodeURIComponent(filename) + '&session_id=' + SESSION_ID; btn.disabled = false; return; } if (sdata.status === 'failed') {