diff --git a/README.en.md b/README.en.md index 9b60cb4..f1b2c11 100644 --- a/README.en.md +++ b/README.en.md @@ -2,7 +2,7 @@ [简体中文](README.md) | **English** -Track backup times, locations, and notes for files and folders. Supports batch entry, backup history, private folders, and data recovery. +Track backup times, locations, and notes for files and folders. Supports batch entry, backup history, and private folders. ## Deploy with Docker @@ -40,7 +40,7 @@ To connect an existing MongoDB instance, see [Database configuration](docs/docke - **Batch entry:** Enter batch mode and select items, or paste a table. Each batch supports up to 20 records. - **Find and edit records:** Open backup history → filter by item, location, or date → edit or delete records. - **Private folders:** Click DataBack in the upper-left corner and enter your privacy password. Click it again to hide private folders. -- **Undo deletion:** Use Undo in the deletion notification, or restore items from the recycle bin in data management within 30 days. +- **Undo deletion:** Click Undo in the deletion notification. ## Update @@ -85,13 +85,11 @@ Set the `DATABACK_PRIVACY_PASSWORD` environment variable before using private fo ## Back up and restore data -- **Export:** Unlock private folders → open data management → export JSON to save the complete ledger. -- **Automatic backups:** Open automatic backups in data management. DataBack keeps one backup per day and retains the latest 30. You can download a backup or create one immediately. -- **Restore:** Select a backup → review its contents → confirm. DataBack saves the current ledger before replacing it. +- **Automatic backups:** The server saves one ledger snapshot per day and retains the latest 30. Docker stores these in the `databack_snapshots` volume by default. - **Full local backup:** Stop the app, then copy `data/`. - **Full Docker backup:** Stop the service and back up its data volumes and `.env`. See [Full backup](docs/docker.en.md#full-backup) for commands. -Ledger JSON contains folders and backup records. Save actual files, recycle-bin contents, and deployment credentials separately. +The ledger records folders and backup information. Save actual files and deployment credentials separately. ## Layout diff --git a/README.md b/README.md index e9c38b9..25c81fa 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **简体中文** | [English](README.en.md) -记录文件和文件夹的备份时间、位置与说明,支持批量登记、历史查询、隐私目录和数据恢复。 +记录文件和文件夹的备份时间、位置与说明,支持批量登记、历史查询和隐私目录。 ## Docker 部署 @@ -40,7 +40,7 @@ DATABACK_ALLOWED_HOSTS=backup.example.com,127.0.0.1:8767,localhost:8767 - **批量登记:** 点击批量登记后勾选项目,或粘贴表格,每批最多 20 条。 - **查询与修改:** 历史记录 → 筛选资料、位置、日期 → 编辑或删除记录。 - **隐私目录:** 点击左上角 DataBack → 输入隐私密码;再次点击收起。 -- **撤销删除:** 删除提示中点击撤销,或到数据管理的回收站恢复,保留 30 天。 +- **撤销删除:** 在删除后的提示中点击撤销。 ## 更新 @@ -85,13 +85,11 @@ Windows 构建 `web/` 后,双击 `desktop/启动.cmd`;关闭时双击 `deskt ## 数据备份与恢复 -- **导出:** 解锁隐私目录 → 数据管理 → 导出 JSON,保存完整台账。 -- **自动备份:** 数据管理 → 自动备份,每天一份、保留最新 30 份,可下载或立即备份。 -- **恢复:** 选择备份 → 核对内容 → 确认恢复;替换前自动保存当前台账。 +- **自动备份:** 服务端每天保存一份台账快照,保留最新 30 份;Docker 默认保存在 `databack_snapshots` 数据卷。 - **本机完整备份:** 关闭程序后复制 `data/`。 - **Docker 完整备份:** 停止服务后备份数据卷和 `.env`,命令见 [数据备份](docs/docker.md#完整备份)。 -台账 JSON 包含目录和备份记录,实际文件、回收站内容和部署密码另行保存。 +台账只记录目录和备份信息,实际文件和部署密码另行保存。 ## 目录 diff --git a/docs/docker.en.md b/docs/docker.en.md index 06333b0..047aa07 100644 --- a/docs/docker.en.md +++ b/docs/docker.en.md @@ -46,7 +46,7 @@ Merge these fields into the existing application configuration. For a separate c For existing deployments, keep the database directory, users, passwords, replica set, and volume mounts. Replace only the application image. The original `deploy.nas.app_health` Compose health-check entry point remains supported. -To move between storage backends, export ledger JSON through the interface and import it into the destination. The migration CLI is at `web/scripts/migrate_to_mongo.py`; run it with `--help` for options. +To migrate an existing schema-3 ledger JSON file to MongoDB, use `web/scripts/migrate_to_mongo.py`; run it with `--help` for options. ## Full backup diff --git a/docs/docker.md b/docs/docker.md index 95fa572..a13ffea 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -46,7 +46,7 @@ networks: 沿用已有部署时,保留原数据库目录、用户、密码、副本集和挂载配置,仅替换应用镜像。原 Compose 的 `deploy.nas.app_health` 健康检查入口仍可使用。 -台账可通过界面导出 JSON,在另一存储后端导入。迁移工具位于 `web/scripts/migrate_to_mongo.py`,运行 `--help` 查看参数。 +将已有 schema-3 台账 JSON 迁移到 MongoDB 时,使用 `web/scripts/migrate_to_mongo.py`,运行 `--help` 查看参数。 ## 完整备份 diff --git a/web/src/App.tsx b/web/src/App.tsx index d68a7ad..dc07b68 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -18,7 +18,6 @@ import type { DeleteTarget, EntityForm } from './components/EntityForms'; import { Overview } from './features/Overview'; import { AssetDetail } from './features/AssetDetail'; import { History } from './features/History'; -import { DataManagement } from './features/DataManagement'; export default function App() { const session = useSession(); @@ -83,7 +82,7 @@ function LedgerApp({session, onLogout,privacyOpen,onTogglePrivacy,onSetPrivate}: finally { markPending.current = false; setMarking(false); } }; const saved = async () => { await ledger.refresh({throwOnError: true}); setNotice('备份记录已保存。'); }; - const deleted = async (trashId?: string) => { await ledger.refresh({throwOnError: true}); setNotice('已移入回收站。', trashId); }; + const deleted = async (trashId?: string) => { await ledger.refresh({throwOnError: true}); setNotice('已删除。', trashId); }; const state = ledger.state; const detail = state?.assets.find(asset => asset.id === detailId); const directRecords = state && route.folderId && state.assets.some(asset => asset.id === route.folderId && asset.backup_target === true) && buildHierarchy(state.assets).isLeaf(route.folderId); @@ -96,7 +95,6 @@ function LedgerApp({session, onLogout,privacyOpen,onTogglePrivacy,onSetPrivate}: {!state ?

