yangdx
commited on
Commit
·
aa6b11a
1
Parent(s):
235ca57
Fix linting
Browse files
lightrag/api/lightrag_server.py
CHANGED
@@ -423,7 +423,7 @@ def create_app(args):
|
|
423 |
"""Get current system status"""
|
424 |
try:
|
425 |
pipeline_status = await get_namespace_data("pipeline_status")
|
426 |
-
|
427 |
username = os.getenv("AUTH_USERNAME")
|
428 |
password = os.getenv("AUTH_PASSWORD")
|
429 |
if not (username and password):
|
@@ -454,7 +454,7 @@ def create_app(args):
|
|
454 |
"core_version": core_version,
|
455 |
"api_version": __api_version__,
|
456 |
"auth_mode": auth_mode,
|
457 |
-
"pipeline_busy": pipeline_status.get("busy", False)
|
458 |
}
|
459 |
except Exception as e:
|
460 |
logger.error(f"Error getting health status: {str(e)}")
|
|
|
423 |
"""Get current system status"""
|
424 |
try:
|
425 |
pipeline_status = await get_namespace_data("pipeline_status")
|
426 |
+
|
427 |
username = os.getenv("AUTH_USERNAME")
|
428 |
password = os.getenv("AUTH_PASSWORD")
|
429 |
if not (username and password):
|
|
|
454 |
"core_version": core_version,
|
455 |
"api_version": __api_version__,
|
456 |
"auth_mode": auth_mode,
|
457 |
+
"pipeline_busy": pipeline_status.get("busy", False),
|
458 |
}
|
459 |
except Exception as e:
|
460 |
logger.error(f"Error getting health status: {str(e)}")
|
lightrag/lightrag.py
CHANGED
@@ -892,7 +892,9 @@ class LightRAG:
|
|
892 |
# Get first document's file path and total count for job name
|
893 |
first_doc_id, first_doc = next(iter(to_process_docs.items()))
|
894 |
first_doc_path = first_doc.file_path
|
895 |
-
path_prefix = first_doc_path[:20] + (
|
|
|
|
|
896 |
total_files = len(to_process_docs)
|
897 |
job_name = f"{path_prefix}[{total_files} files]"
|
898 |
pipeline_status["job_name"] = job_name
|
|
|
892 |
# Get first document's file path and total count for job name
|
893 |
first_doc_id, first_doc = next(iter(to_process_docs.items()))
|
894 |
first_doc_path = first_doc.file_path
|
895 |
+
path_prefix = first_doc_path[:20] + (
|
896 |
+
"..." if len(first_doc_path) > 20 else ""
|
897 |
+
)
|
898 |
total_files = len(to_process_docs)
|
899 |
job_name = f"{path_prefix}[{total_files} files]"
|
900 |
pipeline_status["job_name"] = job_name
|
lightrag_webui/src/components/documents/PipelineStatusDialog.tsx
CHANGED
@@ -55,7 +55,7 @@ export default function PipelineStatusDialog({
|
|
55 |
const isAtBottom = Math.abs(
|
56 |
(container.scrollHeight - container.scrollTop) - container.clientHeight
|
57 |
) < 1
|
58 |
-
|
59 |
if (isAtBottom) {
|
60 |
setIsUserScrolled(false)
|
61 |
} else {
|
@@ -92,7 +92,7 @@ export default function PipelineStatusDialog({
|
|
92 |
)}
|
93 |
>
|
94 |
<DialogDescription className="sr-only">
|
95 |
-
{status?.job_name
|
96 |
? `${t('documentPanel.pipelineStatus.jobName')}: ${status.job_name}, ${t('documentPanel.pipelineStatus.progress')}: ${status.cur_batch}/${status.batchs}`
|
97 |
: t('documentPanel.pipelineStatus.noActiveJob')
|
98 |
}
|
@@ -101,7 +101,7 @@ export default function PipelineStatusDialog({
|
|
101 |
<DialogTitle className="flex-1">
|
102 |
{t('documentPanel.pipelineStatus.title')}
|
103 |
</DialogTitle>
|
104 |
-
|
105 |
{/* Position control buttons */}
|
106 |
<div className="flex items-center gap-2 mr-8">
|
107 |
<Button
|
@@ -174,7 +174,7 @@ export default function PipelineStatusDialog({
|
|
174 |
{/* History Messages */}
|
175 |
<div className="space-y-2">
|
176 |
<div className="text-sm font-medium">{t('documentPanel.pipelineStatus.historyMessages')}:</div>
|
177 |
-
<div
|
178 |
ref={historyRef}
|
179 |
onScroll={handleScroll}
|
180 |
className="font-mono text-sm rounded-md bg-zinc-800 text-zinc-100 p-3 overflow-y-auto min-h-[7.5em] max-h-[40vh]"
|
|
|
55 |
const isAtBottom = Math.abs(
|
56 |
(container.scrollHeight - container.scrollTop) - container.clientHeight
|
57 |
) < 1
|
58 |
+
|
59 |
if (isAtBottom) {
|
60 |
setIsUserScrolled(false)
|
61 |
} else {
|
|
|
92 |
)}
|
93 |
>
|
94 |
<DialogDescription className="sr-only">
|
95 |
+
{status?.job_name
|
96 |
? `${t('documentPanel.pipelineStatus.jobName')}: ${status.job_name}, ${t('documentPanel.pipelineStatus.progress')}: ${status.cur_batch}/${status.batchs}`
|
97 |
: t('documentPanel.pipelineStatus.noActiveJob')
|
98 |
}
|
|
|
101 |
<DialogTitle className="flex-1">
|
102 |
{t('documentPanel.pipelineStatus.title')}
|
103 |
</DialogTitle>
|
104 |
+
|
105 |
{/* Position control buttons */}
|
106 |
<div className="flex items-center gap-2 mr-8">
|
107 |
<Button
|
|
|
174 |
{/* History Messages */}
|
175 |
<div className="space-y-2">
|
176 |
<div className="text-sm font-medium">{t('documentPanel.pipelineStatus.historyMessages')}:</div>
|
177 |
+
<div
|
178 |
ref={historyRef}
|
179 |
onScroll={handleScroll}
|
180 |
className="font-mono text-sm rounded-md bg-zinc-800 text-zinc-100 p-3 overflow-y-auto min-h-[7.5em] max-h-[40vh]"
|
lightrag_webui/src/features/DocumentManager.tsx
CHANGED
@@ -118,7 +118,7 @@ export default function DocumentManager() {
|
|
118 |
const fetchDocuments = useCallback(async () => {
|
119 |
try {
|
120 |
const docs = await getDocuments()
|
121 |
-
|
122 |
// Get new status counts (treat null as all zeros)
|
123 |
const newStatusCounts = {
|
124 |
processed: docs?.statuses?.processed?.length || 0,
|
|
|
118 |
const fetchDocuments = useCallback(async () => {
|
119 |
try {
|
120 |
const docs = await getDocuments()
|
121 |
+
|
122 |
// Get new status counts (treat null as all zeros)
|
123 |
const newStatusCounts = {
|
124 |
processed: docs?.statuses?.processed?.length || 0,
|