An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: 重建索引改为后台任务 https://github.com/siyuan-note/siyuan/issues/7153
Liang Ding801bc69820d7
diff --git a/app/src/constants.ts b/app/src/constants.tsindex 8bcdc4aa3b..aa6ae865fa 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -89,12 +89,6 @@ export abstract class Constants {en_US: "20210808180117-6v0mkxr",fr_FR: "20210808180117-6v0mkxr",};- public static readonly HELP_START_PATH = {- zh_CN: "20200812220555-lj3enxa",- zh_CHT: "20211226115423-d5z1joq",- en_US: "20200923234011-ieuun1p",- fr_FR: "20200923234011-ieuun1p",- };public static readonly KEYCODE: { [key: string]: string[] } = {"186": [";", ":"],diff --git a/app/src/index.ts b/app/src/index.tsindex 4c4f3d03b5..e7f021fc92 100644--- a/app/src/index.ts+++ b/app/src/index.ts@@ -12,7 +12,8 @@ import {addBaseURL, setNoteBook} from "./util/pathName";import {openFileById} from "./editor/util";import {bootSync,- downloadProgress, processSync,+ downloadProgress,+ processSync,progressLoading,progressStatus,setTitle,@@ -114,6 +115,9 @@ class App {case "createdailynote":openFileById({id: data.data.id, action: [Constants.CB_GET_FOCUS]});break;+ case "openFileById":+ openFileById({id: data.data.id, action: [Constants.CB_GET_FOCUS]});+ break;}}}diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.tsindex 393be58306..8962ddad74 100644--- a/app/src/layout/dock/Files.ts+++ b/app/src/layout/dock/Files.ts@@ -734,12 +734,6 @@ export class Files extends Model {this.element.insertAdjacentHTML("afterbegin", html);}}- if (data.callback === Constants.CB_MOUNT_HELP) {- openFileById({- id: Constants.HELP_START_PATH[window.siyuan.config.appearance.lang as "zh_CN" | "en_US"],- action: [Constants.CB_GET_FOCUS]- });- }});}diff --git a/app/src/mobile/util/MobileFiles.ts b/app/src/mobile/util/MobileFiles.tsindex 48589424a7..3957fb157b 100644--- a/app/src/mobile/util/MobileFiles.ts+++ b/app/src/mobile/util/MobileFiles.ts@@ -569,9 +569,6 @@ export class MobileFiles extends Model {this.element.insertAdjacentHTML("afterbegin", html);}}- if (data.callback === Constants.CB_MOUNT_HELP) {- openMobileFileById(Constants.HELP_START_PATH[window.siyuan.config.appearance.lang as "zh_CN" | "en_US"]);- }});}diff --git a/app/src/mobile/util/onMessage.ts b/app/src/mobile/util/onMessage.tsindex cf0363ea77..4221c2b697 100644--- a/app/src/mobile/util/onMessage.ts+++ b/app/src/mobile/util/onMessage.ts@@ -1,5 +1,7 @@import {openMobileFileById} from "../editor";import {progressLoading, progressStatus, transactionError} from "../../dialog/processSystem";+import {openFileById} from "../../editor/util";+import {Constants} from "../../constants";export const onMessage = (data: IWebSocketData) => {if (data) {@@ -24,6 +26,9 @@ export const onMessage = (data: IWebSocketData) => {case "createdailynote":openMobileFileById(data.data.id);break;+ case "openFileById":+ openMobileFileById(data.data.id, [Constants.CB_GET_FOCUS]);+ break;case"txerr":transactionError(data);break;diff --git a/kernel/model/mount.go b/kernel/model/mount.goindex 4dbaf03447..1b7c6b74ab 100644--- a/kernel/model/mount.go+++ b/kernel/model/mount.go@@ -139,7 +139,6 @@ func Mount(boxID string) (alreadyMount bool, err error) {WaitForWritingFiles()localPath := filepath.Join(util.DataDir, boxID)-var reMountGuide boolif IsUserGuide(boxID) {// 重新挂载帮助文档@@ -200,6 +199,29 @@ func Mount(boxID string) (alreadyMount bool, err error) {ListDocTree(box.ID, "/", Conf.FileTree.Sort)treenode.SaveBlockTree(false)util.ClearPushProgress(100)++ if IsUserGuide(boxID) {+ go func() {+ var startID string+ i := 0+ for ; i < 70; i++ {+ time.Sleep(100 * time.Millisecond)+ guideStartID := map[string]string{+ "20210808180117-czj9bvb": "20200812220555-lj3enxa",+ "20211226090932-5lcq56f": "20211226115423-d5z1joq",+ "20210808180117-6v0mkxr": "20200923234011-ieuun1p",+ }+ startID = guideStartID[boxID]+ if nil != treenode.GetBlockTree(startID) {+ util.BroadcastByType("main", "openFileById", 0, "", map[string]interface{}{+ "id": startID,+ })+ break+ }+ }+ }()+ }+if reMountGuide {return true, nil}diff --git a/kernel/model/sync.go b/kernel/model/sync.goindex 5834ed9a79..54b47c358e 100644--- a/kernel/model/sync.go+++ b/kernel/model/sync.go@@ -293,7 +293,7 @@ func SetSyncGenerateConflictDoc(b bool) {return}-func SetSyncEnable(b bool) (err error) {+func SetSyncEnable(b bool) {Conf.Sync.Enabled = bConf.Save()return