mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Support search installed plugins https://github.com/siyuan-note/siyuan/issues/9577
This commit is contained in:
parent
cf8e748260
commit
5fd8cb121b
2 changed files with 52 additions and 8 deletions
|
|
@ -155,8 +155,18 @@ func getInstalledWidget(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
var keyword string
|
||||
if keywordArg := arg["keyword"]; nil != keywordArg {
|
||||
keyword = keywordArg.(string)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.InstalledWidgets(),
|
||||
"packages": model.InstalledWidgets(keyword),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -230,8 +240,18 @@ func getInstalledIcon(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
var keyword string
|
||||
if keywordArg := arg["keyword"]; nil != keywordArg {
|
||||
keyword = keywordArg.(string)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.InstalledIcons(),
|
||||
"packages": model.InstalledIcons(keyword),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -307,8 +327,18 @@ func getInstalledTemplate(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
var keyword string
|
||||
if keywordArg := arg["keyword"]; nil != keywordArg {
|
||||
keyword = keywordArg.(string)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.InstalledTemplates(),
|
||||
"packages": model.InstalledTemplates(keyword),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -383,8 +413,18 @@ func getInstalledTheme(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
var keyword string
|
||||
if keywordArg := arg["keyword"]; nil != keywordArg {
|
||||
keyword = keywordArg.(string)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.InstalledThemes(),
|
||||
"packages": model.InstalledThemes(keyword),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue