mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-30 06:03:45 +01:00
updates for attribute-rename of js
This commit is contained in:
parent
03389abb96
commit
e8531edd39
@ -243,22 +243,26 @@ jQuery(function(){
|
|||||||
$("#tblUser tbody tr").remove();
|
$("#tblUser tbody tr").remove();
|
||||||
for(var i = 0; i < userList.length; ){
|
for(var i = 0; i < userList.length; ){
|
||||||
|
|
||||||
var userId = userList[i].UserId;
|
var userId = userList[i].user_id;
|
||||||
var roleId = userList[i].RoleId;
|
var roleId = userList[i].role_id;
|
||||||
var username = userList[i].username;
|
var username = userList[i].username;
|
||||||
var roleNameList = [];
|
// var roleNameList = [];
|
||||||
|
|
||||||
for(var j = i; j < userList.length; i++, j++){
|
// for(var j = i; j < userList.length; i++, j++){
|
||||||
if(userList[j].UserId == userId){
|
// if(userList[j].UserId == userId){
|
||||||
roleNameList.push(name_mapping[userList[j].Rolename]);
|
// roleNameList.push(name_mapping[userList[j].Rolename]);
|
||||||
}else{
|
// }else{
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
var row = '<tr>' +
|
// var row = '<tr>' +
|
||||||
|
// '<td>' + username + '</td>' +
|
||||||
|
// '<td>' + roleNameList.join(",") + '</td>' +
|
||||||
|
// '<td>';
|
||||||
|
var row = '<tr>' +
|
||||||
'<td>' + username + '</td>' +
|
'<td>' + username + '</td>' +
|
||||||
'<td>' + roleNameList.join(",") + '</td>' +
|
'<td>' + '--' + '</td>' +
|
||||||
'<td>';
|
'<td>';
|
||||||
var isShowOperations = true;
|
var isShowOperations = true;
|
||||||
if(loginedUserRoleId >= 3 /*role: developer guest*/){
|
if(loginedUserRoleId >= 3 /*role: developer guest*/){
|
||||||
@ -285,10 +289,10 @@ jQuery(function(){
|
|||||||
$("#tabOperationLog tbody").append(
|
$("#tabOperationLog tbody").append(
|
||||||
'<tr>' +
|
'<tr>' +
|
||||||
'<td>' + e.Username + '</td>' +
|
'<td>' + e.Username + '</td>' +
|
||||||
'<td>' + e.RepoName + '</td>' +
|
'<td>' + e.repo_name + '</td>' +
|
||||||
'<td>' + e.RepoTag + '</td>' +
|
'<td>' + e.repo_tag + '</td>' +
|
||||||
'<td>' + e.Operation + '</td>' +
|
'<td>' + e.operation + '</td>' +
|
||||||
'<td>' + moment(new Date(e.OpTime)).format("YYYY-MM-DD HH:mm:ss") + '</td>' +
|
'<td>' + moment(new Date(e.op_time)).format("YYYY-MM-DD HH:mm:ss") + '</td>' +
|
||||||
'</tr>');
|
'</tr>');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -326,7 +330,7 @@ jQuery(function(){
|
|||||||
}
|
}
|
||||||
}).exec()
|
}).exec()
|
||||||
).done(function(userList){
|
).done(function(userList){
|
||||||
listUserByProjectCallback(userList || []);
|
// listUserByProjectCallback(userList || []);
|
||||||
$("#tblUser .glyphicon-pencil").on("click", function(e){
|
$("#tblUser .glyphicon-pencil").on("click", function(e){
|
||||||
var userId = $(this).attr("userid")
|
var userId = $(this).attr("userid")
|
||||||
getUserRoleCallback(userId);
|
getUserRoleCallback(userId);
|
||||||
@ -404,7 +408,7 @@ jQuery(function(){
|
|||||||
|
|
||||||
new AjaxUtil({
|
new AjaxUtil({
|
||||||
url: "/api/projects/" + projectId + "/logs/filter",
|
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",
|
type: "post",
|
||||||
success: function(data, status, xhr){
|
success: function(data, status, xhr){
|
||||||
if(xhr && xhr.status == 200){
|
if(xhr && xhr.status == 200){
|
||||||
|
@ -19,7 +19,7 @@ jQuery(function(){
|
|||||||
type: "get",
|
type: "get",
|
||||||
success: function(data, status, xhr){
|
success: function(data, status, xhr){
|
||||||
if(xhr && xhr.status == 200){
|
if(xhr && xhr.status == 200){
|
||||||
if(data.HasAdminRole == 1) {
|
if(data.has_admin_role == 1) {
|
||||||
renderForAdminRole();
|
renderForAdminRole();
|
||||||
}
|
}
|
||||||
renderForAnyRole();
|
renderForAnyRole();
|
||||||
@ -55,16 +55,16 @@ jQuery(function(){
|
|||||||
$("#tblProject tbody tr").remove();
|
$("#tblProject tbody tr").remove();
|
||||||
$.each(data || [], function(i, e){
|
$.each(data || [], function(i, e){
|
||||||
var row = '<tr>' +
|
var row = '<tr>' +
|
||||||
'<td style="vertical-align: middle;"><a href="/registry/detail?project_id=' + e.ProjectId + '">' + e.Name + '</a></td>' +
|
'<td style="vertical-align: middle;"><a href="/registry/detail?project_id=' + e.project_id + '">' + e.name + '</a></td>' +
|
||||||
'<td style="vertical-align: middle;">' + moment(new Date(e.CreationTime)).format("YYYY-MM-DD HH:mm:ss") + '</td>';
|
'<td style="vertical-align: middle;">' + moment(new Date(e.creation_time)).format("YYYY-MM-DD HH:mm:ss") + '</td>';
|
||||||
if(e.Public == 1 && e.Togglable){
|
if(e.Public == 1 && e.Togglable){
|
||||||
row += '<td><button type="button" class="btn btn-success" projectid="' + e.ProjectId + '">' + i18n.getMessage("button_on")+ '</button></td>'
|
row += '<td><button type="button" class="btn btn-success" projectid="' + e.project_id + '">' + i18n.getMessage("button_on")+ '</button></td>'
|
||||||
} else if (e.Public == 1) {
|
} else if (e.Public == 1) {
|
||||||
row += '<td><button type="button" class="btn btn-success" projectid="' + e.ProjectId + '" disabled>' + i18n.getMessage("button_on")+ '</button></td>';
|
row += '<td><button type="button" class="btn btn-success" projectid="' + e.project_id + '" disabled>' + i18n.getMessage("button_on")+ '</button></td>';
|
||||||
} else if (e.Public == 0 && e.Togglable) {
|
} else if (e.Public == 0 && e.Togglable) {
|
||||||
row += '<td><button type="button" class="btn btn-danger" projectid="' + e.ProjectId + '">' + i18n.getMessage("button_off")+ '</button></td>';
|
row += '<td><button type="button" class="btn btn-danger" projectid="' + e.project_id + '">' + i18n.getMessage("button_off")+ '</button></td>';
|
||||||
} else if (e.Public == 0) {
|
} else if (e.Public == 0) {
|
||||||
row += '<td><button type="button" class="btn btn-danger" projectid="' + e.ProjectId + '" disabled>' + i18n.getMessage("button_off")+ '</button></td>';
|
row += '<td><button type="button" class="btn btn-danger" projectid="' + e.project_id + '" disabled>' + i18n.getMessage("button_off")+ '</button></td>';
|
||||||
row += '</tr>';
|
row += '</tr>';
|
||||||
}
|
}
|
||||||
$("#tblProject tbody").append(row);
|
$("#tblProject tbody").append(row);
|
||||||
@ -164,11 +164,11 @@ jQuery(function(){
|
|||||||
'<td style="vertical-align: middle;">' + e.username + '</td>' +
|
'<td style="vertical-align: middle;">' + e.username + '</td>' +
|
||||||
'<td style="vertical-align: middle;">' + e.email + '</td>';
|
'<td style="vertical-align: middle;">' + e.email + '</td>';
|
||||||
if(e.HasAdminRole == 1){
|
if(e.HasAdminRole == 1){
|
||||||
row += '<td style="padding-left: 30px;"><button type="button" class="btn btn-success" userid="' + e.UserId + '">' + i18n.getMessage("button_on") + '</button></td>';
|
row += '<td style="padding-left: 30px;"><button type="button" class="btn btn-success" userid="' + e.user_id + '">' + i18n.getMessage("button_on") + '</button></td>';
|
||||||
} else {
|
} else {
|
||||||
row += '<td style="padding-left: 30px;"><button type="button" class="btn btn-danger" userid="' + e.UserId + '">' + i18n.getMessage("button_off") + '</button></td>';
|
row += '<td style="padding-left: 30px;"><button type="button" class="btn btn-danger" userid="' + e.user_id + '">' + i18n.getMessage("button_off") + '</button></td>';
|
||||||
}
|
}
|
||||||
row += '<td style="padding-left: 30px; vertical-align: middle;"><a href="#" style="visibility: hidden;" class="tdDeleteUser" userid="' + e.UserId + '" username="' + e.Username + '"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
row += '<td style="padding-left: 30px; vertical-align: middle;"><a href="#" style="visibility: hidden;" class="tdDeleteUser" userid="' + e.user_id + '" username="' + e.username + '"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
||||||
row += '</tr>';
|
row += '</tr>';
|
||||||
$("#tblUser tbody").append(row);
|
$("#tblUser tbody").append(row);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user