Add SSE second-level dashboard stream and 2s client heartbeat.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-17 21:04:55 +08:00
parent ba74a9cce8
commit d860156b11
8 changed files with 114 additions and 62 deletions
+2 -1
View File
@@ -141,7 +141,8 @@ def list_machines(conn: sqlite3.Connection) -> list[dict]:
return [row_to_dict(r) for r in cur.fetchall()]
ONLINE_SECONDS = 180 # 与下载中心一致:3 分钟内心跳视为在线
# 客户端约 2 秒心跳一次;超过该秒数无心跳视为离线(秒级大屏)
ONLINE_SECONDS = 8
def list_machines_for_user(conn: sqlite3.Connection, user: dict) -> list[dict]: