Merge remote-tracking branch 'origin/new-page-framework' into llm_framework

This commit is contained in:
aries_ckt 2023-06-29 18:09:08 +08:00
commit cb4a16f0d0
4 changed files with 21 additions and 20 deletions

View File

@ -41,7 +41,7 @@ const ChunkList = () => {
<div className="p-4"> <div className="p-4">
{chunkList.length ? ( {chunkList.length ? (
<> <>
<Table color="neutral" stripe="odd" variant="outlined"> <Table color="info" variant="soft" size="lg">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>

View File

@ -38,17 +38,17 @@ const documentTypeList = [
{ {
type: 'text', type: 'text',
title: 'Text', title: 'Text',
subTitle: 'Paste some text' subTitle: 'Fill your raw text'
}, },
{ {
type: 'webPage', type: 'webPage',
title: 'Web Page', title: 'URL',
subTitle: 'Crawl text from a web page' subTitle: 'Fetch the content of a URL'
}, },
{ {
type: 'file', type: 'file',
title: 'File', title: 'Document',
subTitle: 'It can be: PDF, CSV, JSON, Text, PowerPoint, Word, Excel' subTitle: 'Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown'
} }
] ]
const page_size = 20; const page_size = 20;
@ -123,7 +123,7 @@ const Documents = () => {
</Sheet> </Sheet>
{documents.length ? ( {documents.length ? (
<> <>
<Table color="neutral" stripe="odd" variant="outlined"> <Table color="info" variant="soft" size="lg">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
@ -138,11 +138,12 @@ const Documents = () => {
{documents.map((row: any) => ( {documents.map((row: any) => (
<tr key={row.id}> <tr key={row.id}>
<td>{row.doc_name}</td> <td>{row.doc_name}</td>
<td>{row.doc_type}</td> <td><Chip variant='soft' color='neutral'>{row.doc_type}</Chip></td>
<td>{row.chunk_size}</td> <td>{row.chunk_size} chunks</td>
<td>{moment(row.last_sync).format('YYYY-MM-DD HH:MM:SS')}</td> <td>{moment(row.last_sync).format('YYYY-MM-DD HH:MM:SS')}</td>
<td> <td>
<Chip <Chip
variant="soft"
color={(function () { color={(function () {
switch (row.status) { switch (row.status) {
case 'TODO': case 'TODO':
@ -401,7 +402,7 @@ const Documents = () => {
) )
const data = await res.json() const data = await res.json()
if (data.success) { if (data.success) {
setDocuments(data.data) setDocuments(data.data.data)
setTotal(data.data.total) setTotal(data.data.total)
setCurrent(data.data.page) setCurrent(data.data.page)
} }
@ -443,7 +444,7 @@ const Documents = () => {
) )
const data = await res.json() const data = await res.json()
if (data.success) { if (data.success) {
setDocuments(data.data) setDocuments(data.data.data)
setTotal(data.data.total) setTotal(data.data.total)
setCurrent(data.data.page) setCurrent(data.data.page)
} }
@ -489,7 +490,7 @@ const Documents = () => {
) )
const data = await res.json() const data = await res.json()
if (data.success) { if (data.success) {
setDocuments(data.data) setDocuments(data.data.data)
setTotal(data.data.total) setTotal(data.data.total)
setCurrent(data.data.page) setCurrent(data.data.page)
} }

View File

@ -39,17 +39,17 @@ const documentTypeList = [
{ {
type: 'text', type: 'text',
title: 'Text', title: 'Text',
subTitle: 'Paste some text' subTitle: 'Fill your raw text'
}, },
{ {
type: 'webPage', type: 'webPage',
title: 'Web Page', title: 'URL',
subTitle: 'Crawl text from a web page' subTitle: 'Fetch the content of a URL'
}, },
{ {
type: 'file', type: 'file',
title: 'File', title: 'Document',
subTitle: 'It can be: PDF, CSV, JSON, Text, PowerPoint, Word, Excel' subTitle: 'Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown'
} }
] ]
@ -125,11 +125,11 @@ const Index = () => {
</Sheet> </Sheet>
<div className="page-body p-4"> <div className="page-body p-4">
{knowledgeSpaceList.length ? ( {knowledgeSpaceList.length ? (
<Table color="neutral" stripe="odd" variant="outlined"> <Table color="info" variant="soft" size="lg">
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Provider</th> <th>Vector</th>
<th>Owner</th> <th>Owner</th>
</tr> </tr>
</thead> </thead>

View File

@ -18,7 +18,7 @@ const LeftSider = () => {
const menus = useMemo(() => { const menus = useMemo(() => {
return [{ return [{
label: 'Datastores', label: 'Knowledge Space',
route: '/datastores', route: '/datastores',
icon: <Article fontSize="small" />, icon: <Article fontSize="small" />,
active: pathname === '/datastores' active: pathname === '/datastores'