From c17e3bd36e29c2b79a3d4d4276098be94cf5dfcb Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 10 May 2022 15:07:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/home.go | 34 ++++++++++++++++++++++++++++++++++ routers/routes/routes.go | 1 + 2 files changed, 35 insertions(+) diff --git a/routers/home.go b/routers/home.go index 4fa0e42bb..651f73a9a 100755 --- a/routers/home.go +++ b/routers/home.go @@ -642,6 +642,31 @@ func GetRecommendOrg() ([]map[string]interface{}, error) { return resultOrg, nil } +func GetImageInfo() ([]map[string]interface{}, error) { + url := setting.RecommentRepoAddr + "picture_info" + result, err := repository.RecommendFromPromote(url) + + if err != nil { + return nil, err + } + imageInfo := make([]map[string]interface{}, 0) + for i := 0; i < (len(result) - 1); i++ { + line := result[i] + imageMap := make(map[string]interface{}) + if line[0:4] == "url=" { + url := line[4:] + imageMap["url"] = url + if result[i+1][0:11] == "image_link=" { + image_link := result[i+1][11:] + imageMap["image_link"] = image_link + } + } + imageInfo = append(imageInfo, imageMap) + i = i + 1 + } + return imageInfo, nil +} + func GetRankUser(index string) ([]map[string]interface{}, error) { url := setting.RecommentRepoAddr + "user_rank_" + index result, err := repository.RecommendFromPromote(url) @@ -680,6 +705,15 @@ func GetRankUser(index string) ([]map[string]interface{}, error) { return resultOrg, nil } +func GetImageInfoFromPromote(ctx *context.Context) { + imageInfo, err := GetImageInfo() + if err != nil { + ctx.ServerError("500", err) + return + } + ctx.JSON(200, imageInfo) +} + func GetUserRankFromPromote(ctx *context.Context) { index := ctx.Params("index") resultUserRank, err := GetRankUser(index) diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 2ce32ea90..1e1a862ff 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -326,6 +326,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/recommend/org", routers.RecommendOrgFromPromote) m.Get("/recommend/repo", routers.RecommendRepoFromPromote) m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote) + m.Get("/recommend/imageinfo", routers.GetImageInfoFromPromote) m.Post("/all/search/", routers.Search) m.Get("/all/search/", routers.EmptySearch) m.Get("/all/dosearch/", routers.SearchApi) From 3837a230143a5caa35985657dac5c44d1928329b Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Wed, 11 May 2022 09:53:53 +0800 Subject: [PATCH 2/5] mod font size --- templates/repo/cloudbrain/trainjob/show.tmpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/repo/cloudbrain/trainjob/show.tmpl b/templates/repo/cloudbrain/trainjob/show.tmpl index 3ddeeb247..e490b1928 100755 --- a/templates/repo/cloudbrain/trainjob/show.tmpl +++ b/templates/repo/cloudbrain/trainjob/show.tmpl @@ -102,6 +102,11 @@ td, th { padding: 0; } +.info_text { + padding-bottom: 20px; + padding-right: 20px; + font-size: 12px; +} .ac-grid-col .text-span { width: 450px; overflow: hidden; From 78bce7d91a1c8ef2107963f449855462c0e39663 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 11 May 2022 11:07:59 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/explore/repo_right.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/explore/repo_right.tmpl b/templates/explore/repo_right.tmpl index 12a3ffadb..5e05e797b 100644 --- a/templates/explore/repo_right.tmpl +++ b/templates/explore/repo_right.tmpl @@ -1,4 +1,4 @@ - +