feat: add Docker support and update backend dependencies
- Introduced `requirements.docker.txt` for Docker-specific dependencies. - Updated `requirements.txt` to include `psycopg[binary]` and `python-multipart`. - Enhanced test suite in `test_main_endpoints.py` to cover document CRUD operations. - Modified `docker-compose.yml` to include PostgreSQL and frontend services. - Added Nginx configuration for reverse proxying API requests. - Refactored file handling in Vue components to support new document storage backend. - Created new utility functions in `docsApi.js` for document management. - Updated configuration to support new API endpoints for document operations. - Adjusted Vite configuration to proxy API requests to the local backend.
This commit is contained in:
+11
-11
@@ -28,16 +28,16 @@ const storageSummary = computed(() => {
|
||||
return `${value >= 100 || index === 0 ? value.toFixed(0) : value.toFixed(1)} ${units[index]}`
|
||||
})
|
||||
|
||||
function handleCreateFile(parentId, name = 'untitled.md') {
|
||||
fs.createFile(parentId, name)
|
||||
async function handleCreateFile(parentId, name = 'untitled.md') {
|
||||
await fs.createFile(parentId, name)
|
||||
}
|
||||
|
||||
function handleCreateFolder(parentId, name = '新建文件夹') {
|
||||
fs.createFolder(parentId, name)
|
||||
async function handleCreateFolder(parentId, name = '新建文件夹') {
|
||||
await fs.createFolder(parentId, name)
|
||||
}
|
||||
|
||||
function handleRename(id, newName) {
|
||||
fs.rename(id, newName)
|
||||
async function handleRename(id, newName) {
|
||||
await fs.rename(id, newName)
|
||||
}
|
||||
|
||||
function findNode(nodes, id) {
|
||||
@@ -61,9 +61,9 @@ function handleDelete(id) {
|
||||
}
|
||||
}
|
||||
|
||||
function confirmDelete() {
|
||||
async function confirmDelete() {
|
||||
if (!confirmDialog.value) return
|
||||
fs.remove(confirmDialog.value.id)
|
||||
await fs.remove(confirmDialog.value.id)
|
||||
confirmDialog.value = null
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ function handleContextMenu(x, y, node) {
|
||||
fs.showContextMenu(x, y, node)
|
||||
}
|
||||
|
||||
function handleDrop(draggedId, targetParentId) {
|
||||
async function handleDrop(draggedId, targetParentId) {
|
||||
if (draggedId === targetParentId) return
|
||||
fs.cut(draggedId)
|
||||
fs.paste(targetParentId)
|
||||
await fs.paste(targetParentId)
|
||||
}
|
||||
|
||||
async function handleUploadFiles(files) {
|
||||
@@ -148,7 +148,7 @@ function closeConfirm() {
|
||||
</div>
|
||||
|
||||
<div class="toolbar-right">
|
||||
<span class="storage-pill">本地存储 {{ storageSummary }}</span>
|
||||
<span class="storage-pill">文档空间 {{ storageSummary }}</span>
|
||||
<button
|
||||
v-if="fs.canPaste()"
|
||||
class="toolbar-btn"
|
||||
|
||||
Reference in New Issue
Block a user