add external variable debug (#4204)
* add external variable debug * fix ui * plugin variables
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
import { getMyApps } from '@/web/core/app/api';
|
||||
import SelectOneResource from '@/components/common/folder/SelectOneResource';
|
||||
import { ChatItemContext } from '@/web/core/chat/context/chatItemContext';
|
||||
import VariablePopover from '@/components/core/chat/ChatContainer/ChatBox/components/VariablePopover';
|
||||
|
||||
const ChatHeader = ({
|
||||
history,
|
||||
@@ -38,7 +39,10 @@ const ChatHeader = ({
|
||||
const { isPc } = useSystem();
|
||||
|
||||
const chatData = useContextSelector(ChatItemContext, (v) => v.chatBoxData);
|
||||
const isVariableVisible = useContextSelector(ChatItemContext, (v) => v.isVariableVisible);
|
||||
const isPlugin = chatData.app.type === AppTypeEnum.plugin;
|
||||
const router = useRouter();
|
||||
const isChat = router.pathname === '/chat';
|
||||
|
||||
return isPc && isPlugin ? null : (
|
||||
<Flex
|
||||
@@ -68,8 +72,12 @@ const ChatHeader = ({
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* control */}
|
||||
{!isPlugin && <ToolMenu history={history} />}
|
||||
<Flex gap={2} alignItems={'center'}>
|
||||
{!isVariableVisible && <VariablePopover showExternalVariables={isChat} />}
|
||||
|
||||
{/* control */}
|
||||
{!isPlugin && <ToolMenu history={history} />}
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user