media abstraction: add structured MediaItem model and expose media-source audit in task queue detail

This commit is contained in:
DBT
2026-02-28 02:49:13 +00:00
parent f274acf818
commit 46a0403b0f
5 changed files with 71 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ const resources = {
taskDetail: 'Task Detail',
taskQueue: 'Task Queue',
taskLogs: 'Task Logs',
mediaSources: 'Media Sources',
error: 'Error',
noTaskAudit: 'No task audit records',
selectTask: 'Select a task from the left list',
@@ -170,6 +171,7 @@ const resources = {
taskDetail: '任务详情',
taskQueue: '任务队列',
taskLogs: '任务日志',
mediaSources: '媒体来源',
error: '错误',
noTaskAudit: '暂无任务审计记录',
selectTask: '请从左侧选择任务',

View File

@@ -15,6 +15,7 @@ type TaskAuditItem = {
error?: string;
input_preview?: string;
logs?: string[];
media_items?: Array<{ source?: string; type?: string; ref?: string; path?: string; channel?: string }>;
[key: string]: any;
};
@@ -110,6 +111,21 @@ const TaskAudit: React.FC = () => {
<div className="p-2 rounded bg-zinc-950/60 border border-zinc-800 whitespace-pre-wrap text-zinc-200">{Array.isArray(selected.logs) && selected.logs.length ? selected.logs.join('\n') : '-'}</div>
</div>
<div>
<div className="text-zinc-500 text-xs mb-1">{t('mediaSources')}</div>
<div className="p-2 rounded bg-zinc-950/60 border border-zinc-800 text-xs">
{Array.isArray(selected.media_items) && selected.media_items.length > 0 ? (
<div className="space-y-1">
{selected.media_items.map((m, i) => (
<div key={i} className="font-mono break-all text-zinc-200">
[{m.channel || '-'}] {m.source || '-'} / {m.type || '-'} · {m.path || m.ref || '-'}
</div>
))}
</div>
) : '-'}
</div>
</div>
<div>
<div className="text-zinc-500 text-xs mb-1">{t('rawJson')}</div>
<pre className="p-2 rounded bg-zinc-950/60 border border-zinc-800 text-xs overflow-auto">{selectedPretty}</pre>