feat: 支持头像base64导出

This commit is contained in:
cc
2026-01-10 13:50:42 +08:00
parent 0da34d9ab5
commit 2ad88df3c0
3 changed files with 220 additions and 8 deletions

View File

@@ -15,6 +15,7 @@ interface ExportOptions {
format: 'chatlab' | 'chatlab-jsonl' | 'json' | 'html' | 'txt' | 'excel' | 'sql'
dateRange: { start: Date; end: Date } | null
useAllTime: boolean
exportAvatars: boolean
}
interface ExportResult {
@@ -41,7 +42,8 @@ function ExportPage() {
start: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
end: new Date()
},
useAllTime: true
useAllTime: true,
exportAvatars: true
})
const loadSessions = useCallback(async () => {
@@ -140,6 +142,7 @@ function ExportPage() {
const sessionList = Array.from(selectedSessions)
const exportOptions = {
format: options.format,
exportAvatars: options.exportAvatars,
dateRange: options.useAllTime ? null : options.dateRange ? {
start: Math.floor(options.dateRange.start.getTime() / 1000),
end: Math.floor(options.dateRange.end.getTime() / 1000)
@@ -289,6 +292,20 @@ function ExportPage() {
</div>
</div>
<div className="setting-section">
<h3></h3>
<div className="time-options">
<label className="checkbox-item">
<input
type="checkbox"
checked={options.exportAvatars}
onChange={e => setOptions({ ...options, exportAvatars: e.target.checked })}
/>
<span></span>
</label>
</div>
</div>
<div className="setting-section">
<h3></h3>
<div className="export-path-display">