diff --git a/static/resources/js/item-detail.js b/static/resources/js/item-detail.js index 6f445f717..b37089d75 100644 --- a/static/resources/js/item-detail.js +++ b/static/resources/js/item-detail.js @@ -243,22 +243,26 @@ jQuery(function(){ $("#tblUser tbody tr").remove(); for(var i = 0; i < userList.length; ){ - var userId = userList[i].UserId; - var roleId = userList[i].RoleId; + var userId = userList[i].user_id; + var roleId = userList[i].role_id; var username = userList[i].username; - var roleNameList = []; +// var roleNameList = []; - for(var j = i; j < userList.length; i++, j++){ - if(userList[j].UserId == userId){ - roleNameList.push(name_mapping[userList[j].Rolename]); - }else{ - break; - } - } +// for(var j = i; j < userList.length; i++, j++){ +// if(userList[j].UserId == userId){ +// roleNameList.push(name_mapping[userList[j].Rolename]); +// }else{ +// break; +// } +// } - var row = '' + +// var row = '' + +// '' + username + '' + +// '' + roleNameList.join(",") + '' + +// ''; + var row = '' + '' + username + '' + - '' + roleNameList.join(",") + '' + + '' + '--' + '' + ''; var isShowOperations = true; if(loginedUserRoleId >= 3 /*role: developer guest*/){ @@ -285,10 +289,10 @@ jQuery(function(){ $("#tabOperationLog tbody").append( '' + '' + e.Username + '' + - '' + e.RepoName + '' + - '' + e.RepoTag + '' + - '' + e.Operation + '' + - '' + moment(new Date(e.OpTime)).format("YYYY-MM-DD HH:mm:ss") + '' + + '' + e.repo_name + '' + + '' + e.repo_tag + '' + + '' + e.operation + '' + + '' + moment(new Date(e.op_time)).format("YYYY-MM-DD HH:mm:ss") + '' + ''); }); } @@ -326,7 +330,7 @@ jQuery(function(){ } }).exec() ).done(function(userList){ - listUserByProjectCallback(userList || []); +// listUserByProjectCallback(userList || []); $("#tblUser .glyphicon-pencil").on("click", function(e){ var userId = $(this).attr("userid") getUserRoleCallback(userId); @@ -404,7 +408,7 @@ jQuery(function(){ new AjaxUtil({ url: "/api/projects/" + projectId + "/logs/filter", - data:{"username":username, "project_id" : projectId, "keywords" : getKeyWords() , "beginTimestamp" : beginTimestamp, "endTimestamp" : endTimestamp}, + data:{"Username":username, "project_id" : Number(projectId), "keywords" : getKeyWords() , "begin_timestamp" : beginTimestamp, "end_timestamp" : endTimestamp}, type: "post", success: function(data, status, xhr){ if(xhr && xhr.status == 200){ diff --git a/static/resources/js/project.js b/static/resources/js/project.js index 97da2d6f9..a59dfa85a 100644 --- a/static/resources/js/project.js +++ b/static/resources/js/project.js @@ -19,7 +19,7 @@ jQuery(function(){ type: "get", success: function(data, status, xhr){ if(xhr && xhr.status == 200){ - if(data.HasAdminRole == 1) { + if(data.has_admin_role == 1) { renderForAdminRole(); } renderForAnyRole(); @@ -55,16 +55,16 @@ jQuery(function(){ $("#tblProject tbody tr").remove(); $.each(data || [], function(i, e){ var row = '' + - '' + e.Name + '' + - '' + moment(new Date(e.CreationTime)).format("YYYY-MM-DD HH:mm:ss") + ''; + '' + e.name + '' + + '' + moment(new Date(e.creation_time)).format("YYYY-MM-DD HH:mm:ss") + ''; if(e.Public == 1 && e.Togglable){ - row += '' + row += '' } else if (e.Public == 1) { - row += ''; + row += ''; } else if (e.Public == 0 && e.Togglable) { - row += ''; + row += ''; } else if (e.Public == 0) { - row += ''; + row += ''; row += ''; } $("#tblProject tbody").append(row); @@ -164,11 +164,11 @@ jQuery(function(){ '' + e.username + '' + '' + e.email + ''; if(e.HasAdminRole == 1){ - row += ''; + row += ''; } else { - row += ''; + row += ''; } - row += ''; + row += ''; row += ''; $("#tblUser tbody").append(row); });