diff --git a/web/src/components/operate-dropdown/index.tsx b/web/src/components/operate-dropdown/index.tsx index 40877fc5a..f243ad2b7 100644 --- a/web/src/components/operate-dropdown/index.tsx +++ b/web/src/components/operate-dropdown/index.tsx @@ -13,6 +13,7 @@ interface IProps { items?: MenuProps['items']; height?: number; needsDeletionValidation?: boolean; + showDeleteItems?: boolean; } const OperateDropdown = ({ @@ -23,6 +24,7 @@ const OperateDropdown = ({ items: otherItems = [], height = 24, needsDeletionValidation = true, + showDeleteItems = true, }: React.PropsWithChildren) => { const { t } = useTranslation(); const showDeleteConfirm = useShowDeleteConfirm(); @@ -44,8 +46,10 @@ const OperateDropdown = ({ }; const items: MenuProps['items'] = useMemo(() => { - return [ - { + const items = []; + + if (showDeleteItems) { + items.push({ key: '1', label: ( @@ -53,10 +57,11 @@ const OperateDropdown = ({ ), - }, - ...otherItems, - ]; - }, [t, otherItems]); + }); + } + + return [...items, ...otherItems]; + }, [showDeleteItems, otherItems, t]); return ( ; diff --git a/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx b/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx index 21466307f..f67755dbe 100644 --- a/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx +++ b/web/src/pages/user-setting/setting-model/system-model-setting-modal/index.tsx @@ -64,6 +64,7 @@ const SystemModelSettingModal = ({ ...allOptions[LlmModelType.Image2text], ]} allowClear + showSearch /> - - - - -