mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 07:27:57 -05:00
Fixed icons showing in console for every block
This commit is contained in:
@@ -28,10 +28,9 @@ export function ConsoleEntry({ entry, consoleWidth }: ConsoleEntryProps) {
|
||||
)
|
||||
|
||||
const blockConfig = useMemo(() => {
|
||||
if (!entry.blockName) return null
|
||||
const blockType = entry.blockName.split(' ')[0].toLowerCase()
|
||||
return getBlock(blockType)
|
||||
}, [entry.blockName])
|
||||
if (!entry.blockType) return null
|
||||
return getBlock(entry.blockType)
|
||||
}, [entry.blockType])
|
||||
|
||||
const BlockIcon = blockConfig?.toolbar.icon
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ export function useWorkflowExecution() {
|
||||
endedAt: log.endedAt,
|
||||
workflowId: activeWorkflowId,
|
||||
timestamp: log.startedAt,
|
||||
blockName: log.blockTitle
|
||||
blockName: log.blockTitle,
|
||||
blockType: log.blockType
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import {
|
||||
BlockLog
|
||||
} from './types'
|
||||
import { tools } from '@/tools'
|
||||
import { getBlockTypeForTool } from '@/blocks'
|
||||
|
||||
export class Executor {
|
||||
constructor(
|
||||
@@ -185,10 +186,14 @@ export class Executor {
|
||||
...inputs,
|
||||
})
|
||||
|
||||
// Get the block type from the tool ID using the helper function
|
||||
const blockType = getBlockTypeForTool(toolId)
|
||||
|
||||
// Prepare a new blockLog entry
|
||||
const blockLog: Partial<BlockLog> = {
|
||||
blockId: block.id,
|
||||
blockTitle: block.metadata?.title || 'Unnamed Block',
|
||||
blockType: blockType,
|
||||
startedAt: new Date().toISOString(),
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface BlockLog {
|
||||
endedAt: string
|
||||
durationMs: number
|
||||
output?: any
|
||||
blockType?: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,9 +5,10 @@ export interface ConsoleEntry {
|
||||
durationMs: number
|
||||
startedAt: string
|
||||
endedAt: string
|
||||
workflowId?: string | null
|
||||
workflowId: string | null
|
||||
timestamp: string
|
||||
blockName?: string
|
||||
blockType?: string
|
||||
}
|
||||
|
||||
export interface ConsoleStore {
|
||||
|
||||
Reference in New Issue
Block a user