feat: Download links for web server (#1039)

## Summary

* **What is the goal of this PR?** Add a link to files to download on
web server

## Additional Context

* There was already an api to download files, i just added a link to it
for files.

---

### AI Usage

Did you use AI tools to help write this code? **NO**

Addresses #621

---------

Co-authored-by: Eliz Kilic <elizk@google.com>
This commit is contained in:
Eliz
2026-02-23 08:16:40 +00:00
committed by GitHub
parent 6dc993852b
commit 9e4ef008cc

View File

@@ -212,12 +212,14 @@
.file-icon { .file-icon {
margin-right: 8px; margin-right: 8px;
} }
.folder-link { .folder-link,
.file-link {
color: var(--accent-color); color: var(--accent-color);
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
.folder-link:hover { .folder-link:hover,
.file-link:hover {
color: var(--accent-hover-color); color: var(--accent-hover-color);
text-decoration: underline; text-decoration: underline;
} }
@@ -872,7 +874,8 @@
// Checkbox cell + file row // Checkbox cell + file row
fileTableContent += `<tr class="${file.isEpub ? 'epub-file' : ''}">`; fileTableContent += `<tr class="${file.isEpub ? 'epub-file' : ''}">`;
fileTableContent += `<td><input type="checkbox" class="select-item" data-path="${encodeURIComponent(filePath)}" data-name="${escapeHtml(file.name)}" data-type="file"></td>`; fileTableContent += `<td><input type="checkbox" class="select-item" data-path="${encodeURIComponent(filePath)}" data-name="${escapeHtml(file.name)}" data-type="file"></td>`;
fileTableContent += `<td><span class="file-icon">${file.isEpub ? '📗' : '📄'}</span>${escapeHtml(file.name)}`; fileTableContent += `<td><span class="file-icon">${file.isEpub ? '📗' : '📄'}</span>`;
fileTableContent += `<a rel="noopener noreferrer" target="_blank" href="/download?path=${encodeURIComponent(filePath)}" class="file-link">${escapeHtml(file.name)}</a>`;
if (file.isEpub) fileTableContent += '<span class="epub-badge">EPUB</span>'; if (file.isEpub) fileTableContent += '<span class="epub-badge">EPUB</span>';
fileTableContent += '</td>'; fileTableContent += '</td>';
fileTableContent += `<td>${file.name.split('.').pop().toUpperCase()}</td>`; fileTableContent += `<td>${file.name.split('.').pop().toUpperCase()}</td>`;