From 939f46c7e6c79a02da22c08798ec653e040c0ee3 Mon Sep 17 00:00:00 2001 From: jialin Date: Thu, 3 Apr 2025 13:34:48 +0800 Subject: [PATCH] fix: miss gpu_selector value in catalog --- src/components/copy-button/index.tsx | 14 ++- src/locales/en-US/common.ts | 1 + src/locales/ja-JP/common.ts | 5 + src/locales/ru-RU/common.ts | 5 + src/locales/zh-CN/common.ts | 1 + .../llmodels/components/advance-config.tsx | 20 +-- .../components/deploy-builtin-modal.tsx | 34 ++++- .../llmodels/components/deploy-modal.tsx | 2 +- .../llmodels/components/update-modal.tsx | 10 +- src/pages/llmodels/config/form-context.ts | 2 +- src/pages/llmodels/config/index.ts | 1 - src/pages/llmodels/hooks/index.ts | 3 +- .../resources/components/model-files.tsx | 117 +++++++++++++----- src/utils/index.ts | 5 +- 14 files changed, 156 insertions(+), 64 deletions(-) diff --git a/src/components/copy-button/index.tsx b/src/components/copy-button/index.tsx index 368f40d0..48bbd173 100644 --- a/src/components/copy-button/index.tsx +++ b/src/components/copy-button/index.tsx @@ -2,7 +2,7 @@ import { CheckCircleFilled, CopyOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Button, Tooltip, message } from 'antd'; import ClipboardJS from 'clipboard'; -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; type CopyButtonProps = { children?: React.ReactNode; @@ -63,6 +63,13 @@ const CopyButton: React.FC = ({ } }; + const tipTitle = useMemo(() => { + if (copied) { + return intl.formatMessage({ id: 'common.button.copied' }); + } + return tips ?? intl.formatMessage({ id: 'common.button.copy' }); + }, [copied, intl, tips]); + useEffect(() => { initClipboard(); return () => { @@ -71,10 +78,7 @@ const CopyButton: React.FC = ({ }, [buttonRef]); return ( - +