mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Support one-click enable/disable of all downloaded plugins https://github.com/siyuan-note/siyuan/issues/8523
This commit is contained in:
parent
1a3c0e7f42
commit
41cd90b771
4 changed files with 4 additions and 71 deletions
|
@ -61,29 +61,3 @@ func setPetalEnabled(c *gin.Context) {
|
|||
|
||||
ret.Data = data
|
||||
}
|
||||
|
||||
func setPetalConf(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
param, err := gulu.JSON.MarshalJSON(arg)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
conf := &model.PetalConf{}
|
||||
if err = gulu.JSON.UnmarshalJSON(param, conf); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
conf.Save()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue