Add recording upload queue and verified local space reclamation dashboard

This commit is contained in:
Codex
2026-10-16 15:55:09 +08:00
parent 0cfda18053
commit f9be8a0a31
15 changed files with 267 additions and 25 deletions
+5 -1
View File
@@ -505,7 +505,7 @@ def storage_watch():
spool_free = shutil.disk_usage(RECORDINGS).free
free_gb, used_gb = usage.free / 1e9, used / 1e9
reason = ('临时录像区的硬容量限制尚未就绪' if not hard_ready else
'旧录像正在上传,等待腾出新片段容量' if legacy_used+hard_bytes > policy['maxGB']*1e9 else
'旧录像等待上传并清理,暂停新片段录制' if legacy_used+hard_bytes > policy['maxGB']*1e9 else
'临时录像区接近容量上限,等待上传释放空间' if spool_free < 256*1024**2 else
'磁盘可用空间不足' if free_gb < policy['reserveGB'] else '')
with LOCK:
@@ -767,6 +767,8 @@ class Handler(BaseHTTPRequestHandler):
elif path == '/api/backups/run':
self.require_admin()
self.answer(BACKUPS.start())
elif path == '/api/uploads/recordings/retry':
self.require_admin(); self.answer(ARCHIVE.retry(self.user))
elif path == '/api/account/password':
result = ACCOUNTS.change_password(data, self.user)
self.answer(result, cookie='vision=; Path=/; Max-Age=0; HttpOnly; SameSite=Strict')
@@ -1063,6 +1065,8 @@ class Handler(BaseHTTPRequestHandler):
elif path == '/api/backups':
self.require_admin()
self.answer(BACKUPS.status())
elif path == '/api/uploads/recordings':
self.require_admin(); self.answer(ARCHIVE.tasks(self.user,query))
elif path == '/api/households/cover':
home = get_object('households', query.get('id'))
if not home or self.user['role'] != 'admin' and home['id'] != HOUSEHOLDS.scope(self.user):