From c8ced082d2692ba8a6d0e34cffb7eeeed83fea19 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Sun, 4 Jan 2026 01:16:44 -0600 Subject: [PATCH] checkpoint --- index.html | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index d09297e8..095a82b3 100644 --- a/index.html +++ b/index.html @@ -430,25 +430,33 @@ entry.appendChild(removeBtn); container.appendChild(entry); } - function openPathModal(targetInput) { - pendingPathInput = targetInput; - const modal = document.getElementById('pathModal'); - const mountList = document.getElementById('mount-list'); - mountList.innerHTML = ''; - g_mounts.forEach(m => { - const div = document.createElement('div'); - div.className = 'mount-list-item'; - div.textContent = m; - div.onclick = () => { - if (pendingPathInput) { - pendingPathInput.value = m; - } - closePathModal(); - }; - mountList.appendChild(div); - }); - modal.style.display = 'block'; - } + function openPathModal(targetInput) { + pendingPathInput = targetInput; + const modal = document.getElementById('pathModal'); + const mountList = document.getElementById('mount-list'); + mountList.innerHTML = ''; + fetch('/mounts') + .then(r => r.json()) + .then(mounts => { + mounts.forEach(m => { + const div = document.createElement('div'); + div.className = 'mount-list-item'; + div.innerHTML = '[' + m.type + '] ' + m.path; + div.onclick = () => { + if (pendingPathInput) { + pendingPathInput.value = m.path; + } + closePathModal(); + }; + mountList.appendChild(div); + }); + }) + .catch(err => { + console.error('Error loading mounts:', err); + mountList.innerHTML = '
Error loading mounts
'; + }); + modal.style.display = 'block'; + } function closePathModal() { document.getElementById('pathModal').style.display = 'none'; pendingPathInput = null;