mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 00:17:31 +00:00
4.6.8 supplement (#831)
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import { useCallback, useTransition } from 'react';
|
||||
|
||||
const PromptEditor = ({
|
||||
showOpenModal = true,
|
||||
showResize = true,
|
||||
variables = [],
|
||||
value,
|
||||
onChange,
|
||||
@@ -19,6 +20,7 @@ const PromptEditor = ({
|
||||
title
|
||||
}: {
|
||||
showOpenModal?: boolean;
|
||||
showResize?: boolean;
|
||||
variables?: EditorVariablePickerType[];
|
||||
value?: string;
|
||||
onChange?: (text: string) => void;
|
||||
@@ -48,7 +50,7 @@ const PromptEditor = ({
|
||||
return (
|
||||
<>
|
||||
<Editor
|
||||
showResize
|
||||
showResize={showResize}
|
||||
showOpenModal={showOpenModal}
|
||||
onOpenModal={onOpen}
|
||||
variables={variables}
|
||||
|
@@ -100,7 +100,7 @@ export default function VariablePickerPlugin({
|
||||
p={2}
|
||||
borderRadius={'md'}
|
||||
position={'fixed'}
|
||||
w={'200px'}
|
||||
w={'auto'}
|
||||
overflow={'hidden'}
|
||||
zIndex={99999}
|
||||
>
|
||||
@@ -113,6 +113,8 @@ export default function VariablePickerPlugin({
|
||||
py={2}
|
||||
borderRadius={'sm'}
|
||||
cursor={'pointer'}
|
||||
maxH={'300px'}
|
||||
overflow={'auto'}
|
||||
_notLast={{
|
||||
mb: 2
|
||||
}}
|
||||
@@ -133,8 +135,11 @@ export default function VariablePickerPlugin({
|
||||
setHighlightedIndex(index);
|
||||
}}
|
||||
>
|
||||
<MyIcon name={item.icon as any} w={'14px'} />
|
||||
<Box ml={2} fontSize={'sm'}>{`${item.key}(${item.label})`}</Box>
|
||||
<MyIcon name={(item.icon as any) || 'core/modules/variable'} w={'14px'} />
|
||||
<Box ml={2} fontSize={'sm'}>
|
||||
{item.key}
|
||||
{item.key !== item.label && `(${item.label})`}
|
||||
</Box>
|
||||
</Flex>
|
||||
))}
|
||||
</Box>,
|
||||
|
Reference in New Issue
Block a user