diff --git a/public/home/home.js b/public/home/home.js index 9598c65d7..81392c265 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -64,18 +64,18 @@ socket.onmessage = function (e) { var currentTime = new Date().getTime(); for(var i = 0; i < messageQueue.length; i++){ var record = messageQueue[i]; - + var recordPrefix = getMsg(record); var actionName = getAction(record.OpType,isZh); - + if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ html += recordPrefix + actionName; - html += " " + getIssueText(record) + "" + html += " " + getIssueText(record) + "" } else if(record.OpType == "7" || record.OpType == "11" || record.OpType == "14" || record.OpType == "15" || record.OpType == "22" || record.OpType == "23"){ html += recordPrefix + actionName; - html += " " + getPRText(record) + "" + html += " " + getPRText(record) + "" } else if(record.OpType == "1"){ html += recordPrefix + actionName; @@ -120,7 +120,7 @@ function getMsg(record){ html += "
"; html += " \"\"" html += "
" - html += " " + record.ActUser.Name + "" + html += " " + record.ActUser.Name + "" return html; } @@ -133,7 +133,7 @@ function getRepotext(record){ } function getRepoLink(record){ return record.Repo.OwnerName + "/" + record.Repo.Name; - + } function getTime(UpdatedUnix,currentTime){ @@ -143,7 +143,7 @@ function getTime(UpdatedUnix,currentTime){ if( timeEscSecond < 0){ timeEscSecond = 1; } - + var hours= Math.floor(timeEscSecond / 3600); //计算相差分钟数 var leave2 = Math.floor(timeEscSecond % (3600)); //计算小时数后剩余的秒数 @@ -172,11 +172,11 @@ function getPRText(record){ }else{ return record.Repo.OwnerName + "/" + record.Repo.Name + "#" + getIssueId(record); } - + } function getIssueLink(record){ - + return "/" + record.Repo.OwnerName + "/" + record.Repo.Name + "/issues/" + getIssueId(record); } @@ -202,7 +202,7 @@ function getIssueText(record){ }else{ return record.Repo.OwnerName + "/" + record.Repo.Name + "#" + getIssueId(record); } - + } /* @@ -354,7 +354,7 @@ function displayRepo(json){ html += " " + record["NumStars"] + "" + record["NumForks"]; html += " "; html += " "; - html += " " + record["Name"] +""; + html += " " + record["Alias"] +""; html += "
" + record["Description"] + "
"; html += "
" if(record["Topics"] != null){ @@ -408,4 +408,4 @@ function displayOrg(json){ } } orgDiv.innerHTML = html; -} \ No newline at end of file +} diff --git a/routers/home.go b/routers/home.go index 123fdfa3b..399e11997 100755 --- a/routers/home.go +++ b/routers/home.go @@ -629,7 +629,8 @@ func RecommendRepoFromPromote(ctx *context.Context) { if err == nil { repoMap := make(map[string]interface{}) repoMap["ID"] = fmt.Sprint(repo.ID) - repoMap["Name"] = repo.Alias + repoMap["Name"] = repo.Name + repoMap["Alias"] = repo.Alias repoMap["OwnerName"] = repo.OwnerName repoMap["NumStars"] = repo.NumStars repoMap["NumForks"] = repo.NumForks