Feat: Modify the text of the embedded website button #3909 (#4057)

### What problem does this PR solve?

Feat: Modify the text of the embedded website button #3909

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu 2024-12-17 14:46:54 +08:00 committed by GitHub
parent 96667696d2
commit 0fcb564261
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 29 additions and 8 deletions

View File

@ -10,3 +10,12 @@
.id { .id {
.linkText(); .linkText();
} }
.darkBg {
background-color: rgb(69, 68, 68);
}
.darkId {
color: white;
.darkBg();
}

View File

@ -5,6 +5,8 @@ import { useTranslate } from '@/hooks/common-hooks';
import { IModalProps } from '@/interfaces/common'; import { IModalProps } from '@/interfaces/common';
import { Card, Modal, Tabs, TabsProps, Typography } from 'antd'; import { Card, Modal, Tabs, TabsProps, Typography } from 'antd';
import { useIsDarkTheme } from '@/components/theme-provider';
import { cn } from '@/lib/utils';
import styles from './index.less'; import styles from './index.less';
const { Paragraph, Link } = Typography; const { Paragraph, Link } = Typography;
@ -23,6 +25,7 @@ const EmbedModal = ({
isAgent: boolean; isAgent: boolean;
}) => { }) => {
const { t } = useTranslate('chat'); const { t } = useTranslate('chat');
const isDarkTheme = useIsDarkTheme();
const text = ` const text = `
~~~ html ~~~ html
@ -67,7 +70,7 @@ const EmbedModal = ({
return ( return (
<Modal <Modal
title={t('embedModalTitle')} title={t('embedIntoSite', { keyPrefix: 'common' })}
open={visible} open={visible}
style={{ top: 300 }} style={{ top: 300 }}
width={'50vw'} width={'50vw'}
@ -79,7 +82,12 @@ const EmbedModal = ({
{t(isAgent ? 'flow' : 'chat', { keyPrefix: 'header' })} {t(isAgent ? 'flow' : 'chat', { keyPrefix: 'header' })}
<span className="ml-1 inline-block">ID</span> <span className="ml-1 inline-block">ID</span>
</div> </div>
<Paragraph copyable={{ text: token }} className={styles.id}> <Paragraph
copyable={{ text: token }}
className={cn(styles.id, {
[styles.darkId]: isDarkTheme,
})}
>
{token} {token}
</Paragraph> </Paragraph>
<Link <Link

View File

@ -33,6 +33,7 @@ export default {
pleaseSelect: 'Please select', pleaseSelect: 'Please select',
pleaseInput: 'Please input', pleaseInput: 'Please input',
submit: 'Submit', submit: 'Submit',
embedIntoSite: 'Embed Into Site',
}, },
login: { login: {
login: 'Sign in', login: 'Sign in',
@ -1026,8 +1027,7 @@ The above is the content you need to summarize.`,
noteDescription: 'Note', noteDescription: 'Note',
notePlaceholder: 'Please enter a note', notePlaceholder: 'Please enter a note',
invoke: 'Invoke', invoke: 'Invoke',
invokeDescription: invokeDescription: `A component capable of calling remote services, using other components' outputs or constants as inputs.`,
`A component capable of calling remote services, using other components' outputs or constants as inputs.`,
url: 'Url', url: 'Url',
method: 'Method', method: 'Method',
timeout: 'Timeout', timeout: 'Timeout',

View File

@ -33,6 +33,7 @@ export default {
pleaseSelect: '請選擇', pleaseSelect: '請選擇',
pleaseInput: '請輸入', pleaseInput: '請輸入',
submit: '提交', submit: '提交',
embedIntoSite: '嵌入網站',
}, },
login: { login: {
login: '登入', login: '登入',

View File

@ -33,6 +33,7 @@ export default {
pleaseSelect: '请选择', pleaseSelect: '请选择',
pleaseInput: '请输入', pleaseInput: '请输入',
submit: '提交', submit: '提交',
embedIntoSite: '嵌入网站',
}, },
login: { login: {
login: '登录', login: '登录',

View File

@ -1,6 +1,6 @@
import { ReactComponent as ChatAppCube } from '@/assets/svg/chat-app-cube.svg'; import { ReactComponent as ChatAppCube } from '@/assets/svg/chat-app-cube.svg';
import RenameModal from '@/components/rename-modal'; import RenameModal from '@/components/rename-modal';
import { DeleteOutlined, EditOutlined, KeyOutlined } from '@ant-design/icons'; import { DeleteOutlined, EditOutlined } from '@ant-design/icons';
import { import {
Avatar, Avatar,
Button, Button,
@ -43,6 +43,7 @@ import {
import { useTranslate } from '@/hooks/common-hooks'; import { useTranslate } from '@/hooks/common-hooks';
import { useSetSelectedRecord } from '@/hooks/logic-hooks'; import { useSetSelectedRecord } from '@/hooks/logic-hooks';
import { IDialog } from '@/interfaces/database/chat'; import { IDialog } from '@/interfaces/database/chat';
import { PictureInPicture2 } from 'lucide-react';
import styles from './index.less'; import styles from './index.less';
const { Text } = Typography; const { Text } = Typography;
@ -191,8 +192,9 @@ const Chat = () => {
onClick: handleShowOverviewModal(dialog), onClick: handleShowOverviewModal(dialog),
label: ( label: (
<Space> <Space>
<KeyOutlined /> {/* <KeyOutlined /> */}
{t('publish', { keyPrefix: 'flow' })} <PictureInPicture2 className="size-4" />
{t('embedIntoSite', { keyPrefix: 'common' })}
</Space> </Space>
), ),
}, },

View File

@ -78,7 +78,7 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
onClick={handleShowEmbedModal} onClick={handleShowEmbedModal}
disabled={!isBeginNodeDataQueryEmpty} disabled={!isBeginNodeDataQueryEmpty}
> >
<b>{t('publish')}</b> <b>{t('embedIntoSite', { keyPrefix: 'common' })}</b>
</Button> </Button>
</Space> </Space>
</Flex> </Flex>