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 = '