Merge pull request #1272 from danielaskdd/main
Fix <div> in <p> problem and keep graph query label after 401 error for post-login data reload
This commit is contained in:
File diff suppressed because one or more lines are too long
2
lightrag/api/webui/index.html
generated
2
lightrag/api/webui/index.html
generated
@@ -8,7 +8,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="logo.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Lightrag</title>
|
||||
<script type="module" crossorigin src="/webui/assets/index-Cb_7ABt2.js"></script>
|
||||
<script type="module" crossorigin src="/webui/assets/index-D4h_QQ3K.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/webui/assets/index-f0HMqdqP.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@@ -103,15 +103,17 @@ export default function ClearDocumentsDialog({ onDocumentsCleared }: ClearDocume
|
||||
{t('documentPanel.clearDocuments.title')}
|
||||
</DialogTitle>
|
||||
<DialogDescription className="pt-2">
|
||||
<div className="text-red-500 dark:text-red-400 font-semibold mb-4">
|
||||
{t('documentPanel.clearDocuments.warning')}
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
{t('documentPanel.clearDocuments.confirm')}
|
||||
</div>
|
||||
{t('documentPanel.clearDocuments.description')}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="text-red-500 dark:text-red-400 font-semibold mb-4">
|
||||
{t('documentPanel.clearDocuments.warning')}
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
{t('documentPanel.clearDocuments.confirm')}
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="confirm-text" className="text-sm font-medium">
|
||||
|
@@ -342,15 +342,23 @@ const useLightrangeGraph = () => {
|
||||
// Still mark graph as empty for other logic
|
||||
state.setGraphIsEmpty(true);
|
||||
|
||||
// Only clear current label if it's not already empty
|
||||
if (currentQueryLabel) {
|
||||
// Check if the empty graph is due to 401 authentication error
|
||||
const errorMessage = useBackendState.getState().message;
|
||||
const isAuthError = errorMessage && errorMessage.includes('Authentication required');
|
||||
|
||||
// Only clear queryLabel if it's not an auth error and current label is not empty
|
||||
if (!isAuthError && currentQueryLabel) {
|
||||
useSettingsStore.getState().setQueryLabel('');
|
||||
}
|
||||
|
||||
// Clear last successful query label to ensure labels are fetched next time
|
||||
state.setLastSuccessfulQueryLabel('');
|
||||
// Only clear last successful query label if it's not an auth error
|
||||
if (!isAuthError) {
|
||||
state.setLastSuccessfulQueryLabel('');
|
||||
} else {
|
||||
console.log('Keep queryLabel for post-login reload');
|
||||
}
|
||||
|
||||
console.log('Graph data is empty, created graph with empty graph node');
|
||||
console.log(`Graph data is empty, created graph with empty graph node. Auth error: ${isAuthError}`);
|
||||
} else {
|
||||
// Create and set new graph
|
||||
const newSigmaGraph = createSigmaGraph(data);
|
||||
|
@@ -40,6 +40,7 @@
|
||||
"button": "مسح",
|
||||
"tooltip": "مسح المستندات",
|
||||
"title": "مسح المستندات",
|
||||
"description": "سيؤدي هذا إلى إزالة جميع المستندات من النظام",
|
||||
"warning": "تحذير: سيؤدي هذا الإجراء إلى حذف جميع المستندات بشكل دائم ولا يمكن التراجع عنه!",
|
||||
"confirm": "هل تريد حقًا مسح جميع المستندات؟",
|
||||
"confirmPrompt": "اكتب 'yes' لتأكيد هذا الإجراء",
|
||||
|
@@ -40,6 +40,7 @@
|
||||
"button": "Clear",
|
||||
"tooltip": "Clear documents",
|
||||
"title": "Clear Documents",
|
||||
"description": "This will remove all documents from the system",
|
||||
"warning": "WARNING: This action will permanently delete all documents and cannot be undone!",
|
||||
"confirm": "Do you really want to clear all documents?",
|
||||
"confirmPrompt": "Type 'yes' to confirm this action",
|
||||
|
@@ -40,6 +40,7 @@
|
||||
"button": "Effacer",
|
||||
"tooltip": "Effacer les documents",
|
||||
"title": "Effacer les documents",
|
||||
"description": "Cette action supprimera tous les documents du système",
|
||||
"warning": "ATTENTION : Cette action supprimera définitivement tous les documents et ne peut pas être annulée !",
|
||||
"confirm": "Voulez-vous vraiment effacer tous les documents ?",
|
||||
"confirmPrompt": "Tapez 'yes' pour confirmer cette action",
|
||||
|
@@ -40,6 +40,7 @@
|
||||
"button": "清空",
|
||||
"tooltip": "清空文档",
|
||||
"title": "清空文档",
|
||||
"description": "此操作将从系统中移除所有文档",
|
||||
"warning": "警告:此操作将永久删除所有文档,无法恢复!",
|
||||
"confirm": "确定要清空所有文档吗?",
|
||||
"confirmPrompt": "请输入 yes 确认操作",
|
||||
|
@@ -32,7 +32,7 @@ class NavigationService {
|
||||
// Reset backend state
|
||||
useBackendState.getState().clear();
|
||||
|
||||
// Reset retrieval history while preserving other user preferences
|
||||
// Reset retrieval history message while preserving other user preferences
|
||||
useSettingsStore.getState().setRetrievalHistory([]);
|
||||
|
||||
// Clear authentication state
|
||||
|
Reference in New Issue
Block a user