🎨 Mouse hover notebook to display some information https://github.com/siyuan-note/siyuan/issues/12615

This commit is contained in:
Daniel 2024-09-28 16:36:28 +08:00
parent 5932b68ad8
commit af73dc1130
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 92 additions and 2 deletions

View file

@ -28,6 +28,33 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func getNotebookInfo(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
boxID := arg["notebook"].(string)
if util.InvalidIDPattern(boxID, ret) {
return
}
box := model.Conf.Box(boxID)
if nil == box {
ret.Code = -1
ret.Msg = "notebook [" + boxID + "] not found"
return
}
boxInfo := box.GetInfo()
ret.Data = map[string]interface{}{
"boxInfo": boxInfo,
}
}
func setNotebookIcon(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)