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 += "
";