@@ -361,7 +396,7 @@ export default function Edit() {
startContent={
}
isLoading={createBotLoading}
onClick={() => {
- const repoName = extractFullRepoNameFromGitHubUrl(gitUrl);
+ const repoName = gitRepoName || botProfile.repoName;
if (repoName) {
onCreateBot({
repo_name: repoName!!,
diff --git a/client/app/factory/list/components/BotCard.tsx b/client/app/factory/list/components/BotCard.tsx
index 6a1e67a4..47078f9a 100644
--- a/client/app/factory/list/components/BotCard.tsx
+++ b/client/app/factory/list/components/BotCard.tsx
@@ -18,25 +18,72 @@ import {
} from '@nextui-org/react';
import { useRouter } from 'next/navigation';
import { useBotDelete, useGetBotRagTask } from '@/app/hooks/useBot';
-import CloudIcon from '@/public/icons/CloudIcon';
-import MinusCircleIcon from '@/public/icons/MinusCircleIcon';
import { TaskStatus } from '@/types/task';
import ErrorBadgeIcon from '@/public/icons/ErrorBadgeIcon';
-import CheckBadgeIcon from '@/public/icons/CheckBadgeIcon';
-import LoadingIcon from '@/public/icons/LoadingIcon';
+import KnowledgeTaskCompleteIcon from '@/public/icons/CheckBadgeIcon';
+import KnowledgeTaskRunningIcon from '@/public/icons/LoadingIcon';
import { RagTask } from '@/app/services/BotsController';
+import CardGithubIcon from '@/public/icons/CardGithubIcon';
+import CardHomeIcon from '@/public/icons/CardHomeIcon';
+import CardCartIcon from '@/public/icons/CardCartIcon';
import { useKnowledgeUpdate } from '@/app/hooks/useKnowledgeUpdate';
+
declare type Bot = Tables<'bots'>;
+interface BotInfo extends Bot {
+ github_installed?: boolean;
+ picture?: string;
+ nickname?: string;
+}
+
+const BotInfoIconList = (props: { bot: BotInfo }) => {
+ const { bot } = props;
+ const showHomeIcon = bot.domain_whitelist && bot.domain_whitelist.length > 0;
+ const showCartIcon = bot.public;
+ const showGithubIcon = bot.github_installed;
+ const texts = [
+ showGithubIcon ? I18N.components.BotCard.gITHU : '',
+ showHomeIcon ? I18N.components.BotCard.guanWang : undefined,
+ showCartIcon ? I18N.components.Navbar.shiChang : undefined,
+ ].filter(Boolean);
+ const toolTipText = I18N.template?.(I18N.components.BotCard.yiZaiTEX, {
+ val1: texts.join('、'),
+ });
+ const isSingle = texts.length === 1;
+ return (
+
+
+
{showGithubIcon && }
+
+ {showHomeIcon && }
+
+
+ {showCartIcon && }
+
+
+
+ );
+};
+
const BotCard = (props: { bot: Bot }) => {
+ const [isHovered, setIsHovered] = useState(false);
const { isOpen, onOpen, onOpenChange, onClose } = useDisclosure();
const { bot } = props;
const router = useRouter();
const { deleteBot, isLoading, isSuccess } = useBotDelete();
- const { data: taskInfo } = useGetBotRagTask(bot.id, true, false);
const { mutate: updateKnowledge, isPending: isUpdating } =
useKnowledgeUpdate();
+ const { data: taskInfo } = useGetBotRagTask(bot.repo_name!, false);
useEffect(() => {
if (isSuccess) {
@@ -60,14 +107,14 @@ const BotCard = (props: { bot: Bot }) => {
? TaskStatus.COMPLETED
: 'others';
if (status === TaskStatus.COMPLETED) {
- return
;
+ return
;
}
if (status === TaskStatus.ERROR) {
return
;
}
return (
-
+
);
};
@@ -98,7 +145,13 @@ const BotCard = (props: { bot: Bot }) => {
className="relative overflow-hidden w-full h-full bg-cover bg-center rounded-[8px]"
style={{ backgroundImage: `url(${bot.avatar})` }}
>
-
+
{
src={bot.avatar!}
/>
+
+
+