Add persistent web chat log

This commit is contained in:
Tanner committed 2026-11-14 22:02:08 +00:00
1 parent 9be381c2de
commit 492238aa22
12 files changed
+506 -51

No files matched your search

+4
View File
@@ -36,6 +36,7 @@ g.connected = False
g.connection_status = 'disconnected'
g.player_position = None
g.last_chat = None
g.chat_log = []
g.name = None
g.mcdata = False
g.pos = False
@@ -155,7 +156,10 @@ def _api_json_default(value):
@app.route('/api/global')
def api_global():
from mosfet.chat_log import snapshot_chat_log
snapshot = dict(_api_dict_items(g))
snapshot['chat_log'] = snapshot_chat_log(g)
job = g.get('job')
job_state = getattr(job, 'state', None) if job else None
snapshot['job_state'] = getattr(job_state, '__name__', 'idle')