Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/6178

Vanessac2c0794e484e
diff --git a/app/src/layout/dock/Backlink.ts b/app/src/layout/dock/Backlink.ts
index 0759462d55..fe0207f794 100644
--- a/app/src/layout/dock/Backlink.ts
+++ b/app/src/layout/dock/Backlink.ts
@@ -385,7 +385,8 @@ export class Backlink extends Model {
} else {
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
defID: this.blockId,
- refTreeID: docId
+ refTreeID: docId,
+ keyword: isMention ? this.inputsElement[1].value : this.inputsElement[0].value
}, (response) => {
svgElement.removeAttribute("disabled");
svgElement.classList.add("b3-list-item__arrow--open");
diff --git a/app/src/protyle/util/reload.ts b/app/src/protyle/util/reload.ts
index 75481051e3..ca976d71c9 100644
--- a/app/src/protyle/util/reload.ts
+++ b/app/src/protyle/util/reload.ts
@@ -4,6 +4,7 @@ import {Constants} from "../../constants";
import {onGet} from "./onGet";
import {saveScroll} from "../scroll/saveScroll";
import {renderBacklink} from "../wysiwyg/renderBacklink";
+import {hasClosestByClassName} from "./hasClosest";
export const reloadProtyle = (protyle: IProtyle) => {
if (window.siyuan.config.editor.displayBookmarkIcon) {
@@ -17,13 +18,18 @@ export const reloadProtyle = (protyle: IProtyle) => {
addLoading(protyle);
if (protyle.options.backlinkData) {
const isMention = protyle.element.getAttribute("data-ismention") === "true";
- fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
- defID: protyle.element.getAttribute("data-defid"),
- refTreeID: protyle.block.rootID
- }, response => {
- protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks,
- renderBacklink(protyle, protyle.options.backlinkData);
- });
+ const tabElement = hasClosestByClassName(protyle.element, "sy__backlink")
+ if (tabElement) {
+ const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>
+ fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
+ defID: protyle.element.getAttribute("data-defid"),
+ refTreeID: protyle.block.rootID,
+ keyword: isMention ? inputsElement[1].value : inputsElement[0].value
+ }, response => {
+ protyle.options.backlinkData = isMention ? response.data.backmentions : response.data.backlinks,
+ renderBacklink(protyle, protyle.options.backlinkData);
+ });
+ }
} else {
fetchPost("/api/filetree/getDoc", {
id: protyle.block.showAll ? protyle.block.id : protyle.block.rootID,