mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-19 14:11:04 +08:00
Refa: Chat conversations /convsersation API to RESTFul (#13893)
### What problem does this PR solve? Chat conversations /convsersation API to RESTFul. ### Type of change - [x] Refactoring
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
import { CheckIcon, ChevronDownIcon, XIcon } from 'lucide-react';
|
||||
import {
|
||||
Fragment,
|
||||
MouseEventHandler,
|
||||
ReactNode,
|
||||
forwardRef,
|
||||
@@ -207,40 +206,43 @@ export const SelectWithSearch = forwardRef<
|
||||
<CommandEmpty>
|
||||
<div dangerouslySetInnerHTML={{ __html: emptyData }}></div>
|
||||
</CommandEmpty>
|
||||
{options.map((group) => {
|
||||
{options.map((group, groupIndex) => {
|
||||
if (group.options) {
|
||||
return (
|
||||
<Fragment key={group.value}>
|
||||
<CommandGroup heading={group.label} className="mb-1">
|
||||
{group.options.map((option) => (
|
||||
<CommandItem
|
||||
key={option.value}
|
||||
value={option.value}
|
||||
disabled={option.disabled}
|
||||
onSelect={handleSelect}
|
||||
data-testid={
|
||||
optionTestIdPrefix && option.value
|
||||
? `${optionTestIdPrefix}${option.value}`
|
||||
: 'combobox-option'
|
||||
}
|
||||
className={
|
||||
value === option.value ? 'bg-bg-card' : ''
|
||||
}
|
||||
>
|
||||
<span className="leading-none">{option.label}</span>
|
||||
<CommandGroup
|
||||
key={group.value || `group-${groupIndex}`}
|
||||
heading={group.label}
|
||||
className="mb-1"
|
||||
>
|
||||
{group.options.map((option, optionIndex) => (
|
||||
<CommandItem
|
||||
key={
|
||||
option.value ||
|
||||
`option-${groupIndex}-${optionIndex}`
|
||||
}
|
||||
value={option.value}
|
||||
disabled={option.disabled}
|
||||
onSelect={handleSelect}
|
||||
data-testid={
|
||||
optionTestIdPrefix && option.value
|
||||
? `${optionTestIdPrefix}${option.value}`
|
||||
: 'combobox-option'
|
||||
}
|
||||
className={value === option.value ? 'bg-bg-card' : ''}
|
||||
>
|
||||
<span className="leading-none">{option.label}</span>
|
||||
|
||||
{value === option.value && (
|
||||
<CheckIcon size={16} className="ml-auto" />
|
||||
)}
|
||||
</CommandItem>
|
||||
))}
|
||||
</CommandGroup>
|
||||
</Fragment>
|
||||
{value === option.value && (
|
||||
<CheckIcon size={16} className="ml-auto" />
|
||||
)}
|
||||
</CommandItem>
|
||||
))}
|
||||
</CommandGroup>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<CommandItem
|
||||
key={group.value}
|
||||
key={group.value || `item-${groupIndex}`}
|
||||
value={group.value}
|
||||
disabled={group.disabled}
|
||||
onSelect={handleSelect}
|
||||
|
||||
@@ -256,7 +256,7 @@ export const AudioButton = ({
|
||||
formData.append('file', audioFile);
|
||||
formData.append('stream', 'false');
|
||||
|
||||
const response = await fetch(api.sequence2txt, {
|
||||
const response = await fetch(api.chatsTranscriptions, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
[Authorization]: getAuthorization(),
|
||||
|
||||
@@ -12,7 +12,13 @@ import { forwardRef, useCallback, useEffect } from 'react';
|
||||
|
||||
const Select = SelectPrimitive.Root;
|
||||
|
||||
const SelectGroup = SelectPrimitive.Group;
|
||||
const SelectGroup = React.forwardRef<
|
||||
React.ElementRef<typeof SelectPrimitive.Group>,
|
||||
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>
|
||||
>(({ className, ...props }, ref) => (
|
||||
<SelectPrimitive.Group ref={ref} className={cn(className)} {...props} />
|
||||
));
|
||||
SelectGroup.displayName = SelectPrimitive.Group.displayName;
|
||||
|
||||
const SelectValue = SelectPrimitive.Value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user