ParisNeo commited on
Commit
b3badb1
·
1 Parent(s): d7009d0

Now we can show the files in the health

Browse files
lightrag/api/lightrag_server.py CHANGED
@@ -1749,7 +1749,7 @@ def create_app(args):
1749
  "status": "healthy",
1750
  "working_directory": str(args.working_dir),
1751
  "input_directory": str(args.input_dir),
1752
- "indexed_files": len(doc_manager.indexed_files),
1753
  "configuration": {
1754
  # LLM configuration binding/host address (if applicable)/model (if applicable)
1755
  "llm_binding": args.llm_binding,
 
1749
  "status": "healthy",
1750
  "working_directory": str(args.working_dir),
1751
  "input_directory": str(args.input_dir),
1752
+ "indexed_files": doc_manager.indexed_files,
1753
  "configuration": {
1754
  # LLM configuration binding/host address (if applicable)/model (if applicable)
1755
  "llm_binding": args.llm_binding,
lightrag/api/static/index.html CHANGED
@@ -620,6 +620,9 @@
620
 
621
  if (response.ok) {
622
  const data = await response.json();
 
 
 
623
  healthInfo.innerHTML = `
624
  <div class="space-y-4">
625
  <div class="flex items-center">
@@ -629,7 +632,14 @@
629
  <div class="space-y-2">
630
  <p><span class="font-medium">Working Directory:</span> ${data.working_directory}</p>
631
  <p><span class="font-medium">Input Directory:</span> ${data.input_directory}</p>
632
- <p><span class="font-medium">Indexed Files:</span> ${data.indexed_files}</p>
 
 
 
 
 
 
 
633
  </div>
634
  <div class="border-t pt-4">
635
  <h4 class="font-medium mb-2">Configuration</h4>
@@ -650,6 +660,7 @@
650
  }
651
  });
652
 
 
653
  $('#closeHealthBtn').addEventListener('click', () => {
654
  healthModal.classList.add('hidden');
655
  });
 
620
 
621
  if (response.ok) {
622
  const data = await response.json();
623
+ // Convert indexed_files to array if it's not already
624
+ const files = Array.isArray(data.indexed_files) ? data.indexed_files : data.indexed_files.split(',');
625
+
626
  healthInfo.innerHTML = `
627
  <div class="space-y-4">
628
  <div class="flex items-center">
 
632
  <div class="space-y-2">
633
  <p><span class="font-medium">Working Directory:</span> ${data.working_directory}</p>
634
  <p><span class="font-medium">Input Directory:</span> ${data.input_directory}</p>
635
+ <div>
636
+ <p><span class="font-medium">Indexed Files:</span> <span class="text-slate-500">(${files.length} files)</span></p>
637
+ <div class="mt-2 max-h-40 overflow-y-auto border rounded p-2">
638
+ <ul class="space-y-1 text-sm">
639
+ ${files.map(file => `<li class="text-slate-600">${file}</li>`).join('')}
640
+ </ul>
641
+ </div>
642
+ </div>
643
  </div>
644
  <div class="border-t pt-4">
645
  <h4 class="font-medium mb-2">Configuration</h4>
 
660
  }
661
  });
662
 
663
+
664
  $('#closeHealthBtn').addEventListener('click', () => {
665
  healthModal.classList.add('hidden');
666
  });