From ec6f5d1ad3bcc5681f94acc682f36762854adde5 Mon Sep 17 00:00:00 2001 From: jialin Date: Sat, 7 Feb 2026 23:23:27 +0800 Subject: [PATCH] chore: add copy button for run command --- src/components/copy-button/index.tsx | 25 ++++------------------- src/pages/backends/forms/version-info.tsx | 16 ++++++++++----- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/components/copy-button/index.tsx b/src/components/copy-button/index.tsx index 7f6e9acf..e1d465c8 100644 --- a/src/components/copy-button/index.tsx +++ b/src/components/copy-button/index.tsx @@ -1,42 +1,24 @@ import { CheckCircleFilled, CopyOutlined } from '@ant-design/icons'; import { useIntl } from '@umijs/max'; import { Typography } from 'antd'; +import { TextProps } from 'antd/es/typography/Text'; import React, { useMemo } from 'react'; type CopyButtonProps = { children?: React.ReactNode; text: string; - disabled?: boolean; fontSize?: string; - type?: 'text' | 'primary' | 'dashed' | 'link' | 'default'; - size?: 'small' | 'middle' | 'large'; - shape?: 'circle' | 'round' | 'default'; - tips?: string; - placement?: - | 'top' - | 'left' - | 'right' - | 'bottom' - | 'topLeft' - | 'topRight' - | 'bottomLeft' - | 'bottomRight'; btnStyle?: React.CSSProperties; style?: React.CSSProperties; }; -const CopyButton: React.FC = ({ +const CopyButton: React.FC = ({ children, - tips, text, - disabled, - type = 'text', - shape = 'default', fontSize = '14px', style, btnStyle, - placement, - size = 'middle' + ...rest }) => { const intl = useIntl(); @@ -50,6 +32,7 @@ const CopyButton: React.FC = ({ return ( = ({ data }) => { {intl.formatMessage({ id: 'backend.imageName' })}: - + {data.is_built_in ? intl.formatMessage({ id: 'backend.versionInfo.autoImage' }) : data.image_name} - + )} {data.entrypoint && ( @@ -157,9 +163,9 @@ export const VersionItem: React.FC = ({ data }) => { {intl.formatMessage({ id: 'backend.runCommand' })}: - + {data.run_command} - + )}