fix: format position as readable string instead of raw JSON
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
All checks were successful
Deploy Admin Frontend / build-and-deploy (push) Successful in 9s
This commit is contained in:
parent
252b159537
commit
972a80d4af
@ -199,7 +199,15 @@ export function ProgressPage() {
|
||||
{ title: 'Session', dataIndex: 'lastClientSessionId', key: 'sessionId', width: 120, ellipsis: true, render: (v?: string) => v?.slice(0,16) || '-' },
|
||||
{ title: '状态', dataIndex: 'status', key: 'status', width: 85, render: (s: string) => <Tag color={s === 'reading' ? 'blue' : s === 'completed' ? 'green' : 'orange'}>{progressStatusLabels[s] || s}</Tag> },
|
||||
{ title: '进度', dataIndex: 'lastProgress', key: 'progress', width: 65, render: (v: number) => v != null ? `${Math.round(v * 100)}%` : '-' },
|
||||
{ title: '位置', dataIndex: 'lastPosition', key: 'position', width: 100, ellipsis: true, render: (v?: object) => v ? JSON.stringify(v).slice(0,20) : '-' },
|
||||
{ title: '位置', dataIndex: 'lastPosition', key: 'position', width: 100, ellipsis: true, render: (v?: any) => {
|
||||
if (!v) return '-';
|
||||
const pct = v.scrollProgress != null ? `${Math.round(v.scrollProgress * 100)}%` : '';
|
||||
const type = v.type || '';
|
||||
if (type === 'Markdown' || type === 'Text') return `文本 · ${pct || '—'}`;
|
||||
if (type === 'PDF' || type === 'Image') return `${type} · ${pct || '—'}`;
|
||||
if (type === 'EPUB') return `EPUB · ${pct || '—'}`;
|
||||
return pct || JSON.stringify(v).slice(0, 20);
|
||||
} },
|
||||
{ title: '活跃秒', dataIndex: 'totalActiveSeconds', key: 'seconds', width: 70 },
|
||||
{ title: '已读', dataIndex: 'isMarkedRead', key: 'marked', width: 55, render: (v: boolean) => v ? '✅' : '' },
|
||||
{ title: '更新', dataIndex: 'lastReadAt', key: 'updatedAt', width: 140, render: (t?: string) => t ? dayjs(t).format('MM-DD HH:mm') : '-' },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user