mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-27 10:46:09 +01:00
🎨 集市支持已安装的包单独显示 https://github.com/siyuan-note/siyuan/issues/5678
This commit is contained in:
parent
29021c8d02
commit
74b73d02bc
5 changed files with 59 additions and 68 deletions
|
|
@ -59,27 +59,13 @@ type Template struct {
|
|||
|
||||
func Templates() (templates []*Template) {
|
||||
templates = []*Template{}
|
||||
result, err := util.GetRhyResult(false)
|
||||
|
||||
pkgIndex, err := getPkgIndex("templates")
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
bazaarIndex := getBazaarIndex()
|
||||
bazaarHash := result["bazaar"].(string)
|
||||
result = map[string]interface{}{}
|
||||
request := httpclient.NewBrowserRequest()
|
||||
u := util.BazaarOSSServer + "/bazaar@" + bazaarHash + "/stage/templates.json"
|
||||
resp, reqErr := request.SetResult(&result).Get(u)
|
||||
if nil != reqErr {
|
||||
logging.LogErrorf("get community stage index [%s] failed: %s", u, reqErr)
|
||||
return
|
||||
}
|
||||
if 200 != resp.StatusCode {
|
||||
logging.LogErrorf("get community stage index [%s] failed: %d", u, resp.StatusCode)
|
||||
return
|
||||
}
|
||||
|
||||
repos := result["repos"].([]interface{})
|
||||
repos := pkgIndex["repos"].([]interface{})
|
||||
waitGroup := &sync.WaitGroup{}
|
||||
lock := &sync.Mutex{}
|
||||
p, _ := ants.NewPoolWithFunc(2, func(arg interface{}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue