mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Adjust the style of the agent operator form tool #10703 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -14,7 +14,7 @@ const TabsList = React.forwardRef<
|
|||||||
<TabsPrimitive.List
|
<TabsPrimitive.List
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
'inline-flex h-10 items-center justify-center rounded-md p-1 ',
|
'inline-flex h-10 items-center justify-center rounded-md p-1 bg-bg-card',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
@ -29,7 +29,7 @@ const TabsTrigger = React.forwardRef<
|
|||||||
<TabsPrimitive.Trigger
|
<TabsPrimitive.Trigger
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-text-title-invert data-[state=active]:text-text-primary data-[state=active]:shadow-sm',
|
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg-base data-[state=active]:text-text-primary data-[state=active]:shadow-sm',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@ -66,12 +66,10 @@ export function ToolPopover({ children }: PropsWithChildren) {
|
|||||||
<PopoverContent className="w-80 p-4">
|
<PopoverContent className="w-80 p-4">
|
||||||
<Tabs defaultValue={ToolType.Common}>
|
<Tabs defaultValue={ToolType.Common}>
|
||||||
<TabsList>
|
<TabsList>
|
||||||
<TabsTrigger value={ToolType.Common} className="bg-bg-card">
|
<TabsTrigger value={ToolType.Common}>
|
||||||
{t('flow.builtIn')}
|
{t('flow.builtIn')}
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
<TabsTrigger value={ToolType.MCP} className="bg-bg-card">
|
<TabsTrigger value={ToolType.MCP}>MCP</TabsTrigger>
|
||||||
MCP
|
|
||||||
</TabsTrigger>
|
|
||||||
</TabsList>
|
</TabsList>
|
||||||
<TabsContent value={ToolType.Common}>
|
<TabsContent value={ToolType.Common}>
|
||||||
<ToolCommand
|
<ToolCommand
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
import { CheckIcon } from 'lucide-react';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Command,
|
Command,
|
||||||
CommandEmpty,
|
CommandEmpty,
|
||||||
@ -9,7 +8,6 @@ import {
|
|||||||
CommandList,
|
CommandList,
|
||||||
} from '@/components/ui/command';
|
} from '@/components/ui/command';
|
||||||
import { useListMcpServer } from '@/hooks/use-mcp-request';
|
import { useListMcpServer } from '@/hooks/use-mcp-request';
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import { Operator } from '@/pages/agent/constant';
|
import { Operator } from '@/pages/agent/constant';
|
||||||
import OperatorIcon from '@/pages/agent/operator-icon';
|
import OperatorIcon from '@/pages/agent/operator-icon';
|
||||||
import { t } from 'i18next';
|
import { t } from 'i18next';
|
||||||
@ -68,16 +66,7 @@ function ToolCommandItem({
|
|||||||
}: ToolCommandItemProps & PropsWithChildren) {
|
}: ToolCommandItemProps & PropsWithChildren) {
|
||||||
return (
|
return (
|
||||||
<CommandItem className="cursor-pointer" onSelect={() => toggleOption(id)}>
|
<CommandItem className="cursor-pointer" onSelect={() => toggleOption(id)}>
|
||||||
<div
|
<Checkbox checked={isSelected} />
|
||||||
className={cn(
|
|
||||||
'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
|
|
||||||
isSelected
|
|
||||||
? 'bg-primary text-primary-foreground'
|
|
||||||
: 'opacity-50 [&_svg]:invisible',
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CheckIcon className="h-4 w-4" />
|
|
||||||
</div>
|
|
||||||
{children}
|
{children}
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export function transferOutputs(outputs: Record<string, any>) {
|
|||||||
export function Output({ list }: OutputProps) {
|
export function Output({ list }: OutputProps) {
|
||||||
return (
|
return (
|
||||||
<section className="space-y-2">
|
<section className="space-y-2">
|
||||||
<div>{t('flow.output')}</div>
|
<div className="text-sm">{t('flow.output')}</div>
|
||||||
<ul>
|
<ul>
|
||||||
{list.map((x, idx) => (
|
{list.map((x, idx) => (
|
||||||
<li
|
<li
|
||||||
|
|||||||
Reference in New Issue
Block a user