From cfc4060d2bf0fbcc62581a86185e511bc2441957 Mon Sep 17 00:00:00 2001 From: swpa Date: Tue, 26 May 2026 18:30:10 +0800 Subject: [PATCH] feat: Core Backup Engine & Async Stability --- .vscode/settings.json | 4 ++ database.py | 3 +- index.html | 46 ++++++++++++++ routers/backup.py | 3 +- static/app.js | 140 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..58e2313 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.inlineSuggest.enabled": false, + "json.schemaDownload.enable": false +} \ No newline at end of file diff --git a/database.py b/database.py index 04c5b2c..5ef7141 100644 --- a/database.py +++ b/database.py @@ -328,7 +328,7 @@ async def get_config_backup_detail(backup_id: str) -> Optional[Dict[str, Any]]: return None query = """ - SELECT id, timestamp, snapshot_name, is_auto, parsed_tree + SELECT id, host, timestamp, snapshot_name, is_auto, parsed_tree FROM config_backups WHERE id = $1; """ @@ -341,6 +341,7 @@ async def get_config_backup_detail(backup_id: str) -> Optional[Dict[str, Any]]: return { "id": str(record["id"]), + "host": record["host"], "timestamp": record["timestamp"].isoformat(), "snapshot_name": record["snapshot_name"], "is_auto": record["is_auto"], diff --git a/index.html b/index.html index f20b803..af172ca 100644 --- a/index.html +++ b/index.html @@ -36,6 +36,8 @@ + + @@ -373,6 +375,50 @@ + +
+
+ + +
+

📸 建立新快照

+
+ + + + +
+
+ + +
+
+

🗂️ 歷史備份紀錄

+ +
+ + + + + + + + + + + + + + + +
時間快照名稱類型操作
請點擊「重新整理」載入歷史紀錄...
+
+ +
+
+