Merge pull request #115 from zhaoshibao/feat-113-114
This commit is contained in:
commit
f5302c4c4b
@ -558,30 +558,44 @@ const getDatabaseInfo = () => {
|
|||||||
|
|
||||||
const deleteFile = (fileId) => {
|
const deleteFile = (fileId) => {
|
||||||
console.log(fileId)
|
console.log(fileId)
|
||||||
state.lock = true
|
//删除提示
|
||||||
fetch('/api/data/document', {
|
Modal.confirm({
|
||||||
method: "DELETE",
|
title: '删除文件',
|
||||||
headers: {
|
content: '确定要删除该文件吗?',
|
||||||
"Content-Type": "application/json" // 添加 Content-Type 头
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
state.lock = true
|
||||||
|
fetch('/api/data/document', {
|
||||||
|
method: "DELETE",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json" // 添加 Content-Type 头
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
db_id: databaseId.value,
|
||||||
|
file_id: fileId
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
console.log(data)
|
||||||
|
message.success(data.message)
|
||||||
|
getDatabaseInfo()
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error)
|
||||||
|
message.error(error.message)
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
state.lock = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
onCancel: () => {
|
||||||
db_id: databaseId.value,
|
console.log('Cancel');
|
||||||
file_id: fileId
|
},
|
||||||
}),
|
});
|
||||||
})
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
console.log(data)
|
|
||||||
message.success(data.message)
|
|
||||||
getDatabaseInfo()
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error(error)
|
|
||||||
message.error(error.message)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const chunkParams = ref({
|
const chunkParams = ref({
|
||||||
chunk_size: 1000,
|
chunk_size: 1000,
|
||||||
chunk_overlap: 200,
|
chunk_overlap: 200,
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</HeaderComponent>
|
</HeaderComponent>
|
||||||
|
|
||||||
<a-modal :open="newDatabase.open" title="新建数据库" @ok="createDatabase">
|
<a-modal :open="newDatabase.open" title="新建数据库" @ok="createDatabase" @cancel="newDatabase.open=false">
|
||||||
<h3>数据库名称<span style="color: var(--error-color)">*</span></h3>
|
<h3>数据库名称<span style="color: var(--error-color)">*</span></h3>
|
||||||
<a-input v-model:value="newDatabase.name" placeholder="新建数据库名称" />
|
<a-input v-model:value="newDatabase.name" placeholder="新建数据库名称" />
|
||||||
<h3 style="margin-top: 20px;">数据库描述</h3>
|
<h3 style="margin-top: 20px;">数据库描述</h3>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user