This commit is contained in:
@@ -22,7 +22,7 @@ const KIND_COLORS: Record<string, { dot: string; badge: string; badgeText: strin
|
||||
|
||||
export const ActivityEventCard = memo(function ActivityEventCard({ event, isLast }: { event: ActivityEvent; isLast?: boolean }) {
|
||||
const colors = KIND_COLORS[event.kind] ?? KIND_COLORS.other!;
|
||||
const meta = formatActivityMeta(event.workerId, event.mode);
|
||||
const meta = formatActivityMeta(event.workerId, event.mode, event.backendId);
|
||||
|
||||
return (
|
||||
<div className="grid gap-3" style={{ gridTemplateColumns: '16px minmax(0,1fr)' }}>
|
||||
|
||||
+12
-3
@@ -115,10 +115,17 @@ export interface ActivityEvent {
|
||||
timestamp: string | null;
|
||||
workerId: string | null;
|
||||
mode: string | null;
|
||||
/** Physical backend behind a proxy worker (from [backend:...] tags). */
|
||||
backendId: string | null;
|
||||
}
|
||||
|
||||
export function formatActivityMeta(workerId: string | null, mode: string | null): string {
|
||||
return [workerId ? `worker: ${workerPill(workerId)}` : '', mode ? `mode: ${mode}` : ''].filter(Boolean).join(' · ');
|
||||
export function formatActivityMeta(workerId: string | null, mode: string | null, backendId?: string | null): string {
|
||||
return [
|
||||
workerId ? `worker: ${workerPill(workerId)}` : '',
|
||||
// Show the physical backend when it differs from the (proxy) worker name.
|
||||
backendId && backendId !== workerId ? `backend: ${workerPill(backendId)}` : '',
|
||||
mode ? `mode: ${mode}` : '',
|
||||
].filter(Boolean).join(' · ');
|
||||
}
|
||||
|
||||
export function parseActivityLog(logText: string): ActivityEvent[] {
|
||||
@@ -130,13 +137,15 @@ export function parseActivityLog(logText: string): ActivityEvent[] {
|
||||
const timestamp = timestampMatch?.[1] ?? null;
|
||||
const workerId = /\[worker:([^\]]+)\]/.exec(rawLine)?.[1] ?? null;
|
||||
const mode = /\[mode:([^\]]+)\]/.exec(rawLine)?.[1] ?? null;
|
||||
const backendId = /\[backend:([^\]]+)\]/.exec(rawLine)?.[1] ?? null;
|
||||
const line = rawLine
|
||||
.replace(/^\[[^\]]+\]\s+/, '')
|
||||
.replace(/\[worker:[^\]]+\]\s*/g, '')
|
||||
.replace(/\[mode:[^\]]+\]\s*/g, '')
|
||||
.replace(/\[backend:[^\]]+\]\s*/g, '')
|
||||
.trim();
|
||||
|
||||
const base = { id: `${timestamp ?? 'line'}-${index}`, timestamp, workerId, mode };
|
||||
const base = { id: `${timestamp ?? 'line'}-${index}`, timestamp, workerId, mode, backendId };
|
||||
|
||||
const movementStart = /^\[([^\]]+)\] (?:start|ステップ開始)$/.exec(line);
|
||||
if (movementStart) {
|
||||
|
||||
Reference in New Issue
Block a user