Skip to content

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

:art: Support listing database mirror blocks in a floating window https://github.com/siyuan-note/siyuan/issues/10538

Daniel58b76e892651
diff --git a/kernel/api/av.go b/kernel/api/av.go
index a875428daa..0a036c8e02 100644
--- a/kernel/api/av.go
+++ b/kernel/api/av.go
@@ -26,6 +26,19 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
+func getMirrorDatabaseBlocks(c *gin.Context) {
+ ret := gulu.Ret.NewResult()
+ defer c.JSON(http.StatusOK, ret)
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ avID := arg["avID"].(string)
+ ret.Data = av.GetMirrorBlockIDs(avID)
+}
+
func searchTableView(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
diff --git a/kernel/api/router.go b/kernel/api/router.go
index 61e048f113..0b1d5490e0 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -414,6 +414,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/av/getAttributeViewPrimaryKeyValues", model.CheckAuth, model.CheckReadonly, getAttributeViewPrimaryKeyValues)
ginServer.Handle("POST", "/api/av/setDatabaseBlockView", model.CheckAuth, model.CheckReadonly, setDatabaseBlockView)
ginServer.Handle("POST", "/api/av/searchTableView", model.CheckAuth, model.CheckReadonly, searchTableView)
+ ginServer.Handle("POST", "/api/av/getMirrorDatabaseBlocks", model.CheckAuth, model.CheckReadonly, getMirrorDatabaseBlocks)
ginServer.Handle("POST", "/api/ai/chatGPT", model.CheckAuth, chatGPT)
ginServer.Handle("POST", "/api/ai/chatGPTWithAction", model.CheckAuth, chatGPTWithAction)