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

This commit is contained in:
aries_ckt 2023-06-27 17:40:09 +08:00
commit 5d69b31e8c

View File

@ -4,6 +4,7 @@ import { useRouter, useSearchParams } from 'next/navigation'
import React, { useState, useEffect } from 'react'
import { Button, Table } from '@/lib/mui'
import moment from 'moment'
import { message } from 'antd'
const Documents = () => {
const router = useRouter()
@ -51,6 +52,32 @@ const Documents = () => {
<td>{row.status}</td>
<td>
{
<>
<Button
variant="outlined"
onClick={async () => {
const res = await fetch(
`http://localhost:8000/knowledge/${spaceName}/document/sync`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
doc_ids: [row.id]
})
}
)
const data = await res.json()
if (data.success) {
message.success('success');
} else {
message.error(data.err_msg || 'failed');
}
}}
>
Synch
</Button>
<Button
variant="outlined"
onClick={() => {
@ -61,6 +88,7 @@ const Documents = () => {
>
Detail of Chunks
</Button>
</>
}
</td>
</tr>