From b99abeb351841e95b2832f11ed3e61e2458bec67 Mon Sep 17 00:00:00 2001 From: Jagger <634750802@qq.com> Date: Fri, 20 Sep 2024 20:09:30 +0800 Subject: [PATCH] feat(frontend): display chat origin --- frontend/app/src/api/chats.ts | 2 ++ frontend/app/src/components/chat/chats-table.tsx | 1 + frontend/app/src/components/chat/debug-info.tsx | 1 + 3 files changed, 4 insertions(+) diff --git a/frontend/app/src/api/chats.ts b/frontend/app/src/api/chats.ts index ee13a535..e5ec67c1 100644 --- a/frontend/app/src/api/chats.ts +++ b/frontend/app/src/api/chats.ts @@ -18,6 +18,7 @@ export interface Chat { updated_at: Date; created_at: Date; id: string; + origin: string | null; } export interface ChatDetail { @@ -61,6 +62,7 @@ export const chatSchema = z.object({ updated_at: zodJsonDate(), created_at: zodJsonDate(), id: z.string(), + origin: z.string().nullable(), }) satisfies ZodType; const chatMessageSourceSchema = z.object({ diff --git a/frontend/app/src/components/chat/chats-table.tsx b/frontend/app/src/components/chat/chats-table.tsx index 0d7d6ade..ed20d52c 100644 --- a/frontend/app/src/components/chat/chats-table.tsx +++ b/frontend/app/src/components/chat/chats-table.tsx @@ -26,6 +26,7 @@ const columns = [ helper.accessor('title', { cell: link({ url: chat => `/c/${chat.id}` }), }), + helper.accessor('origin', {}), helper.accessor('created_at', { cell: datetime }), helper.accessor('engine_id', {}), helper.accessor('engine_options', { cell: metadataCell }), diff --git a/frontend/app/src/components/chat/debug-info.tsx b/frontend/app/src/components/chat/debug-info.tsx index c585bb59..cd74369f 100644 --- a/frontend/app/src/components/chat/debug-info.tsx +++ b/frontend/app/src/components/chat/debug-info.tsx @@ -33,6 +33,7 @@ export function DebugInfo ({ group }: DebugInfoProps) {
+ } /> } />