mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 15:41:05 +00:00
@@ -67,6 +67,14 @@ export const getNanoid = (size = 12) => {
|
||||
/* Custom text to reg, need to replace special chats */
|
||||
export const replaceRegChars = (text: string) => text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
export const getRegQueryStr = (text: string, flags = 'i') => {
|
||||
const formatText = replaceRegChars(text);
|
||||
const chars = formatText.split('');
|
||||
const regexPattern = chars.join('.*');
|
||||
|
||||
return new RegExp(regexPattern, flags);
|
||||
};
|
||||
|
||||
/* slice json str */
|
||||
export const sliceJsonStr = (str: string) => {
|
||||
str = str.replace(/(\\n|\\)/g, '').replace(/ /g, '');
|
||||
|
@@ -102,6 +102,7 @@ const MyMenu = ({
|
||||
direction={'ltr'}
|
||||
isLazy
|
||||
lazyBehavior={'keepMounted'}
|
||||
placement="bottom-start"
|
||||
>
|
||||
<Box
|
||||
ref={ref}
|
||||
@@ -141,7 +142,6 @@ const MyMenu = ({
|
||||
</Box>
|
||||
<MenuList
|
||||
minW={isOpen ? `${width}px !important` : '80px'}
|
||||
w={width ?? 'auto'}
|
||||
maxW={'300px'}
|
||||
p={'6px'}
|
||||
border={'1px solid #fff'}
|
||||
|
Reference in New Issue
Block a user