Browse Source

Merge branch 'fix-1477' of https://git.openi.org.cn/OpenI/aiforge into fix-1477

tags/v1.22.2.2^2
zhoupzh 3 years ago
parent
commit
2fd6e2ca5b
3 changed files with 15 additions and 7 deletions
  1. +13
    -5
      public/home/home.js
  2. +1
    -1
      routers/routes/routes.go
  3. +1
    -1
      services/socketwrap/clientManager.go

+ 13
- 5
public/home/home.js View File

@@ -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 += " <a href=\"" + getIssueLink(record) + "\" rel=\"nofollow\">" + getIssueText(record) + "</a>"
@@ -170,9 +172,15 @@ function getTaskLink(record){
function getMsg(record){
var html ="";
html += "<div class=\"swiper-slide item\">";
html += " <img class=\"ui avatar image\" src=\"/user/avatar/" + record.ActUser.Name + "/-1\" alt=\"\">"
var name = "";
if(record.ActUser != null){
name = record.ActUser.Name;
}else{
console.log("act user is null.");
}
html += " <img class=\"ui avatar image\" src=\"/user/avatar/" + name + "/-1\" alt=\"\">"
html += " <div class=\"middle aligned content nowrap\">"
html += " <a href=\"/" + record.ActUser.Name + "\" title=\"\">" + record.ActUser.Name + "</a>"
html += " <a href=\"/" + name + "\" title=\"\">" + name + "</a>"
return html;
}



+ 1
- 1
routers/routes/routes.go View File

@@ -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)


+ 1
- 1
services/socketwrap/clientManager.go View File

@@ -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


Loading…
Cancel
Save