diff --git a/templates/index.html b/templates/index.html index 56c1e89..7e1d4ce 100644 --- a/templates/index.html +++ b/templates/index.html @@ -119,15 +119,39 @@ function renderTable(files) { const tbody = document.getElementById('fileTableBody'); - + // tbody is cleared in loadFiles, so we just append. + + // Add "Go Up" link if not at root + if (currentPath && currentPath !== '/' && currentPath.length > 1) { + let parentPath = currentPath.substring(0, currentPath.lastIndexOf('/')); + if (parentPath === '') parentPath = '/'; + + const tr = document.createElement('tr'); + tr.className = 'file-row'; + tr.onclick = () => enterDir(parentPath); + tr.innerHTML = ` +