An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: 反链面板
Liang Ding667e0d3f747a
diff --git a/kernel/api/ref.go b/kernel/api/ref.goindex 89c2df0fef..53d9267a9a 100644--- a/kernel/api/ref.go+++ b/kernel/api/ref.go@@ -49,9 +49,9 @@ func getBacklinkDoc(c *gin.Context) {defID := arg["defID"].(string)refTreeID := arg["refTreeID"].(string)- doms := model.GetBacklinkDoc(defID, refTreeID)+ backlinks := model.GetBacklinkDoc(defID, refTreeID)ret.Data = map[string]interface{}{- "doms": doms,+ "backlinks": backlinks,}}diff --git a/kernel/model/backlink.go b/kernel/model/backlink.goindex 2c41214572..23e52365af 100644--- a/kernel/model/backlink.go+++ b/kernel/model/backlink.go@@ -158,8 +158,13 @@ OK:return}-func GetBacklinkDoc(defID, refTreeID string) (ret []string) {- ret = []string{}+type Backlink struct {+ DOM string `json:"dom"`+ BlockPaths []*BlockPath `json:"blockPaths"`+}++func GetBacklinkDoc(defID, refTreeID string) (ret []*Backlink) {+ ret = []*Backlink{}keyword := ""beforeLen := 12sqlBlock := sql.GetBlock(defID)@@ -279,7 +284,10 @@ func GetBacklinkDoc(defID, refTreeID string) (ret []string) {for _, c := range link.Children {n := treenode.GetNodeInTree(refTree, c.ID)dom := lute.RenderNodeBlockDOM(n, luteEngine.ParseOptions, luteEngine.RenderOptions)- ret = append(ret, dom)+ ret = append(ret, &Backlink{+ DOM: dom,+ BlockPaths: buildBlockBreadcrumb(n),+ })}}return