DataBack

{ledger.loading ? `正在读取${nas ? '' : '本机'}台账…` : '恢复连接后即可继续查看和登记资料。'}

: <> {route.page === 'overview' ? setEntity({kind: 'assets', entry})} onMark={markAsset} marking={marking} onAssetDelete={asset => setDeletion({collection: 'assets', id: asset.id, name: asset.name})} onRegister={assetId => setBackup({assetId})} onDetail={setDetailId} onLocateAsset={locateAsset} onEditRecords={assetId => setRecordEditor({assetId, mode: 'edit'})} onAddRecord={assetId => setRecordEditor({assetId, mode: 'new'})} onReorder={ledger.reorder} onRefresh={ledger.refresh} onBulk={assetIds=>setBulk({assetIds,mode:'selection'})} onPaste={()=>setBulk({mode:'paste'})} onPrivacy={onSetPrivate}/> : null} {route.page === 'history' ? setBackup({})} onBulk={()=>setBulk({mode:'selection'})} onBulkEdit={setBulkRecordIds} onEdit={setRecord} onDelete={entry => setDeletion({collection: 'records', id: entry.id, name: '备份记录'})} /> : null} - {route.page === 'data' ? ledger.refresh({throwOnError:true})} privacyOpen={privacyOpen} onUnlockPrivacy={onTogglePrivacy} /> : null} {detail && route.page === 'overview' && !directRecords ? setDetailId('')} onEditRecords={() => setRecordEditor({assetId: detail.id, mode: 'edit'})} onAddRecord={buildHierarchy(state.assets).isLeaf(detail.id) ? () => setRecordEditor({assetId: detail.id, mode: 'new'}) : undefined} /> : null} {recordInfo && recordEditor ? setRecordEditor(null)} onSaved={saved} onDeleted={deleted} /> : null} {backup ? setBackup(null)} onSaved={saved} onChooseTargets={() => { setBackup(null); openFolder(null); }} /> : null} @@ -109,6 +107,6 @@ function LedgerApp({session, onLogout,privacyOpen,onTogglePrivacy,onSetPrivate}: setNotice(nas ? '已保存。' : '已保存到本机台账。'); }} /> : null} } - {deletion ? setDeletion(null)} onRemove={async (collection, id) => { const receipt = await ledger.remove(collection, id); setNotice('已移入回收站。', receipt.trash_id); }} /> : null} + {deletion ? setDeletion(null)} onRemove={async (collection, id) => { const receipt = await ledger.remove(collection, id); setNotice('已删除。', receipt.trash_id); }} /> : null} ; } diff --git a/web/src/components/AssetForm.tsx b/web/src/components/AssetForm.tsx index 5003958..51df82b 100644 --- a/web/src/components/AssetForm.tsx +++ b/web/src/components/AssetForm.tsx @@ -45,7 +45,7 @@ export function AssetDialog({ state, entry, initialKind = 'folder', parentId = n {!entry ?
: null} {!batch ? update('name', e.target.value)} /> : null}
-
+ {batch ? <>