5050 <GraphCanvas
5151 ref =" graphRef"
5252 :graph-data =" graph.graphData"
53+ :graph-info =" formattedGraphInfo"
5354 :highlight-keywords =" [state.searchInput]"
5455 @node-click =" graph.handleNodeClick"
5556 @edge-click =" graph.handleEdgeClick"
9495 <template #content >
9596 <a-empty v-show =" graph.graphData.nodes.length === 0" style =" padding : 4rem 0 ;" />
9697 </template >
97- <template #bottom >
98- <div class =" footer" >
99- <GraphInfoPanel
100- v-if =" isNeo4j"
101- :graph-info =" graphInfo"
102- :graph-data =" graph.graphData"
103- :unindexed-count =" unindexedCount"
104- :model-matched =" modelMatched"
105- @index-nodes =" indexNodes"
106- />
107- <LightRAGInfoPanel
108- v-else
109- :stats =" state.lightragStats"
110- :graph-data =" graph.graphData"
111- :database-name =" getDatabaseName()"
112- />
113- </div >
114- </template >
11598 </GraphCanvas >
11699 <!-- 详情浮动卡片 -->
117100 <GraphDetailPanel
125108 </div >
126109
127110 <a-modal
128- :open =" state.showModal" title =" 上传文件"
129- @ok =" addDocumentByFile"
130- @cancel =" handleModalCancel"
131- ok-text =" 添加到图数据库" cancel-text =" 取消"
132- :confirm-loading =" state.processing"
133- :ok-button-props =" { disabled: !hasValidFile }" >
111+ :open =" state.showModal" title =" 上传文件"
112+ @ok =" addDocumentByFile"
113+ @cancel =" handleModalCancel"
114+ ok-text =" 添加到图数据库" cancel-text =" 取消"
115+ :confirm-loading =" state.processing"
116+ :ok-button-props =" { disabled: !hasValidFile }" >
134117 <div class =" upload" >
135118 <div class =" note" >
136119 <p >上传的文件内容参考 test/data/A_Dream_of_Red_Mansions_tiny.jsonl 中的格式:</p >
@@ -193,8 +176,6 @@ import HeaderComponent from '@/components/HeaderComponent.vue';
193176import { neo4jApi , unifiedApi } from ' @/apis/graph_api' ;
194177import { useUserStore } from ' @/stores/user' ;
195178import GraphCanvas from ' @/components/GraphCanvas.vue' ;
196- import GraphInfoPanel from ' @/components/GraphInfoPanel.vue' ;
197- import LightRAGInfoPanel from ' @/components/LightRAGInfoPanel.vue' ;
198179import GraphDetailPanel from ' @/components/GraphDetailPanel.vue' ;
199180import UploadModal from ' @/components/FileUploadModal.vue' ;
200181import { useGraph } from ' @/composables/useGraph' ;
@@ -228,13 +209,6 @@ const state = reactive({
228209})
229210
230211const isNeo4j = computed (() => {
231- // 当 selectedDbId 是 'neo4j' 时,或者以 'kb_' 开头时,我们认为它是 Neo4j 驱动的
232- // 但是对于 kb_ 开头的,我们可能想要使用 LightRAGInfoPanel 的展示风格(因为它有 stats)
233- // 或者复用 GraphInfoPanel。
234- // GraphInfoPanel 是为 'neo4j' 全局图设计的,包含了 model matching 检查等。
235- // KBs (kb_*) 使用 Neo4j 存储,但逻辑上更接近 LightRAG 的"知识库"概念。
236- // 为了让 LightRAGInfoPanel 能够展示 stats (get_stats 已经更新支持 kb_),
237- // 我们这里让 kb_ ID 返回 false,这样会进入 LightRAGInfoPanel 分支。
238212 return state .selectedDbId === ' neo4j' ;
239213});
240214
@@ -248,6 +222,20 @@ const unindexedCount = computed(() => {
248222 return graphInfo .value ? .unindexed_node_count || 0 ;
249223});
250224
225+ const formattedGraphInfo = computed (() => {
226+ if (isNeo4j .value ) {
227+ return {
228+ node_count: graphInfo .value ? .entity_count || 0 ,
229+ edge_count: graphInfo .value ? .relationship_count || 0
230+ }
231+ } else {
232+ return {
233+ node_count: state .lightragStats ? .total_nodes || 0 ,
234+ edge_count: state .lightragStats ? .total_edges || 0
235+ }
236+ }
237+ })
238+
251239const loadDatabases = async () => {
252240 state .loadingDatabases = true ;
253241 try {
@@ -636,8 +624,7 @@ const goToDatabasePage = () => {
636624 overflow: hidden;
637625 background: var(--gray-10);
638626
639- .actions,
640- .footer {
627+ .actions {
641628 display: flex;
642629 justify-content: space-between;
643630 margin: 20px 0;
0 commit comments