From 3e5857b9d06a0aacb36d44a9744cba2a860fe77c Mon Sep 17 00:00:00 2001 From: cardosofede Date: Sat, 25 May 2024 23:31:40 -0500 Subject: [PATCH] (feat) improve conditions in performance card --- frontend/components/bot_performance_card.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/components/bot_performance_card.py b/frontend/components/bot_performance_card.py index d006017..90bc826 100644 --- a/frontend/components/bot_performance_card.py +++ b/frontend/components/bot_performance_card.py @@ -21,7 +21,6 @@ def archive_bot(bot_name): backend_api_client.remove_container(bot_name) - class BotPerformanceCardV2(Dashboard.Item): DEFAULT_COLUMNS = [ {"field": 'id', "headerName": 'ID', "width": WIDE_COL_WIDTH}, @@ -58,7 +57,7 @@ class BotPerformanceCardV2(Dashboard.Item): controller_configs = backend_api_client.get_all_configs_from_bot(bot_name) bot_status = backend_api_client.get_bot_status(bot_name) is_running = False - if len(bot_status) > 0: + if bot_status and len(bot_status) > 0: # Controllers Table active_controllers_list = [] stopped_controllers_list = [] @@ -86,7 +85,7 @@ class BotPerformanceCardV2(Dashboard.Item): "open_order_volume": open_order_volume, "imbalance": imbalance, } - if any([value != 0 for value in controller_info.values() if value != controller_info["id"]]): + if len(controller_info) > 0: is_running = True if kill_switch_status: stopped_controllers_list.append(controller_info)