From b1f4ef285d1fd8e43edeab263e772ad381606ccf Mon Sep 17 00:00:00 2001 From: "changhuiping.chp" Date: Mon, 3 Jul 2023 19:04:17 +0800 Subject: [PATCH 1/2] fix: theme change --- datacenter/app/page.tsx | 3 +++ datacenter/defaultTheme.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/datacenter/app/page.tsx b/datacenter/app/page.tsx index b23ebde43..f66af26c4 100644 --- a/datacenter/app/page.tsx +++ b/datacenter/app/page.tsx @@ -61,6 +61,9 @@ export default function Home() { size="md" variant="solid" className='text-base rounded-none ' + style={{ + boxShadow: '0px 8px 10px 0px rgb(31 31 31 / 50%)' + }} onClick={async () => { const res = await sendPostRequest('/v1/chat/dialogue/new', { chat_mode: scene['chat_scene'] diff --git a/datacenter/defaultTheme.ts b/datacenter/defaultTheme.ts index 0ec16314d..89143c7d1 100644 --- a/datacenter/defaultTheme.ts +++ b/datacenter/defaultTheme.ts @@ -8,7 +8,7 @@ export const joyTheme = extendTheme({ mode: 'dark', primary: { ...colors.grey, - solidBg: '#dfdfdf91', + solidBg: '#9a9a9a91', solidColor: '#4e4e4e', solidHoverBg: '#d5d5d5', outlinedColor: '#4e4e59' From f0cfacd65b10631b63945793ef955331190a0c85 Mon Sep 17 00:00:00 2001 From: "shiweisong.ssw" Date: Mon, 3 Jul 2023 19:52:06 +0800 Subject: [PATCH 2/2] feat: make knowledge space card --- datacenter/app/datastores/page.tsx | 181 +++++++++++++++++------------ 1 file changed, 104 insertions(+), 77 deletions(-) diff --git a/datacenter/app/datastores/page.tsx b/datacenter/app/datastores/page.tsx index 05033bca5..bba7f9c23 100644 --- a/datacenter/app/datastores/page.tsx +++ b/datacenter/app/datastores/page.tsx @@ -3,7 +3,7 @@ import { useRouter } from 'next/navigation' import React, { useState, useEffect } from 'react' import { InboxOutlined } from '@ant-design/icons' -import CheckCircleOutlinedIcon from '@mui/icons-material/CheckCircleOutlined'; +import CheckCircleOutlinedIcon from '@mui/icons-material/CheckCircleOutlined' import type { UploadProps } from 'antd' import { message, Upload, Popover } from 'antd' import { @@ -90,13 +90,16 @@ const Index = () => { } useEffect(() => { async function fetchData() { - const res = await fetch(`${process.env.API_BASE_URL}/knowledge/space/list`, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({}) - }) + const res = await fetch( + `${process.env.API_BASE_URL}/knowledge/space/list`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({}) + } + ) const data = await res.json() if (data.success) { setKnowledgeSpaceList(data.data) @@ -128,74 +131,94 @@ const Index = () => { + New Knowledge Space -
- {knowledgeSpaceList.length ? ( - - - - - - - - - - - {knowledgeSpaceList.map((row: any) => ( - - - - - - - ))} - -
NameVectorOwnerDescription
- { - - router.push(`/datastores/documents?name=${row.name}`) - } - > - {row.name} - - } - - - {row.vector_type} - - - - {row.owner} - - - - {row.desc.length > 10 - ? `${row.desc.slice(0, 10)}...` - : row.desc} - -
- ) : ( - <> - )} -
+ + + {knowledgeSpaceList.map((item: any, index: number) => ( + { + router.push(`/datastores/documents?name=${item.name}`); + }} + > + {item.name} + + + {item.vector_type} + Vector + + + {item.owner} + Owner + + + {item.owner} + Docs + + + + ))} + + + { color: activeStep === index ? '#814DDE' : '' }} > - {index < activeStep ? : `${index + 1}.`} + {index < activeStep ? ( + + ) : ( + `${index + 1}.` + )} {`${item}`} ))}