mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-09 12:18:12 +00:00
Merge remote-tracking branch 'origin/new-page-framework' into llm_framework
This commit is contained in:
commit
5d69b31e8c
@ -4,6 +4,7 @@ import { useRouter, useSearchParams } from 'next/navigation'
|
|||||||
import React, { useState, useEffect } from 'react'
|
import React, { useState, useEffect } from 'react'
|
||||||
import { Button, Table } from '@/lib/mui'
|
import { Button, Table } from '@/lib/mui'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
import { message } from 'antd'
|
||||||
|
|
||||||
const Documents = () => {
|
const Documents = () => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -51,16 +52,43 @@ const Documents = () => {
|
|||||||
<td>{row.status}</td>
|
<td>{row.status}</td>
|
||||||
<td>
|
<td>
|
||||||
{
|
{
|
||||||
<Button
|
<>
|
||||||
variant="outlined"
|
<Button
|
||||||
onClick={() => {
|
variant="outlined"
|
||||||
router.push(
|
onClick={async () => {
|
||||||
`/datastores/documents/chunklist?spacename=${spaceName}&documentid=${row.id}`
|
const res = await fetch(
|
||||||
)
|
`http://localhost:8000/knowledge/${spaceName}/document/sync`,
|
||||||
}}
|
{
|
||||||
>
|
method: 'POST',
|
||||||
Detail of Chunks
|
headers: {
|
||||||
</Button>
|
'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={() => {
|
||||||
|
router.push(
|
||||||
|
`/datastores/documents/chunklist?spacename=${spaceName}&documentid=${row.id}`
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Detail of Chunks
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user