mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: The keys for data manipulation operators can only be numbers, letters, and underscores. #10427 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { NodeCollapsible } from '@/components/collapse';
|
|
import { BaseNode } from '@/interfaces/database/agent';
|
|
import { NodeProps } from '@xyflow/react';
|
|
import { RagNode } from '.';
|
|
import { VariableAggregatorFormSchemaType } from '../../form/variable-aggregator-form/schema';
|
|
import { useGetVariableLabelOrTypeByValue } from '../../hooks/use-get-begin-query';
|
|
import { LabelCard } from './card';
|
|
|
|
export function VariableAggregatorNode({
|
|
...props
|
|
}: NodeProps<BaseNode<VariableAggregatorFormSchemaType>>) {
|
|
const { data } = props;
|
|
const { getLabel } = useGetVariableLabelOrTypeByValue();
|
|
|
|
return (
|
|
<RagNode {...props}>
|
|
<NodeCollapsible items={data.form?.groups}>
|
|
{(x, idx) => (
|
|
<section key={idx} className="space-y-1">
|
|
<div className="flex justify-between items-center gap-2">
|
|
<span className="flex-1 min-w-0 truncate"> {x.group_name}</span>
|
|
<span className="text-text-secondary">{x.type}</span>
|
|
</div>
|
|
<div className="space-y-1">
|
|
{x.variables?.map((y, index) => (
|
|
<LabelCard key={index} className="truncate">
|
|
{getLabel(y.value)}
|
|
</LabelCard>
|
|
))}
|
|
</div>
|
|
</section>
|
|
)}
|
|
</NodeCollapsible>
|
|
</RagNode>
|
|
);
|
|
}
|