diff --git a/frontend/src/api/wiki/index.ts b/frontend/src/api/wiki/index.ts index 02855898..dd21e84d 100644 --- a/frontend/src/api/wiki/index.ts +++ b/frontend/src/api/wiki/index.ts @@ -326,7 +326,15 @@ export function getWikiGraph(kbId: string, params?: WikiGraphQueryParams) { } } const qs = query.toString(); - return get(`/api/v1/knowledgebase/${kbId}/wiki/graph${qs ? '?' + qs : ''}`); + return get(`/api/v1/knowledgebase/${kbId}/wiki/graph${qs ? '?' + qs : ''}`).then((res: any) => { + // Older backends serialize an edgeless subgraph as `"edges": null`. + const graph = res?.data || res; + if (graph && typeof graph === 'object') { + graph.nodes ??= []; + graph.edges ??= []; + } + return res; + }); } export function getWikiStats(kbId: string) { diff --git a/frontend/src/i18n/locales/en-US.ts b/frontend/src/i18n/locales/en-US.ts index a7c21325..3fbd8702 100755 --- a/frontend/src/i18n/locales/en-US.ts +++ b/frontend/src/i18n/locales/en-US.ts @@ -3626,6 +3626,16 @@ export default { helpZoomDesc: 'Zoom the canvas', neighborsProgress: 'Showing {visible} of {total} neighbors ({hidden} not loaded)', neighborsAllShown: 'All {total} neighbors are already on the canvas (click Expand to focus on this node’s subgraph)', + graphNavigationHint: 'Drag the canvas to pan · Scroll to zoom', + focusGroup: 'Focus this group', + focusGroupViewing: 'Viewing: {name}', + focusGroupBack: 'Back to full graph', + focusGroupSwitch: 'Switch to another group', + unlinkedHidden: '{count} unlinked pages hidden', + unlinkedSection: 'Unlinked pages · {count}', + offscreenSection: 'No visible connections (links exist) · {count}', + hideUnlinked: 'Hide unlinked pages ({count})', + showUnlinked: 'Show unlinked pages ({count})', neighborsNone: 'This page has no linked neighbors', neighborsCenterUnreachable: 'Showing {visible} of {total} neighbors ({hidden} unreachable: dead links, filtered, or deleted)', neighborsOverviewHidden: 'Showing {visible} of {total} neighbors ({hidden} outside the overview — click Expand to pivot here)', diff --git a/frontend/src/i18n/locales/ja-JP.ts b/frontend/src/i18n/locales/ja-JP.ts index 025fa341..da5a17a9 100644 --- a/frontend/src/i18n/locales/ja-JP.ts +++ b/frontend/src/i18n/locales/ja-JP.ts @@ -3626,6 +3626,16 @@ export default { helpZoomDesc: 'キャンバスを拡大・縮小', neighborsProgress: '{total}個の隣接ノードのうち{visible}個を表示中({hidden}個は未読み込み)', neighborsAllShown: '{total}個の隣接ノードはすべてキャンバス上にあります(「隣接ノードを展開」でこのノードのサブグラフに焦点を当てられます)', + graphNavigationHint: '背景をドラッグして移動 · スクロールでズーム', + focusGroup: 'このグループを表示', + focusGroupViewing: '表示中:{name}', + focusGroupBack: '全体に戻る', + focusGroupSwitch: '別のグループに切り替え', + unlinkedHidden: 'リンクのないページを {count} 件非表示', + unlinkedSection: 'リンクのないページ · {count}', + offscreenSection: '現在の表示内に接続なし(リンクあり)· {count}', + hideUnlinked: 'リンクのないページを非表示({count})', + showUnlinked: 'リンクのないページを表示({count})', neighborsNone: 'このページにリンクされた隣接ノードはありません', neighborsCenterUnreachable: '{total}個の隣接ノードのうち{visible}個を表示中({hidden}個は到達不可: リンク切れ、フィルタ対象外、または削除済み)', neighborsOverviewHidden: '{total}個の隣接ノードのうち{visible}個を表示中({hidden}個は概要の範囲外です。「展開」をクリックするとここを起点に表示できます)', diff --git a/frontend/src/i18n/locales/ko-KR.ts b/frontend/src/i18n/locales/ko-KR.ts index 504d289f..5f8e2d4d 100755 --- a/frontend/src/i18n/locales/ko-KR.ts +++ b/frontend/src/i18n/locales/ko-KR.ts @@ -4661,6 +4661,16 @@ export default { helpZoomDesc: '캔버스 확대/축소', neighborsProgress: '이웃 {visible}/{total} 표시됨 ({hidden}개 미로딩)', neighborsAllShown: '모든 {total}개 이웃이 이미 캔버스에 있습니다 (확장을 클릭하여 이 노드의 서브그래프에 집중)', + graphNavigationHint: '빈 공간을 드래그하여 이동 · 스크롤하여 확대/축소', + focusGroup: '이 그룹에 초점 맞추기', + focusGroupViewing: '보는 중: {name}', + focusGroupBack: '전체 그래프로 돌아가기', + focusGroupSwitch: '다른 그룹으로 전환', + unlinkedHidden: '연결 없는 페이지 {count}개 숨김', + unlinkedSection: '연결 없는 페이지 · {count}', + offscreenSection: '현재 화면에 연결 없음 (링크 있음) · {count}', + hideUnlinked: '연결 없는 페이지 숨기기 ({count})', + showUnlinked: '연결 없는 페이지 표시 ({count})', neighborsNone: '이 페이지에는 연결된 이웃이 없습니다', neighborsCenterUnreachable: '이웃 {visible}/{total} 표시됨 ({hidden}개 연결 불가: 끊긴 링크, 필터됨 또는 삭제됨)', neighborsOverviewHidden: '이웃 {visible}/{total} 표시됨 ({hidden}개는 개요 범위 밖 — 확장을 클릭하여 이곳으로 전환)', diff --git a/frontend/src/i18n/locales/ru-RU.ts b/frontend/src/i18n/locales/ru-RU.ts index a883c7d2..c00d7bbe 100755 --- a/frontend/src/i18n/locales/ru-RU.ts +++ b/frontend/src/i18n/locales/ru-RU.ts @@ -4661,6 +4661,16 @@ export default { helpZoomDesc: 'Масштабировать холст', neighborsProgress: 'Показано {visible} из {total} соседей (еще {hidden} не загружено)', neighborsAllShown: 'Все {total} соседей уже на холсте (нажмите «Развернуть», чтобы сфокусироваться на подграфе этого узла)', + graphNavigationHint: 'Перетаскивайте фон для перемещения · Прокручивайте для масштаба', + focusGroup: 'Показать эту группу', + focusGroupViewing: 'Просмотр: {name}', + focusGroupBack: 'Вернуться ко всему графу', + focusGroupSwitch: 'Перейти к другой группе', + unlinkedHidden: 'Скрыто страниц без связей: {count}', + unlinkedSection: 'Страницы без связей · {count}', + offscreenSection: 'Нет видимых связей (ссылки есть) · {count}', + hideUnlinked: 'Скрыть страницы без связей ({count})', + showUnlinked: 'Показать страницы без связей ({count})', neighborsNone: 'У этой страницы нет связанных соседей', neighborsCenterUnreachable: 'Показано {visible} из {total} соседей ({hidden} недоступны: мёртвые ссылки, отфильтрованы или удалены)', neighborsOverviewHidden: 'Показано {visible} из {total} соседей ({hidden} вне обзора — нажмите «Развернуть», чтобы переключиться сюда)', diff --git a/frontend/src/i18n/locales/zh-CN.ts b/frontend/src/i18n/locales/zh-CN.ts index c9b3fb52..ebcaff95 100755 --- a/frontend/src/i18n/locales/zh-CN.ts +++ b/frontend/src/i18n/locales/zh-CN.ts @@ -4663,6 +4663,16 @@ export default { helpZoomDesc: '缩放画布', neighborsProgress: '已显示邻居 {visible}/{total}(还有 {hidden} 个未加载)', neighborsAllShown: '全部 {total} 个邻居已在图中(可点"展开邻居"聚焦到该节点子图)', + graphNavigationHint: '拖拽空白处移动 · 滚轮缩放', + focusGroup: '聚焦这组页面', + focusGroupViewing: '正在查看:{name}', + focusGroupBack: '返回全图', + focusGroupSwitch: '切换到其他分组', + unlinkedHidden: '已隐藏 {count} 个无关联页面', + unlinkedSection: '无关联页面 · {count}', + offscreenSection: '当前视图无连线(存在链接)· {count}', + hideUnlinked: '隐藏无关联页面({count})', + showUnlinked: '显示无关联页面({count})', neighborsNone: '该节点没有链接邻居', neighborsCenterUnreachable: '已显示邻居 {visible}/{total}(还有 {hidden} 个无法连通:可能是死链、被过滤或已删除)', neighborsOverviewHidden: '已显示邻居 {visible}/{total}({hidden} 个不在概览范围,点"展开邻居"以此为中心查看)', diff --git a/frontend/src/i18n/locales/zh-TW.ts b/frontend/src/i18n/locales/zh-TW.ts index 8eff5293..276db598 100644 --- a/frontend/src/i18n/locales/zh-TW.ts +++ b/frontend/src/i18n/locales/zh-TW.ts @@ -4663,6 +4663,16 @@ export default { helpZoomDesc: '縮放畫布', neighborsProgress: '已顯示鄰居 {visible}/{total}(還有 {hidden} 個未載入)', neighborsAllShown: '全部 {total} 個鄰居已在圖中(可點"展開鄰居"聚焦到該節點子圖)', + graphNavigationHint: '拖曳空白處移動 · 滾輪縮放', + focusGroup: '聚焦這組頁面', + focusGroupViewing: '正在查看:{name}', + focusGroupBack: '返回全圖', + focusGroupSwitch: '切換到其他分組', + unlinkedHidden: '已隱藏 {count} 個無關聯頁面', + unlinkedSection: '無關聯頁面 · {count}', + offscreenSection: '目前視圖無連線(存在連結)· {count}', + hideUnlinked: '隱藏無關聯頁面({count})', + showUnlinked: '顯示無關聯頁面({count})', neighborsNone: '該節點沒有連結鄰居', neighborsCenterUnreachable: '已顯示鄰居 {visible}/{total}(還有 {hidden} 個無法連通:可能是死鏈、被篩選或已刪除)', neighborsOverviewHidden: '已顯示鄰居 {visible}/{total}({hidden} 個不在概覽範圍,點"展開鄰居"以此為中心查看)', diff --git a/frontend/src/views/knowledge/wiki/WikiBrowser.vue b/frontend/src/views/knowledge/wiki/WikiBrowser.vue index 1d0f65b7..9b0bdc76 100644 --- a/frontend/src/views/knowledge/wiki/WikiBrowser.vue +++ b/frontend/src/views/knowledge/wiki/WikiBrowser.vue @@ -5,8 +5,31 @@
+
+ {{ $t('knowledgeEditor.wikiBrowser.graphNavigationHint') }} +
+ +
+ + + + + {{ $t('knowledgeEditor.wikiBrowser.focusGroupViewing', { name: graphFocusGroup.name }) }} + + +
+ -
+