diff --git a/client/app/factory/edit/[id]/page.tsx b/client/app/factory/edit/[id]/page.tsx
index 8cf01ba3..6dfbb7d0 100644
--- a/client/app/factory/edit/[id]/page.tsx
+++ b/client/app/factory/edit/[id]/page.tsx
@@ -4,6 +4,7 @@ import { Tabs, Tab, Button, Input, Avatar } from '@nextui-org/react';
import BotCreateFrom from '@/app/factory/edit/components/BotCreateFrom';
import { toast, ToastContainer } from 'react-toastify';
import BackIcon from '@/public/icons/BackIcon';
+import { CopyToClipboard } from 'react-copy-to-clipboard';
import {
useBotConfigGenerator,
useBotConfig,
@@ -80,6 +81,7 @@ export default function Edit({ params }: { params: { id: string } }) {
draft.description = data.description;
draft.starters = data.starters;
draft.public = data.public;
+ draft.repoName = data.repoName;
draft.helloMessage = data.hello_message;
});
}
@@ -109,6 +111,7 @@ export default function Edit({ params }: { params: { id: string } }) {
draft.helloMessage = config.hello_message || '';
draft.prompt = config.prompt || '';
draft.public = config.public ?? false;
+ draft.repoName = config.repo_name ?? '';
});
}, [config]);
@@ -214,6 +217,24 @@ export default function Edit({ params }: { params: { id: string } }) {
/>
);
+ const manualConfigLabel = (
+
+ Github 项目名
+ {botProfile.id && (
+ {
+ toast.success('Token 已复制到剪贴板');
+ }}
+ >
+ {/* @ts-ignore */}
+
+ 复制 Token
+
+
+ )}
+
+ );
const manualConfigContent = (
@@ -222,7 +243,7 @@ export default function Edit({ params }: { params: { id: string } }) {
type="text"
variant="bordered"
name="repo_name"
- label="Github 项目名"
+ label={manualConfigLabel}
disabled={isEdit}
value={botProfile?.repoName}
placeholder="请输入 GitHub 项目名称 (ORG_NAME/REPO_NAME)"
@@ -233,7 +254,9 @@ export default function Edit({ params }: { params: { id: string } }) {
draft.repoName = repoName;
});
}}
+ isDisabled={isEdit}
required
+ classNames={{ label: 'w-full' }}
className="mt-1 mb-6 block w-full border-gray-300 rounded-md shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
/>
diff --git a/client/app/factory/edit/components/KnowledgeBtn.tsx b/client/app/factory/edit/components/KnowledgeBtn.tsx
index aa3cf95e..a455b6a1 100644
--- a/client/app/factory/edit/components/KnowledgeBtn.tsx
+++ b/client/app/factory/edit/components/KnowledgeBtn.tsx
@@ -18,12 +18,15 @@ type IProps = {
const KnowledgeBtn = (props: IProps) => {
const { onClick, botId, mode } = props;
const { setTaskProfile } = useBotTask();
- const [isPolling, setIsPolling] = React.useState
(true);
+ const [shouldGetTask, setShouldGetTask] = React.useState(!!botId);
const [taskLoading, setTaskLoading] = React.useState(true);
- const { data: taskList } = useGetBotRagTask(botId, isPolling, true);
- const taskCnt = taskList?.length ?? 0;
const [allowShowChunkList, setAllowShowChunkList] =
React.useState(false);
+
+ const { data: taskList } = useGetBotRagTask(botId, shouldGetTask, true);
+ const taskCnt = taskList?.length ?? 0;
+
+ // compute task running status by taskList
useEffect(() => {
if (!taskList) return;
let completeTaskCnt = 0;
@@ -44,12 +47,13 @@ const KnowledgeBtn = (props: IProps) => {
setTaskProfile({ running: taskRunning });
}, [taskList]);
+ // close the interval query
useEffect(() => {
- setIsPolling(true);
return () => {
- setIsPolling(false);
+ setShouldGetTask(false);
};
}, []);
+
if (mode === 'pageHeader') {
return (
<>
diff --git a/client/app/market/page.tsx b/client/app/market/page.tsx
index 4f018a0e..efe94961 100644
--- a/client/app/market/page.tsx
+++ b/client/app/market/page.tsx
@@ -67,7 +67,7 @@ export default function Home() {
return (
-
+
{!isEmpty(bots) &&
map(bots, (bot: Bot) => (
diff --git a/client/components/Navbar.tsx b/client/components/Navbar.tsx
index 9c9114cd..90925ae3 100644
--- a/client/components/Navbar.tsx
+++ b/client/components/Navbar.tsx
@@ -113,7 +113,7 @@ export function Navbar() {
/>
- {!pathname.includes('/factory/list') &&
}
+ {!pathname.includes('/factory/list') &&
}
{pathname.includes('/factory/list') && (