Merge pull request #99 from hummingbot/feat/minor-fix

Feat/minor fix
This commit is contained in:
Ralph Comia
2025-07-16 12:49:55 +08:00
committed by GitHub
2 changed files with 26 additions and 21 deletions

View File

@@ -290,26 +290,26 @@ def render_bot_card(bot_name):
error_df = pd.DataFrame(error_controllers)
st.dataframe(error_df, use_container_width=True, hide_index=True)
# Logs sections
with st.expander("📋 Error Logs"):
if error_logs:
for log in error_logs[:50]:
timestamp = log.get("timestamp", "")
message = log.get("msg", "")
logger_name = log.get("logger_name", "")
st.text(f"{timestamp} - {logger_name}: {message}")
else:
st.info("No error logs available.")
# Logs sections (available for both running and stopped bots)
with st.expander("📋 Error Logs"):
if error_logs:
for log in error_logs[:50]:
timestamp = log.get("timestamp", "")
message = log.get("msg", "")
logger_name = log.get("logger_name", "")
st.text(f"{timestamp} - {logger_name}: {message}")
else:
st.info("No error logs available.")
with st.expander("📝 General Logs"):
if general_logs:
for log in general_logs[:50]:
timestamp = pd.to_datetime(int(log.get("timestamp", 0)), unit="s")
message = log.get("msg", "")
logger_name = log.get("logger_name", "")
st.text(f"{timestamp} - {logger_name}: {message}")
else:
st.info("No general logs available.")
with st.expander("📝 General Logs"):
if general_logs:
for log in general_logs[:50]:
timestamp = pd.to_datetime(int(log.get("timestamp", 0)), unit="s")
message = log.get("msg", "")
logger_name = log.get("logger_name", "")
st.text(f"{timestamp} - {logger_name}: {message}")
else:
st.info("No general logs available.")
except Exception as e:
with st.container(border=True):

View File

@@ -58,7 +58,7 @@ def launch_new_bot(bot_name, image_name, credentials, selected_controllers, max_
deploy_config = {
"instance_name": full_bot_name,
"credentials_profile": credentials,
"controllers_config": [config.replace(".yml", "") for config in selected_controllers],
"controllers_config": selected_controllers,
"image": image_name,
}
@@ -204,7 +204,12 @@ with st.container(border=True):
continue
# Handle both old and new config format
config_name = config.get("config_name", config.get("id", "Unknown"))
config_name = config.get("id")
if not config_name:
# Skip configs without an ID
st.warning(f"Config missing 'id' field: {config}")
continue
config_data = config.get("config", config) # New format has config nested
connector_name = config_data.get("connector_name", "Unknown")