Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fix: refresh model config form & mobile footer button lost #2318

Merged
merged 9 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage/start.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Get Start with LobeChat
title: Get started with LobeChat
description: >-
Explore the exciting features in LobeChat, including Vision Model, TTS & STT,
Local LLMs, and Multi AI Providers. Discover more about Agent Market, Plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Modal } from '@lobehub/ui';
import { Checkbox, Form, Input } from 'antd';
import { Button, Checkbox, Form, Input } from 'antd';
import isEqual from 'fast-deep-equal';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
Expand All @@ -16,6 +16,7 @@ interface ModelConfigModalProps {
const ModelConfigModal = memo<ModelConfigModalProps>(({ showAzureDeployName, provider }) => {
const [formInstance] = Form.useForm();
const { t } = useTranslation('setting');
const { t: tc } = useTranslation('common');

const [open, id, editingProvider, dispatchCustomModelCards, toggleEditingCustomModelCard] =
useUserStore((s) => [
Expand All @@ -38,20 +39,32 @@ const ModelConfigModal = memo<ModelConfigModalProps>(({ showAzureDeployName, pro
return (
<Modal
destroyOnClose
maskClosable
onCancel={() => {
closeModal();
}}
onOk={() => {
if (!editingProvider || !id) return;
const data = formInstance.getFieldsValue();
footer={[
<Button key="cancel" onClick={closeModal}>
{tc('cancel')}
</Button>,

<Button
key="ok"
onClick={() => {
if (!editingProvider || !id) return;
const data = formInstance.getFieldsValue();

dispatchCustomModelCards(editingProvider as any, { id, type: 'update', value: data });
dispatchCustomModelCards(editingProvider as any, { id, type: 'update', value: data });

closeModal();
}}
closeModal();
}}
style={{ marginInlineStart: '16px' }}
type="primary"
>
{tc('ok')}
</Button>,
]}
maskClosable
onCancel={closeModal}
open={open}
title={t('llm.customModelCards.modelConfig.modalTitle')}
zIndex={1051} // Select is 1050
Copy link
Contributor Author

@sxjeru sxjeru May 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不知为何,明明 Drawer 也有 zIndex 属性,但参数传不到,Antd Modal 倒是拿到了。
想必与此处相关:https://github.com/lobehub/lobe-ui/blob/master/src/Modal/index.tsx

>
<div
onClick={(e) => {
Expand All @@ -66,6 +79,7 @@ const ModelConfigModal = memo<ModelConfigModalProps>(({ showAzureDeployName, pro
form={formInstance}
initialValues={modelCard}
labelCol={{ span: 4 }}
preserve={false}
style={{ marginTop: 16 }}
wrapperCol={{ offset: 1, span: 18 }}
>
Expand Down