diff --git a/frontend/src/_locales/zh-hans/main.json b/frontend/src/_locales/zh-hans/main.json index 4c87c27..a164401 100644 --- a/frontend/src/_locales/zh-hans/main.json +++ b/frontend/src/_locales/zh-hans/main.json @@ -142,5 +142,6 @@ "MacOS is not yet supported for performing this operation, please do it manually.": "MacOS尚未支持此操作, 请手动执行", "Linux is not yet supported for performing this operation, please do it manually.": "Linux尚未支持此操作, 请手动执行", "On Linux system, you must manually install python dependencies.": "在Linux系统下, 你必须手动安装python依赖", - "Update completed, please restart the program.": "更新完成, 请重启程序" + "Update completed, please restart the program.": "更新完成, 请重启程序", + "Are you sure you want to reset this page? It cannot be undone.": "你确定要重置本页吗?这无法撤销" } \ No newline at end of file diff --git a/frontend/src/components/DialogButton.tsx b/frontend/src/components/DialogButton.tsx index c22c951..c9756bd 100644 --- a/frontend/src/components/DialogButton.tsx +++ b/frontend/src/components/DialogButton.tsx @@ -13,17 +13,22 @@ import { ToolTipButton } from './ToolTipButton'; import { useTranslation } from 'react-i18next'; export const DialogButton: FC<{ - icon: ReactElement, - tooltip: string, + text?: string | null + icon?: ReactElement, + tooltip?: string | null, + className?: string, title: string, contentText: string, onConfirm: () => void -}> = ({ tooltip, icon, title, contentText, onConfirm }) => { +}> = ({ text, icon, tooltip, className, title, contentText, onConfirm }) => { const { t } = useTranslation(); return - + {tooltip ? + : + + } diff --git a/frontend/src/components/ToolTipButton.tsx b/frontend/src/components/ToolTipButton.tsx index 8e684c2..91022de 100644 --- a/frontend/src/components/ToolTipButton.tsx +++ b/frontend/src/components/ToolTipButton.tsx @@ -5,6 +5,7 @@ export const ToolTipButton: FC<{ text?: string | null, desc: string, icon?: ReactElement, + className?: string, size?: 'small' | 'medium' | 'large', shape?: 'rounded' | 'circular' | 'square'; appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent'; @@ -14,6 +15,7 @@ export const ToolTipButton: FC<{ text, desc, icon, + className, size, shape, appearance, @@ -22,7 +24,7 @@ export const ToolTipButton: FC<{ }) => { return ( - ); diff --git a/frontend/src/pages/Completion.tsx b/frontend/src/pages/Completion.tsx index cecfd9a..816ab54 100644 --- a/frontend/src/pages/Completion.tsx +++ b/frontend/src/pages/Completion.tsx @@ -9,6 +9,7 @@ import { ApiParameters } from './Configs'; import commonStore, { ModelStatus } from '../stores/commonStore'; import { fetchEventSource } from '@microsoft/fetch-event-source'; import { toast } from 'react-toastify'; +import { DialogButton } from '../components/DialogButton'; export type CompletionParams = Omit & { stop: string, @@ -348,9 +349,11 @@ const CompletionPanel: FC = observer(() => {
- + { + setPreset(defaultPresets.find((preset) => preset.name === name)!); + }} />