balibabu commited on
Commit ·
414b804
1
Parent(s): 25ae405
Feat: Modify the text of the embedded website button #3909 (#4057)
Browse files### 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)
web/src/components/api-service/embed-modal/index.less
CHANGED
|
@@ -10,3 +10,12 @@
|
|
| 10 |
.id {
|
| 11 |
.linkText();
|
| 12 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
.id {
|
| 11 |
.linkText();
|
| 12 |
}
|
| 13 |
+
|
| 14 |
+
.darkBg {
|
| 15 |
+
background-color: rgb(69, 68, 68);
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
.darkId {
|
| 19 |
+
color: white;
|
| 20 |
+
.darkBg();
|
| 21 |
+
}
|
web/src/components/api-service/embed-modal/index.tsx
CHANGED
|
@@ -5,6 +5,8 @@ import { useTranslate } from '@/hooks/common-hooks';
|
|
| 5 |
import { IModalProps } from '@/interfaces/common';
|
| 6 |
import { Card, Modal, Tabs, TabsProps, Typography } from 'antd';
|
| 7 |
|
|
|
|
|
|
|
| 8 |
import styles from './index.less';
|
| 9 |
|
| 10 |
const { Paragraph, Link } = Typography;
|
|
@@ -23,6 +25,7 @@ const EmbedModal = ({
|
|
| 23 |
isAgent: boolean;
|
| 24 |
}) => {
|
| 25 |
const { t } = useTranslate('chat');
|
|
|
|
| 26 |
|
| 27 |
const text = `
|
| 28 |
~~~ html
|
|
@@ -67,7 +70,7 @@ const EmbedModal = ({
|
|
| 67 |
|
| 68 |
return (
|
| 69 |
<Modal
|
| 70 |
-
title={t('
|
| 71 |
open={visible}
|
| 72 |
style={{ top: 300 }}
|
| 73 |
width={'50vw'}
|
|
@@ -79,7 +82,12 @@ const EmbedModal = ({
|
|
| 79 |
{t(isAgent ? 'flow' : 'chat', { keyPrefix: 'header' })}
|
| 80 |
<span className="ml-1 inline-block">ID</span>
|
| 81 |
</div>
|
| 82 |
-
<Paragraph
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
{token}
|
| 84 |
</Paragraph>
|
| 85 |
<Link
|
|
|
|
| 5 |
import { IModalProps } from '@/interfaces/common';
|
| 6 |
import { Card, Modal, Tabs, TabsProps, Typography } from 'antd';
|
| 7 |
|
| 8 |
+
import { useIsDarkTheme } from '@/components/theme-provider';
|
| 9 |
+
import { cn } from '@/lib/utils';
|
| 10 |
import styles from './index.less';
|
| 11 |
|
| 12 |
const { Paragraph, Link } = Typography;
|
|
|
|
| 25 |
isAgent: boolean;
|
| 26 |
}) => {
|
| 27 |
const { t } = useTranslate('chat');
|
| 28 |
+
const isDarkTheme = useIsDarkTheme();
|
| 29 |
|
| 30 |
const text = `
|
| 31 |
~~~ html
|
|
|
|
| 70 |
|
| 71 |
return (
|
| 72 |
<Modal
|
| 73 |
+
title={t('embedIntoSite', { keyPrefix: 'common' })}
|
| 74 |
open={visible}
|
| 75 |
style={{ top: 300 }}
|
| 76 |
width={'50vw'}
|
|
|
|
| 82 |
{t(isAgent ? 'flow' : 'chat', { keyPrefix: 'header' })}
|
| 83 |
<span className="ml-1 inline-block">ID</span>
|
| 84 |
</div>
|
| 85 |
+
<Paragraph
|
| 86 |
+
copyable={{ text: token }}
|
| 87 |
+
className={cn(styles.id, {
|
| 88 |
+
[styles.darkId]: isDarkTheme,
|
| 89 |
+
})}
|
| 90 |
+
>
|
| 91 |
{token}
|
| 92 |
</Paragraph>
|
| 93 |
<Link
|
web/src/locales/en.ts
CHANGED
|
@@ -33,6 +33,7 @@ export default {
|
|
| 33 |
pleaseSelect: 'Please select',
|
| 34 |
pleaseInput: 'Please input',
|
| 35 |
submit: 'Submit',
|
|
|
|
| 36 |
},
|
| 37 |
login: {
|
| 38 |
login: 'Sign in',
|
|
@@ -1026,8 +1027,7 @@ The above is the content you need to summarize.`,
|
|
| 1026 |
noteDescription: 'Note',
|
| 1027 |
notePlaceholder: 'Please enter a note',
|
| 1028 |
invoke: 'Invoke',
|
| 1029 |
-
invokeDescription:
|
| 1030 |
-
`A component capable of calling remote services, using other components' outputs or constants as inputs.`,
|
| 1031 |
url: 'Url',
|
| 1032 |
method: 'Method',
|
| 1033 |
timeout: 'Timeout',
|
|
|
|
| 33 |
pleaseSelect: 'Please select',
|
| 34 |
pleaseInput: 'Please input',
|
| 35 |
submit: 'Submit',
|
| 36 |
+
embedIntoSite: 'Embed Into Site',
|
| 37 |
},
|
| 38 |
login: {
|
| 39 |
login: 'Sign in',
|
|
|
|
| 1027 |
noteDescription: 'Note',
|
| 1028 |
notePlaceholder: 'Please enter a note',
|
| 1029 |
invoke: 'Invoke',
|
| 1030 |
+
invokeDescription: `A component capable of calling remote services, using other components' outputs or constants as inputs.`,
|
|
|
|
| 1031 |
url: 'Url',
|
| 1032 |
method: 'Method',
|
| 1033 |
timeout: 'Timeout',
|
web/src/locales/zh-traditional.ts
CHANGED
|
@@ -33,6 +33,7 @@ export default {
|
|
| 33 |
pleaseSelect: '請選擇',
|
| 34 |
pleaseInput: '請輸入',
|
| 35 |
submit: '提交',
|
|
|
|
| 36 |
},
|
| 37 |
login: {
|
| 38 |
login: '登入',
|
|
|
|
| 33 |
pleaseSelect: '請選擇',
|
| 34 |
pleaseInput: '請輸入',
|
| 35 |
submit: '提交',
|
| 36 |
+
embedIntoSite: '嵌入網站',
|
| 37 |
},
|
| 38 |
login: {
|
| 39 |
login: '登入',
|
web/src/locales/zh.ts
CHANGED
|
@@ -33,6 +33,7 @@ export default {
|
|
| 33 |
pleaseSelect: '请选择',
|
| 34 |
pleaseInput: '请输入',
|
| 35 |
submit: '提交',
|
|
|
|
| 36 |
},
|
| 37 |
login: {
|
| 38 |
login: '登录',
|
|
|
|
| 33 |
pleaseSelect: '请选择',
|
| 34 |
pleaseInput: '请输入',
|
| 35 |
submit: '提交',
|
| 36 |
+
embedIntoSite: '嵌入网站',
|
| 37 |
},
|
| 38 |
login: {
|
| 39 |
login: '登录',
|
web/src/pages/chat/index.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import { ReactComponent as ChatAppCube } from '@/assets/svg/chat-app-cube.svg';
|
| 2 |
import RenameModal from '@/components/rename-modal';
|
| 3 |
-
import { DeleteOutlined, EditOutlined
|
| 4 |
import {
|
| 5 |
Avatar,
|
| 6 |
Button,
|
|
@@ -43,6 +43,7 @@ import {
|
|
| 43 |
import { useTranslate } from '@/hooks/common-hooks';
|
| 44 |
import { useSetSelectedRecord } from '@/hooks/logic-hooks';
|
| 45 |
import { IDialog } from '@/interfaces/database/chat';
|
|
|
|
| 46 |
import styles from './index.less';
|
| 47 |
|
| 48 |
const { Text } = Typography;
|
|
@@ -191,8 +192,9 @@ const Chat = () => {
|
|
| 191 |
onClick: handleShowOverviewModal(dialog),
|
| 192 |
label: (
|
| 193 |
<Space>
|
| 194 |
-
<KeyOutlined />
|
| 195 |
-
|
|
|
|
| 196 |
</Space>
|
| 197 |
),
|
| 198 |
},
|
|
|
|
| 1 |
import { ReactComponent as ChatAppCube } from '@/assets/svg/chat-app-cube.svg';
|
| 2 |
import RenameModal from '@/components/rename-modal';
|
| 3 |
+
import { DeleteOutlined, EditOutlined } from '@ant-design/icons';
|
| 4 |
import {
|
| 5 |
Avatar,
|
| 6 |
Button,
|
|
|
|
| 43 |
import { useTranslate } from '@/hooks/common-hooks';
|
| 44 |
import { useSetSelectedRecord } from '@/hooks/logic-hooks';
|
| 45 |
import { IDialog } from '@/interfaces/database/chat';
|
| 46 |
+
import { PictureInPicture2 } from 'lucide-react';
|
| 47 |
import styles from './index.less';
|
| 48 |
|
| 49 |
const { Text } = Typography;
|
|
|
|
| 192 |
onClick: handleShowOverviewModal(dialog),
|
| 193 |
label: (
|
| 194 |
<Space>
|
| 195 |
+
{/* <KeyOutlined /> */}
|
| 196 |
+
<PictureInPicture2 className="size-4" />
|
| 197 |
+
{t('embedIntoSite', { keyPrefix: 'common' })}
|
| 198 |
</Space>
|
| 199 |
),
|
| 200 |
},
|
web/src/pages/flow/header/index.tsx
CHANGED
|
@@ -78,7 +78,7 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
|
|
| 78 |
onClick={handleShowEmbedModal}
|
| 79 |
disabled={!isBeginNodeDataQueryEmpty}
|
| 80 |
>
|
| 81 |
-
<b>{t('
|
| 82 |
</Button>
|
| 83 |
</Space>
|
| 84 |
</Flex>
|
|
|
|
| 78 |
onClick={handleShowEmbedModal}
|
| 79 |
disabled={!isBeginNodeDataQueryEmpty}
|
| 80 |
>
|
| 81 |
+
<b>{t('embedIntoSite', { keyPrefix: 'common' })}</b>
|
| 82 |
</Button>
|
| 83 |
</Space>
|
| 84 |
</Flex>
|