feat: Files-Seite verbessert - View, Download & Delete für alle Dateitypen
UI Improvements: - Agent Work Files: View-, Download- und Delete-Buttons hinzugefügt - Projektdokumente: Download- und Delete-Buttons hinzugefügt - Konsistentes UI über alle Datei-Kategorien - View-Modal für Agent-Dateien (wie Projektdokumente) Backend: - /files/agent/<agent_key>/view/<filename> - Agent-Datei anzeigen - /files/agent/<agent_key>/delete/<filename> - Agent-Datei löschen - /files/agent/<agent_key>/<filename>?download=1 - Force Download - /files/project/<filename>?download=1 - Projektdatei Download - /files/project/delete/<filename> - Projektdatei löschen Security: - Path traversal protection für alle Routes - Whitelist-basierte Dateityp-Validierung - Agent-Zugriff nur auf eigene work-Verzeichnisse Features: - 👁 View: Datei im Modal anzeigen (Markdown, TXT) - ↓ Download: Force download statt Browser-Ansicht - ✕ Delete: Datei löschen mit Bestätigung
This commit is contained in:
parent
73c36785e2
commit
11352d2ca5
2 changed files with 124 additions and 2 deletions
|
|
@ -137,6 +137,9 @@
|
|||
<div class="file-actions">
|
||||
<button class="btn btn-sm btn-secondary"
|
||||
onclick="viewProjectFile(event, '{{ file.name }}')" title="Anzeigen">👁</button>
|
||||
<a href="/files/project/{{ file.name }}?download=1" class="btn btn-sm btn-primary" title="Herunterladen" download>↓</a>
|
||||
<a href="/files/project/delete/{{ file.name }}" class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('Projektdokument löschen?')" title="Löschen">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
@ -165,7 +168,11 @@
|
|||
<div class="file-meta">{{ (file.size / 1024)|round(1) }} KB · {{ file.modified[:10] }}</div>
|
||||
</div>
|
||||
<div class="file-actions">
|
||||
<a href="/files/agent/{{ agent_key }}/{{ file.name }}" class="btn btn-sm btn-secondary" title="Herunterladen">↓</a>
|
||||
<button class="btn btn-sm btn-secondary"
|
||||
onclick="viewAgentFile(event, '{{ agent_key }}', '{{ file.name }}')" title="Anzeigen">👁</button>
|
||||
<a href="/files/agent/{{ agent_key }}/{{ file.name }}?download=1" class="btn btn-sm btn-primary" title="Herunterladen" download>↓</a>
|
||||
<a href="/files/agent/{{ agent_key }}/delete/{{ file.name }}" class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('Agent-Datei löschen?')" title="Löschen">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
@ -245,6 +252,11 @@ function viewProjectFile(event, name) {
|
|||
openFileModal(name, '/files/project/view/' + encodeURIComponent(name) + '?json=1');
|
||||
}
|
||||
|
||||
function viewAgentFile(event, agentKey, name) {
|
||||
event.preventDefault();
|
||||
openFileModal(`${agentKey}/${name}`, `/files/agent/${agentKey}/view/${encodeURIComponent(name)}?json=1`);
|
||||
}
|
||||
|
||||
function editEmailFile(name) {
|
||||
currentEditFile = name;
|
||||
document.getElementById('editModalFilename').textContent = name;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue