From e060fa6abb0877aead08dc71dc7ca2609676bb1e Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Sat, 25 Jan 2025 00:49:09 +0100 Subject: [PATCH] Now we can show the files in the health --- lightrag/api/lightrag_server.py | 2 +- lightrag/api/static/index.html | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 5b4a1c5c..abd26222 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -1749,7 +1749,7 @@ def create_app(args): "status": "healthy", "working_directory": str(args.working_dir), "input_directory": str(args.input_dir), - "indexed_files": len(doc_manager.indexed_files), + "indexed_files": doc_manager.indexed_files, "configuration": { # LLM configuration binding/host address (if applicable)/model (if applicable) "llm_binding": args.llm_binding, diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index 8e6748a8..b32be046 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -620,6 +620,9 @@ if (response.ok) { const data = await response.json(); + // Convert indexed_files to array if it's not already + const files = Array.isArray(data.indexed_files) ? data.indexed_files : data.indexed_files.split(','); + healthInfo.innerHTML = `
@@ -629,7 +632,14 @@

Working Directory: ${data.working_directory}

Input Directory: ${data.input_directory}

-

Indexed Files: ${data.indexed_files}

+
+

Indexed Files: (${files.length} files)

+
+
    + ${files.map(file => `
  • ${file}
  • `).join('')} +
+
+

Configuration

@@ -650,6 +660,7 @@ } }); + $('#closeHealthBtn').addEventListener('click', () => { healthModal.classList.add('hidden'); });