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

This commit is contained in:
Daniel 2024-03-08 10:39:14 +08:00
parent b7e3e5fd8d
commit 58b76e8926
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 14 additions and 0 deletions

View file

@ -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)

View file

@ -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)