mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Add plugin config items backends and frontends https://github.com/siyuan-note/siyuan/issues/8386
This commit is contained in:
parent
ec0682358f
commit
02b62eba65
10 changed files with 93 additions and 23 deletions
|
|
@ -46,8 +46,15 @@ func getBazaarPlugin(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
frontend := arg["frontend"].(string)
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.BazaarPlugins(),
|
||||
"packages": model.BazaarPlugins(frontend),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -55,8 +62,15 @@ func getInstalledPlugin(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
frontend := arg["frontend"].(string)
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.InstalledPlugins(),
|
||||
"packages": model.InstalledPlugins(frontend),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,9 +93,11 @@ func installBazaarPlugin(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
frontend := arg["frontend"].(string)
|
||||
|
||||
util.PushMsg(model.Conf.Language(69), 3000)
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.BazaarPlugins(),
|
||||
"packages": model.BazaarPlugins(frontend),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -102,8 +118,10 @@ func uninstallBazaarPlugin(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
frontend := arg["frontend"].(string)
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.BazaarPlugins(),
|
||||
"packages": model.BazaarPlugins(frontend),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue