Merge pull request #1197 from danielaskdd/main
Browse files
lightrag/api/utils_api.py
CHANGED
@@ -8,7 +8,6 @@ from typing import Optional, List, Tuple
|
|
8 |
import sys
|
9 |
from ascii_colors import ASCIIColors
|
10 |
import logging
|
11 |
-
from ascii_colors import ASCIIColors
|
12 |
from lightrag.api import __api_version__
|
13 |
from fastapi import HTTPException, Security, Request, status
|
14 |
from dotenv import load_dotenv
|
@@ -17,15 +16,18 @@ from starlette.status import HTTP_403_FORBIDDEN
|
|
17 |
from .auth import auth_handler
|
18 |
from ..prompt import PROMPTS
|
19 |
|
|
|
20 |
def check_env_file():
|
21 |
"""
|
22 |
Check if .env file exists and handle user confirmation if needed.
|
23 |
Returns True if should continue, False if should exit.
|
24 |
"""
|
25 |
if not os.path.exists(".env"):
|
26 |
-
warning_msg =
|
|
|
|
|
27 |
ASCIIColors.yellow(warning_msg)
|
28 |
-
|
29 |
# Check if running in interactive terminal
|
30 |
if sys.stdin.isatty():
|
31 |
response = input("Do you want to continue? (yes/no): ")
|
@@ -34,6 +36,7 @@ def check_env_file():
|
|
34 |
return False
|
35 |
return True
|
36 |
|
|
|
37 |
# Load environment variables
|
38 |
load_dotenv()
|
39 |
|
|
|
8 |
import sys
|
9 |
from ascii_colors import ASCIIColors
|
10 |
import logging
|
|
|
11 |
from lightrag.api import __api_version__
|
12 |
from fastapi import HTTPException, Security, Request, status
|
13 |
from dotenv import load_dotenv
|
|
|
16 |
from .auth import auth_handler
|
17 |
from ..prompt import PROMPTS
|
18 |
|
19 |
+
|
20 |
def check_env_file():
|
21 |
"""
|
22 |
Check if .env file exists and handle user confirmation if needed.
|
23 |
Returns True if should continue, False if should exit.
|
24 |
"""
|
25 |
if not os.path.exists(".env"):
|
26 |
+
warning_msg = (
|
27 |
+
"Warning: .env file not found. Some features may not work properly."
|
28 |
+
)
|
29 |
ASCIIColors.yellow(warning_msg)
|
30 |
+
|
31 |
# Check if running in interactive terminal
|
32 |
if sys.stdin.isatty():
|
33 |
response = input("Do you want to continue? (yes/no): ")
|
|
|
36 |
return False
|
37 |
return True
|
38 |
|
39 |
+
|
40 |
# Load environment variables
|
41 |
load_dotenv()
|
42 |
|
lightrag/utils.py
CHANGED
@@ -75,7 +75,12 @@ class LightragPathFilter(logging.Filter):
|
|
75 |
def __init__(self):
|
76 |
super().__init__()
|
77 |
# Define paths to be filtered
|
78 |
-
self.filtered_paths = [
|
|
|
|
|
|
|
|
|
|
|
79 |
# self.filtered_paths = ["/health", "/webui/"]
|
80 |
|
81 |
def filter(self, record):
|
|
|
75 |
def __init__(self):
|
76 |
super().__init__()
|
77 |
# Define paths to be filtered
|
78 |
+
self.filtered_paths = [
|
79 |
+
"/documents",
|
80 |
+
"/health",
|
81 |
+
"/webui/",
|
82 |
+
"/documents/pipeline_status",
|
83 |
+
]
|
84 |
# self.filtered_paths = ["/health", "/webui/"]
|
85 |
|
86 |
def filter(self, record):
|
lightrag_webui/src/features/DocumentManager.tsx
CHANGED
@@ -284,7 +284,7 @@ export default function DocumentManager() {
|
|
284 |
<div className="truncate">
|
285 |
{getDisplayFileName(doc, 35)}
|
286 |
</div>
|
287 |
-
<div className="invisible group-hover:visible
|
288 |
{doc.file_path}
|
289 |
</div>
|
290 |
</div>
|
@@ -295,7 +295,7 @@ export default function DocumentManager() {
|
|
295 |
<div className="truncate">
|
296 |
{doc.id}
|
297 |
</div>
|
298 |
-
<div className="invisible group-hover:visible
|
299 |
{doc.file_path}
|
300 |
</div>
|
301 |
</div>
|
@@ -306,7 +306,7 @@ export default function DocumentManager() {
|
|
306 |
<div className="truncate">
|
307 |
{doc.content_summary}
|
308 |
</div>
|
309 |
-
<div className="invisible group-hover:visible
|
310 |
{doc.content_summary}
|
311 |
</div>
|
312 |
</div>
|
|
|
284 |
<div className="truncate">
|
285 |
{getDisplayFileName(doc, 35)}
|
286 |
</div>
|
287 |
+
<div className="invisible group-hover:visible absolute z-[9999] mt-1 max-w-[800px] whitespace-normal break-all rounded-md bg-black/95 px-3 py-2 text-sm text-white shadow-lg dark:bg-white/95 dark:text-black">
|
288 |
{doc.file_path}
|
289 |
</div>
|
290 |
</div>
|
|
|
295 |
<div className="truncate">
|
296 |
{doc.id}
|
297 |
</div>
|
298 |
+
<div className="invisible group-hover:visible absolute z-[9999] mt-1 max-w-[800px] whitespace-normal break-all rounded-md bg-black/95 px-3 py-2 text-sm text-white shadow-lg dark:bg-white/95 dark:text-black">
|
299 |
{doc.file_path}
|
300 |
</div>
|
301 |
</div>
|
|
|
306 |
<div className="truncate">
|
307 |
{doc.content_summary}
|
308 |
</div>
|
309 |
+
<div className="invisible group-hover:visible absolute z-[9999] mt-1 max-w-[800px] whitespace-normal break-all rounded-md bg-black/95 px-3 py-2 text-sm text-white shadow-lg dark:bg-white/95 dark:text-black">
|
310 |
{doc.content_summary}
|
311 |
</div>
|
312 |
</div>
|