mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 14:58:49 +01:00
🎨 Support listing for invalid block references in the search dialog https://github.com/siyuan-note/siyuan/issues/10396
This commit is contained in:
parent
892d166acf
commit
a02ed0b5cc
3 changed files with 164 additions and 0 deletions
|
|
@ -26,6 +26,40 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func listInvalidBlockRefs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
page := 1
|
||||
if nil != arg["page"] {
|
||||
page = int(arg["page"].(float64))
|
||||
}
|
||||
if 0 >= page {
|
||||
page = 1
|
||||
}
|
||||
|
||||
pageSize := 32
|
||||
if nil != arg["pageSize"] {
|
||||
pageSize = int(arg["pageSize"].(float64))
|
||||
}
|
||||
if 0 >= pageSize {
|
||||
pageSize = 32
|
||||
}
|
||||
|
||||
blocks, matchedBlockCount, matchedRootCount, pageCount := model.ListInvalidBlockRefs(page, pageSize)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blocks,
|
||||
"matchedBlockCount": matchedBlockCount,
|
||||
"matchedRootCount": matchedRootCount,
|
||||
"pageCount": pageCount,
|
||||
}
|
||||
}
|
||||
|
||||
func getAssetContent(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue