From 76f57ba248e53faeb02f7cda1332886172575e9e Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 29 Dec 2021 11:31:49 +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 | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/public/home/home.js b/public/home/home.js index e47e4e51e..309d25780 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -25,8 +25,8 @@ if(lang != null && lang =="en-US" ){ console.log("the language is " + lang); socket.onmessage = function (e) { - console.log("data=" + e.data) var data =JSON.parse(e.data) + console.log("data=" + data) var html = ""; if (data != null){ if(messageQueue.length > maxSize){ @@ -35,21 +35,22 @@ socket.onmessage = function (e) { messageQueue.push(data); } for(var i = 0; i < messageQueue.length;i++){ + var record = messageQueue[i]; html += "
"; - html += " \"\"" + html += " \"\"" html += "
" - html += " " + data.ActUser.Name + "" + html += " " + record.ActUser.Name + "" - var actionName = getAction(data.OpType,isZh); - if(data.OpType == "6" || data.OpType == "10" || data.OpType == "12" || data.OpType == "13"){ - html += " " + getIssueText(data,actionName) + "" + var actionName = getAction(record.OpType,isZh); + if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ + html += " " + getIssueText(record,actionName) + "" } - if(data.OpType == "7" || data.OpType == "11" || data.OpType == "14" || data.OpType == "15"){ - html += " " + getPRText(data,actionName) + "" + if(record.OpType == "7" || record.OpType == "11" || record.OpType == "14" || record.OpType == "15"){ + html += " " + getPRText(record,actionName) + "" } - if(data.Repo != null){ - var time = getTime(data.Repo.UpdatedUnix); + if(record.Repo != null){ + var time = getTime(record.Repo.UpdatedUnix); html += time; } html += "
";