diff --git a/web/src/components/GraphCanvas.vue b/web/src/components/GraphCanvas.vue index 95be6686..cf74fdad 100644 --- a/web/src/components/GraphCanvas.vue +++ b/web/src/components/GraphCanvas.vue @@ -8,6 +8,19 @@
上传的文件内容参考 test/data/A_Dream_of_Red_Mansions_tiny.jsonl 中的格式:
@@ -193,8 +176,6 @@ import HeaderComponent from '@/components/HeaderComponent.vue'; import { neo4jApi, unifiedApi } from '@/apis/graph_api'; import { useUserStore } from '@/stores/user'; import GraphCanvas from '@/components/GraphCanvas.vue'; -import GraphInfoPanel from '@/components/GraphInfoPanel.vue'; -import LightRAGInfoPanel from '@/components/LightRAGInfoPanel.vue'; import GraphDetailPanel from '@/components/GraphDetailPanel.vue'; import UploadModal from '@/components/FileUploadModal.vue'; import { useGraph } from '@/composables/useGraph'; @@ -228,13 +209,6 @@ const state = reactive({ }) const isNeo4j = computed(() => { - // 当 selectedDbId 是 'neo4j' 时,或者以 'kb_' 开头时,我们认为它是 Neo4j 驱动的 - // 但是对于 kb_ 开头的,我们可能想要使用 LightRAGInfoPanel 的展示风格(因为它有 stats) - // 或者复用 GraphInfoPanel。 - // GraphInfoPanel 是为 'neo4j' 全局图设计的,包含了 model matching 检查等。 - // KBs (kb_*) 使用 Neo4j 存储,但逻辑上更接近 LightRAG 的"知识库"概念。 - // 为了让 LightRAGInfoPanel 能够展示 stats (get_stats 已经更新支持 kb_), - // 我们这里让 kb_ ID 返回 false,这样会进入 LightRAGInfoPanel 分支。 return state.selectedDbId === 'neo4j'; }); @@ -248,6 +222,20 @@ const unindexedCount = computed(() => { return graphInfo.value?.unindexed_node_count || 0; }); +const formattedGraphInfo = computed(() => { + if (isNeo4j.value) { + return { + node_count: graphInfo.value?.entity_count || 0, + edge_count: graphInfo.value?.relationship_count || 0 + } + } else { + return { + node_count: state.lightragStats?.total_nodes || 0, + edge_count: state.lightragStats?.total_edges || 0 + } + } +}) + const loadDatabases = async () => { state.loadingDatabases = true; try { @@ -636,8 +624,7 @@ const goToDatabasePage = () => { overflow: hidden; background: var(--gray-10); - .actions, - .footer { + .actions { display: flex; justify-content: space-between; margin: 20px 0;