Add files via upload

This commit is contained in:
公明
2026-07-22 16:18:33 +08:00
committed by GitHub
parent fbef2afd68
commit 3f2984b7c6
5 changed files with 482 additions and 61 deletions
+19 -3
View File
@@ -2714,6 +2714,7 @@
<div class="page-header">
<h2 data-i18n="chatFilesPage.title">文件管理</h2>
<div class="page-header-actions">
<button type="button" class="btn-secondary" id="chat-files-export-btn" data-require-permission="files:read" onclick="exportChatFiles()" data-i18n="chatFilesPage.export">导出当前结果</button>
<button type="button" class="btn-primary" id="chat-files-header-upload-btn" data-require-permission="files:write" onclick="chatFilesOpenUploadPicker()" data-i18n="chatFilesPage.upload">上传文件</button>
<input type="file" id="chat-files-upload-input" style="display:none" multiple onchange="onChatFilesUploadPick(event)" />
<button type="button" class="btn-secondary" id="chat-files-refresh-btn" onclick="loadChatFilesPage()" data-i18n="common.refresh">刷新</button>
@@ -2724,11 +2725,24 @@
<div class="tasks-filters chat-files-filters">
<label>
<span data-i18n="chatFilesPage.conversationFilter">会话 ID</span>
<input type="text" id="chat-files-filter-conv" class="form-control" data-i18n="chatFilesPage.conversationPlaceholder" data-i18n-attr="placeholder" placeholder="留空表示全部" onkeydown="if(event.key==='Enter') loadChatFilesPage()" />
<input type="text" id="chat-files-filter-conv" class="form-control" data-i18n="chatFilesPage.conversationPlaceholder" data-i18n-attr="placeholder" placeholder="留空表示全部" onkeydown="if(event.key==='Enter') chatFilesResetToFirstPageAndLoad()" />
</label>
<label>
<span data-i18n="chatFilesPage.projectFilter">项目 ID</span>
<input type="text" id="chat-files-filter-project" class="form-control" data-i18n="chatFilesPage.projectPlaceholder" data-i18n-attr="placeholder" placeholder="留空表示全部" onkeydown="if(event.key==='Enter') chatFilesResetToFirstPageAndLoad()" />
</label>
<label style="flex:1;min-width:180px;max-width:360px;">
<span data-i18n="chatFilesPage.searchName">文件名</span>
<input type="text" id="chat-files-filter-name" class="form-control" data-i18n="chatFilesPage.searchNamePlaceholder" data-i18n-attr="placeholder" placeholder="筛选文件名" oninput="chatFilesFilterNameOnInput()" onkeydown="if(event.key==='Enter') loadChatFilesPage()" />
<input type="text" id="chat-files-filter-name" class="form-control" data-i18n="chatFilesPage.searchNamePlaceholder" data-i18n-attr="placeholder" placeholder="筛选文件名" oninput="chatFilesFilterNameOnInput()" onkeydown="if(event.key==='Enter') chatFilesResetToFirstPageAndLoad()" />
</label>
<label>
<span data-i18n="chatFilesPage.sourceFilter">来源</span>
<select id="chat-files-filter-source" class="form-control" onchange="chatFilesResetToFirstPageAndLoad()">
<option value="all" data-i18n="chatFilesPage.sourceAll">全部</option>
<option value="upload" data-i18n="chatFilesPage.sourceUpload">对话附件</option>
<option value="reduction" data-i18n="chatFilesPage.sourceReduction">工具输出</option>
<option value="conversation_artifact" data-i18n="chatFilesPage.sourceConversationArtifact">会话产物</option>
</select>
</label>
<label>
<span data-i18n="chatFilesPage.groupBy">分组</span>
@@ -2736,10 +2750,11 @@
<option value="none" data-i18n="chatFilesPage.groupNone">不分组</option>
<option value="date" data-i18n="chatFilesPage.groupByDate">按日期</option>
<option value="conversation" data-i18n="chatFilesPage.groupByConversation">按会话</option>
<option value="project" data-i18n="chatFilesPage.groupByProject">按项目</option>
<option value="folder" data-i18n="chatFilesPage.groupByFolder">按文件夹</option>
</select>
</label>
<button class="btn-secondary" type="button" onclick="loadChatFilesPage()" data-i18n="common.search">搜索</button>
<button class="btn-secondary" type="button" onclick="chatFilesResetToFirstPageAndLoad()" data-i18n="common.search">搜索</button>
</div>
<div id="chat-files-upload-progress" class="chat-upload-progress-row chat-upload-progress-row--files" hidden role="status" aria-live="polite">
<div class="chat-upload-progress-track" aria-hidden="true"><div class="chat-upload-progress-fill" id="chat-files-upload-progress-fill"></div></div>
@@ -2748,6 +2763,7 @@
<div id="chat-files-list-wrap" class="chat-files-table-wrap">
<div class="loading-spinner" data-i18n="common.loading">加载中…</div>
</div>
<div id="chat-files-pagination" class="chat-files-pagination pagination" hidden></div>
</div>
</div>