mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Init plugin system https://github.com/siyuan-note/siyuan/issues/8041
This commit is contained in:
parent
5a6db7fdb4
commit
109462a22f
4 changed files with 60 additions and 2 deletions
|
|
@ -22,6 +22,7 @@ import (
|
|||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func loadPetals(c *gin.Context) {
|
||||
|
|
@ -31,3 +32,17 @@ func loadPetals(c *gin.Context) {
|
|||
petals := model.LoadPetals()
|
||||
ret.Data = petals
|
||||
}
|
||||
|
||||
func setPetalEnabled(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
packageName := arg["packageName"].(string)
|
||||
enabled := arg["enabled"].(bool)
|
||||
model.SetPetalEnabled(packageName, enabled)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue