From 82d77571d0c5c57dffc3c258bb15c447ca4f5f20 Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 22 Feb 2022 10:07:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- public/home/home.js | 16 ++++++++++------ templates/explore/search_new.tmpl | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index 92eb86c1d..e5d68f137 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -80,23 +80,23 @@ socket.onmessage = function (e) { } else if(record.OpType == "1"){ html += recordPrefix + actionName; - html += " " + getRepoLink(record) + "" + html += " " + getRepotext(record) + "" } else if(record.OpType == "9" || record.OpType == "5"){ branch = "" + record.RefName + "" actionName = actionName.replace("{branch}",branch); html += recordPrefix + actionName; - html += " " + getRepoLink(record) + "" + html += " " + getRepotext(record) + "" }else if(record.OpType == "17"){ actionName = actionName.replace("{deleteBranchName}",record.RefName); - var repoLink = "" + getRepoLink(record) + "" + var repoLink = "" + getRepotext(record) + "" actionName = actionName.replace("{repoName}",repoLink); html += recordPrefix + actionName; } else if(record.OpType == "2"){ actionName = actionName.replace("{oldRepoName}",record.Content); html += recordPrefix + actionName; - html += " " + getRepoLink(record) + "" + html += " " + getRepotext(record) + "" } else{ continue; @@ -134,8 +134,12 @@ function getMsg(record){ return html; } -function getRepoLink(record){ - return "/" + record.Repo.OwnerName + "/" + record.Repo.Name; +function getRepotext(record){ + if(record.Repo.Alias){ + return record.Repo.OwnerName + "/" + record.Repo.Alias; + }else{ + return record.Repo.OwnerName + "/" + record.Repo.Name; + } } function getRepoLink(record){ return record.Repo.OwnerName + "/" + record.Repo.Name; diff --git a/templates/explore/search_new.tmpl b/templates/explore/search_new.tmpl index 68edaa8f4..ca6258471 100644 --- a/templates/explore/search_new.tmpl +++ b/templates/explore/search_new.tmpl @@ -77,6 +77,7 @@ +