diff --git a/admin/services.py b/admin/services.py index 3aa738fd5..c3b7d3001 100644 --- a/admin/services.py +++ b/admin/services.py @@ -177,8 +177,18 @@ class ServiceMgr: def get_all_services(): result = [] configs = SERVICE_CONFIGS.configs - for config in configs: - result.append(config.to_dict()) + for service_id, config in enumerate(configs): + config_dict = config.to_dict() + service_detail = None + try: + service_detail = ServiceMgr.get_service_details(service_id) + if service_detail['alive']: + config_dict['status'] = 'Alive' + else: + config_dict['status'] = 'Timeout' + except Exception: + config_dict['status'] = 'Timeout' + result.append(config_dict) return result @staticmethod diff --git a/docs/guides/manage_users_and_services.md b/docs/guides/manage_users_and_services.md index c076904f8..d36ed0ff5 100644 --- a/docs/guides/manage_users_and_services.md +++ b/docs/guides/manage_users_and_services.md @@ -121,16 +121,16 @@ Commands are case-insensitive and must be terminated with a semicolon(;). admin> list services; command: list services; Listing all services -+-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+ -| extra | host | id | name | port | service_type | -+-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+ -| {} | 0.0.0.0 | 0 | ragflow_0 | 9380 | ragflow_server | -| {'meta_type': 'mysql', 'password': 'infini_rag_flow', 'username': 'root'} | localhost | 1 | mysql | 5455 | meta_data | -| {'password': 'infini_rag_flow', 'store_type': 'minio', 'user': 'rag_flow'} | localhost | 2 | minio | 9000 | file_store | -| {'password': 'infini_rag_flow', 'retrieval_type': 'elasticsearch', 'username': 'elastic'} | localhost | 3 | elasticsearch | 1200 | retrieval | -| {'db_name': 'default_db', 'retrieval_type': 'infinity'} | localhost | 4 | infinity | 23817 | retrieval | -| {'database': 1, 'mq_type': 'redis', 'password': 'infini_rag_flow'} | localhost | 5 | redis | 6379 | message_queue | -+-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+ ++-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+---------+ +| extra | host | id | name | port | service_type | status | ++-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+---------+ +| {} | 0.0.0.0 | 0 | ragflow_0 | 9380 | ragflow_server | Timeout | +| {'meta_type': 'mysql', 'password': 'infini_rag_flow', 'username': 'root'} | localhost | 1 | mysql | 5455 | meta_data | Alive | +| {'password': 'infini_rag_flow', 'store_type': 'minio', 'user': 'rag_flow'} | localhost | 2 | minio | 9000 | file_store | Alive | +| {'password': 'infini_rag_flow', 'retrieval_type': 'elasticsearch', 'username': 'elastic'} | localhost | 3 | elasticsearch | 1200 | retrieval | Alive | +| {'db_name': 'default_db', 'retrieval_type': 'infinity'} | localhost | 4 | infinity | 23817 | retrieval | Timeout | +| {'database': 1, 'mq_type': 'redis', 'password': 'infini_rag_flow'} | localhost | 5 | redis | 6379 | message_queue | Alive | ++-------------------------------------------------------------------------------------------+-----------+----+---------------+-------+----------------+---------+ ```