diff --git a/web/app/components/app/workflow-log/evaluation-cell.tsx b/web/app/components/app/workflow-log/evaluation-cell.tsx index 539ae5b538..5ccfb2e55b 100644 --- a/web/app/components/app/workflow-log/evaluation-cell.tsx +++ b/web/app/components/app/workflow-log/evaluation-cell.tsx @@ -9,7 +9,8 @@ import { } from '@langgenius/dify-ui/popover' import { useState } from 'react' import { useTranslation } from 'react-i18next' -import { getNodeVisual, getToneClasses } from '@/app/components/evaluation/components/metric-selector/utils' +import { getEvaluationNodeBlockType } from '@/app/components/evaluation/components/metric-selector/utils' +import BlockIcon from '@/app/components/workflow/block-icon' type EvaluationCellProps = { evaluation: EvaluationLogItem[] @@ -60,37 +61,34 @@ const EvaluationCell = ({ popupClassName="w-[320px] overflow-hidden rounded-xl border-[0.5px] border-components-panel-border p-0 shadow-[0px_12px_16px_-4px_rgba(9,9,11,0.08),0px_4px_6px_-2px_rgba(9,9,11,0.03)]" >
- {evaluation.map((item, index) => { - const nodeVisual = item.nodeInfo ? getNodeVisual(item.nodeInfo) : null - const nodeToneClasses = nodeVisual ? getToneClasses(nodeVisual.tone) : null - - return ( -
( +
+
+
{item.name}
+ {item.nodeInfo && ( +
+ + + {item.nodeInfo.title} + +
)} - > -
-
{item.name}
- {item.nodeInfo && nodeVisual && nodeToneClasses && ( -
-
-
- - {item.nodeInfo.title} - -
- )} -
-
- {formatEvaluationValue(item.value)} -
- ) - })} +
+ {formatEvaluationValue(item.value)} +
+
+ ))}
diff --git a/web/app/components/evaluation/components/metric-section/builtin-metric-card.tsx b/web/app/components/evaluation/components/metric-section/builtin-metric-card.tsx index b8a4992b65..ed1ec8f4bf 100644 --- a/web/app/components/evaluation/components/metric-section/builtin-metric-card.tsx +++ b/web/app/components/evaluation/components/metric-section/builtin-metric-card.tsx @@ -12,8 +12,9 @@ import { } from '@langgenius/dify-ui/dropdown-menu' import { useState } from 'react' import { useTranslation } from 'react-i18next' +import BlockIcon from '@/app/components/workflow/block-icon' import { useEvaluationStore } from '../../store' -import { dedupeNodeInfoList, getMetricVisual, getNodeVisual, getToneClasses } from '../metric-selector/utils' +import { dedupeNodeInfoList, getEvaluationNodeBlockType, getMetricVisual, getToneClasses } from '../metric-selector/utils' type BuiltinMetricCardProps = EvaluationResourceProps & { metric: EvaluationMetric @@ -41,7 +42,7 @@ const BuiltinMetricCard = ({ return (
-
+
) @@ -126,9 +126,6 @@ const BuiltinMetricCard = ({ popupClassName="w-[252px] rounded-md border-[0.5px] border-components-panel-border py-1 shadow-[0px_12px_16px_-4px_rgba(9,9,11,0.08),0px_4px_6px_-2px_rgba(9,9,11,0.03)]" > {selectableNodeInfoList.map((nodeInfo) => { - const nodeVisual = getNodeVisual(nodeInfo) - const nodeToneClasses = getToneClasses(nodeVisual.tone) - return (
-
-
+ {nodeInfo.title}
diff --git a/web/app/components/evaluation/components/metric-selector/selector-empty-state.tsx b/web/app/components/evaluation/components/metric-selector/selector-empty-state.tsx index d93a8b84e3..9228788bd2 100644 --- a/web/app/components/evaluation/components/metric-selector/selector-empty-state.tsx +++ b/web/app/components/evaluation/components/metric-selector/selector-empty-state.tsx @@ -5,9 +5,9 @@ type SelectorEmptyStateProps = { const EmptySearchStateIcon = () => { return (
-
) } @@ -18,7 +18,7 @@ const SelectorEmptyState = ({ return (
-
{message}
+
{message}
) } diff --git a/web/app/components/evaluation/components/metric-selector/selector-metric-section.tsx b/web/app/components/evaluation/components/metric-selector/selector-metric-section.tsx index 9b4a0826a7..43d7213ba1 100644 --- a/web/app/components/evaluation/components/metric-selector/selector-metric-section.tsx +++ b/web/app/components/evaluation/components/metric-selector/selector-metric-section.tsx @@ -2,7 +2,8 @@ import type { TFunction } from 'i18next' import type { EvaluationMetric } from '../../types' import type { MetricSelectorSection } from './types' import { cn } from '@langgenius/dify-ui/cn' -import { getMetricVisual, getNodeVisual, getToneClasses } from './utils' +import BlockIcon from '@/app/components/workflow/block-icon' +import { getEvaluationNodeBlockType, getMetricVisual, getToneClasses } from './utils' type SelectorMetricSectionProps = { section: MetricSelectorSection @@ -56,7 +57,7 @@ const SelectorMetricSection = ({
- {metric.label} + {metric.label}