feat: add wallet types, image upload, backup tabs, and manage.sh

Add mnemonic/key credentials with image upload, tabbed UI for add/query
and settings (auth/types/backup), daily backup to /root, and interactive
deploy script that updates via git pull only.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-17 20:35:24 +08:00
parent 703fd912f8
commit 3e52b8eb87
11 changed files with 1081 additions and 421 deletions
+36 -1
View File
@@ -94,6 +94,32 @@ BUILTIN_TYPES = [
{"key": "note", "label": "备注", "type": "text"},
],
},
{
"id": "wallet_mnemonic",
"label": "钱包助记词",
"builtin": True,
"fields": [
{"key": "title", "label": "名称", "type": "text", "required": True},
{"key": "chain", "label": "链/网络", "type": "text"},
{"key": "mnemonic", "label": "助记词", "type": "textarea", "required": True, "secret": True},
{"key": "address", "label": "钱包地址", "type": "text"},
{"key": "image", "label": "图片", "type": "image"},
{"key": "note", "label": "备注", "type": "text"},
],
},
{
"id": "wallet_key",
"label": "钱包密钥",
"builtin": True,
"fields": [
{"key": "title", "label": "名称", "type": "text", "required": True},
{"key": "chain", "label": "链/网络", "type": "text"},
{"key": "private_key", "label": "私钥", "type": "secret", "required": True},
{"key": "address", "label": "钱包地址", "type": "text"},
{"key": "image", "label": "图片", "type": "image"},
{"key": "note", "label": "备注", "type": "text"},
],
},
]
@@ -208,7 +234,7 @@ def save_records(records: list):
def record_title(type_id: str, fields: dict) -> str:
for key in ("title", "username", "email", "wechat_id", "qq_number"):
for key in ("title", "username", "email", "wechat_id", "qq_number", "address"):
if fields.get(key):
return str(fields[key])
if type_id == "exchange":
@@ -218,6 +244,15 @@ def record_title(type_id: str, fields: dict) -> str:
return "未命名"
def is_sensitive_field(fd: dict) -> bool:
if fd.get("secret"):
return True
if fd.get("type") in ("secret",):
return True
key = fd.get("key", "")
return any(x in key for x in ("password", "secret", "mnemonic", "private_key", "webhook"))
def _field_applies(fd: dict, fields_in: dict) -> bool:
when = fd.get("when")
if not when: