diff --git a/public/home/home.js b/public/home/home.js index 8f7d6a626..78b9d517c 100644 --- a/public/home/home.js +++ b/public/home/home.js @@ -94,10 +94,12 @@ 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.ActUser == null){ + console.log("receive action type=" + record.OpType + " name=" + actionName + " but user is null."); + continue; + } + var recordPrefix = getMsg(record); if(record.OpType == "6" || record.OpType == "10" || record.OpType == "12" || record.OpType == "13"){ html += recordPrefix + actionName; html += " " + getIssueText(record) + "" @@ -170,9 +172,15 @@ function getTaskLink(record){ function getMsg(record){ var html =""; html += "
"; - html += " \"\"" + var name = ""; + if(record.ActUser != null){ + name = record.ActUser.Name; + }else{ + console.log("act user is null."); + } + html += " \"\"" html += "
" - html += " " + record.ActUser.Name + "" + html += " " + name + "" return html; } diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 9dc69828c..7fa06fa3b 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -993,7 +993,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("", reqRepoCloudBrainReader, repo.CloudBrainShow) }) m.Group("/:jobid", func() { - m.Get("/debug", reqWechatBind, cloudbrain.AdminOrJobCreaterRight, repo.CloudBrainDebug) + m.Get("/debug", cloudbrain.AdminOrJobCreaterRight, repo.CloudBrainDebug) m.Post("/commit_image", cloudbrain.AdminOrJobCreaterRight, bindIgnErr(auth.CommitImageCloudBrainForm{}), repo.CloudBrainCommitImage) m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainStop) m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainDel) diff --git a/services/socketwrap/clientManager.go b/services/socketwrap/clientManager.go index 3ba35f8ff..98b0e0aa9 100644 --- a/services/socketwrap/clientManager.go +++ b/services/socketwrap/clientManager.go @@ -10,7 +10,7 @@ import ( "github.com/elliotchance/orderedmap" ) -var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30} +var opTypes = []int{1, 2, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 22, 23, 25, 26, 27, 28, 29, 30} type ClientsManager struct { Clients *orderedmap.OrderedMap