Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -386,7 +386,7 @@ def _build_live_view_text(chat_id: int, mode: str = "status") -> str:
|
|
| 386 |
f"{pause_note}"
|
| 387 |
)
|
| 388 |
else:
|
| 389 |
-
status = compose_status_message(chat_id, include_config=False)
|
| 390 |
logs = session.get('live_log_lines_user', [])
|
| 391 |
log_tail = "\n".join(logs[-8:]) if logs else "No logs yet."
|
| 392 |
pause_note = "\n\n<i>⏸ Auto-updates paused — tap ▶️ Resume to continue</i>" if is_paused else ""
|
|
@@ -827,7 +827,7 @@ def format_settings_display(session: dict) -> str:
|
|
| 827 |
return "\n".join(lines)
|
| 828 |
|
| 829 |
|
| 830 |
-
def compose_status_message(chat_id: int, include_config: bool = False) -> str:
|
| 831 |
session = get_user_session(chat_id)
|
| 832 |
state = session.get('streaming_state', 'idle')
|
| 833 |
icon = STATE_EMOJI.get(state, "❓")
|
|
@@ -862,7 +862,7 @@ def compose_status_message(chat_id: int, include_config: bool = False) -> str:
|
|
| 862 |
if include_config or state in ("idle", "stopped", "completed", "error"):
|
| 863 |
lines += ["", "⚙️ <b>Configuration:</b>", format_settings_display(session)]
|
| 864 |
|
| 865 |
-
if state in ("streaming", "paused", "starting", "reconnecting"):
|
| 866 |
user_logs = session.get('live_log_lines_user', [])
|
| 867 |
last_logs = "\n".join(user_logs[-6:]) if user_logs else "No logs yet."
|
| 868 |
lines += ["", "📋 <b>Recent Logs:</b>", f"<pre>{esc(last_logs)}</pre>"]
|
|
|
|
| 386 |
f"{pause_note}"
|
| 387 |
)
|
| 388 |
else:
|
| 389 |
+
status = compose_status_message(chat_id, include_config=False, include_logs=False)
|
| 390 |
logs = session.get('live_log_lines_user', [])
|
| 391 |
log_tail = "\n".join(logs[-8:]) if logs else "No logs yet."
|
| 392 |
pause_note = "\n\n<i>⏸ Auto-updates paused — tap ▶️ Resume to continue</i>" if is_paused else ""
|
|
|
|
| 827 |
return "\n".join(lines)
|
| 828 |
|
| 829 |
|
| 830 |
+
def compose_status_message(chat_id: int, include_config: bool = False, include_logs: bool = True) -> str:
|
| 831 |
session = get_user_session(chat_id)
|
| 832 |
state = session.get('streaming_state', 'idle')
|
| 833 |
icon = STATE_EMOJI.get(state, "❓")
|
|
|
|
| 862 |
if include_config or state in ("idle", "stopped", "completed", "error"):
|
| 863 |
lines += ["", "⚙️ <b>Configuration:</b>", format_settings_display(session)]
|
| 864 |
|
| 865 |
+
if include_logs and state in ("streaming", "paused", "starting", "reconnecting"):
|
| 866 |
user_logs = session.get('live_log_lines_user', [])
|
| 867 |
last_logs = "\n".join(user_logs[-6:]) if user_logs else "No logs yet."
|
| 868 |
lines += ["", "📋 <b>Recent Logs:</b>", f"<pre>{esc(last_logs)}</pre>"]
|