balibabu
commited on
Commit
·
326ea88
1
Parent(s):
0b0038a
fix: the site domain name in the Chat Bot API is hardcoded. #776 (#859)
Browse files### What problem does this PR solve?
fix: the site domain name in the Chat Bot API is hardcoded. #776
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
web/src/pages/chat/chat-overview-modal/index.tsx
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import LineChart from '@/components/line-chart';
|
2 |
-
import { Domain } from '@/constants/common';
|
3 |
import { useSetModalState, useTranslate } from '@/hooks/commonHooks';
|
4 |
import { IModalProps } from '@/interfaces/common';
|
5 |
import { IDialog, IStats } from '@/interfaces/database/chat';
|
@@ -81,8 +80,7 @@ const ChatOverviewModal = ({
|
|
81 |
<Flex gap={8} vertical>
|
82 |
{t('serviceApiEndpoint')}
|
83 |
<Paragraph copyable className={styles.linkText}>
|
84 |
-
|
85 |
-
{location.hostname === Domain ? Domain : '<YOUR_MACHINE_IP>'}
|
86 |
/v1/api/
|
87 |
</Paragraph>
|
88 |
</Flex>
|
|
|
1 |
import LineChart from '@/components/line-chart';
|
|
|
2 |
import { useSetModalState, useTranslate } from '@/hooks/commonHooks';
|
3 |
import { IModalProps } from '@/interfaces/common';
|
4 |
import { IDialog, IStats } from '@/interfaces/database/chat';
|
|
|
80 |
<Flex gap={8} vertical>
|
81 |
{t('serviceApiEndpoint')}
|
82 |
<Paragraph copyable className={styles.linkText}>
|
83 |
+
{location.origin}
|
|
|
84 |
/v1/api/
|
85 |
</Paragraph>
|
86 |
</Flex>
|
web/src/pages/chat/embed-modal/index.tsx
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import CopyToClipboard from '@/components/copy-to-clipboard';
|
2 |
import HightLightMarkdown from '@/components/highlight-markdown';
|
3 |
-
import { Domain } from '@/constants/common';
|
4 |
import { useTranslate } from '@/hooks/commonHooks';
|
5 |
import { IModalProps } from '@/interfaces/common';
|
6 |
import { Card, Modal, Tabs, TabsProps } from 'antd';
|
@@ -16,7 +15,7 @@ const EmbedModal = ({
|
|
16 |
const text = `
|
17 |
~~~ html
|
18 |
<iframe
|
19 |
-
src="
|
20 |
style="width: 100%; height: 100%; min-height: 600px"
|
21 |
frameborder="0"
|
22 |
>
|
|
|
1 |
import CopyToClipboard from '@/components/copy-to-clipboard';
|
2 |
import HightLightMarkdown from '@/components/highlight-markdown';
|
|
|
3 |
import { useTranslate } from '@/hooks/commonHooks';
|
4 |
import { IModalProps } from '@/interfaces/common';
|
5 |
import { Card, Modal, Tabs, TabsProps } from 'antd';
|
|
|
15 |
const text = `
|
16 |
~~~ html
|
17 |
<iframe
|
18 |
+
src="${location.origin}/chat/share?shared_id=${token}"
|
19 |
style="width: 100%; height: 100%; min-height: 600px"
|
20 |
frameborder="0"
|
21 |
>
|