🎨 One-click upgrade of downloaded marketplace packages https://github.com/siyuan-note/siyuan/issues/8390

This commit is contained in:
Daniel 2024-03-21 17:09:08 +08:00
parent c6319c3a0e
commit 055e011b3e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 4 additions and 4 deletions

View file

@ -25,7 +25,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func getBazaarPackages(c *gin.Context) {
func getUpdatedPackage(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
@ -35,7 +35,7 @@ func getBazaarPackages(c *gin.Context) {
}
frontend := arg["frontend"].(string)
plugins, widgets, icons, themes, templates := model.BazaarPackages(frontend)
plugins, widgets, icons, themes, templates := model.UpdatedPackages(frontend)
ret.Data = map[string]interface{}{
"plugins": plugins,
"widgets": widgets,

View file

@ -330,7 +330,7 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/graph/getGraph", model.CheckAuth, getGraph)
ginServer.Handle("POST", "/api/graph/getLocalGraph", model.CheckAuth, getLocalGraph)
ginServer.Handle("POST", "/api/bazaar/getBazaarPackages", model.CheckAuth, getBazaarPackages)
ginServer.Handle("POST", "/api/bazaar/getUpdatedPackage", model.CheckAuth, getUpdatedPackage)
ginServer.Handle("POST", "/api/bazaar/getBazaarPlugin", model.CheckAuth, getBazaarPlugin)
ginServer.Handle("POST", "/api/bazaar/getInstalledPlugin", model.CheckAuth, getInstalledPlugin)
ginServer.Handle("POST", "/api/bazaar/installBazaarPlugin", model.CheckAuth, model.CheckReadonly, installBazaarPlugin)

View file

@ -30,7 +30,7 @@ import (
"github.com/siyuan-note/siyuan/kernel/bazaar"
)
func BazaarPackages(frontend string) (plugins []*bazaar.Plugin, widgets []*bazaar.Widget, icons []*bazaar.Icon, themes []*bazaar.Theme, templates []*bazaar.Template) {
func UpdatedPackages(frontend string) (plugins []*bazaar.Plugin, widgets []*bazaar.Widget, icons []*bazaar.Icon, themes []*bazaar.Theme, templates []*bazaar.Template) {
wg := &sync.WaitGroup{}
wg.Add(5)
go func() {