|
|
|
@ -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 = '<span style="color: #888;">[' + m.type + ']</span> ' + m.path; |
|
|
|
div.onclick = () => { |
|
|
|
if (pendingPathInput) { |
|
|
|
pendingPathInput.value = m.path; |
|
|
|
} |
|
|
|
closePathModal(); |
|
|
|
}; |
|
|
|
mountList.appendChild(div); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.error('Error loading mounts:', err); |
|
|
|
mountList.innerHTML = '<div style="padding: 10px; color: #ff6b6b;">Error loading mounts</div>'; |
|
|
|
}); |
|
|
|
modal.style.display = 'block'; |
|
|
|
} |
|
|
|
function closePathModal() { |
|
|
|
document.getElementById('pathModal').style.display = 'none'; |
|
|
|
pendingPathInput = null; |
|
|
|
|