mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Mouse hover notebook to display some information https://github.com/siyuan-note/siyuan/issues/12615
This commit is contained in:
parent
5932b68ad8
commit
af73dc1130
3 changed files with 92 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue