mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Support search installed plugins https://github.com/siyuan-note/siyuan/issues/9577
This commit is contained in:
parent
50b2cef690
commit
a952fd7e83
2 changed files with 7 additions and 3 deletions
|
|
@ -72,9 +72,13 @@ func getInstalledPlugin(c *gin.Context) {
|
|||
}
|
||||
|
||||
frontend := arg["frontend"].(string)
|
||||
var keyword string
|
||||
if keywordArg := arg["keyword"]; nil != keywordArg {
|
||||
keyword = keywordArg.(string)
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"packages": model.InstalledPlugins(frontend),
|
||||
"packages": model.InstalledPlugins(frontend, keyword),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ func filterPlugins(plugins []*bazaar.Plugin, keyword string) (ret []*bazaar.Plug
|
|||
return
|
||||
}
|
||||
|
||||
func InstalledPlugins(frontend string) (plugins []*bazaar.Plugin) {
|
||||
func InstalledPlugins(frontend, keyword string) (plugins []*bazaar.Plugin) {
|
||||
plugins = bazaar.InstalledPlugins(frontend, true)
|
||||
|
||||
plugins = filterPlugins(plugins, keyword)
|
||||
petals := getPetals()
|
||||
for _, plugin := range plugins {
|
||||
petal := getPetalByName(plugin.Name, petals)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue