Updating user-listing

merge-requests/7/head
dilanua 8 years ago
parent bbce1a3d8a
commit 99aca9b90a

@ -108,7 +108,7 @@ $("a.invite-user-link").click(function () {
invokerUtil.post( invokerUtil.post(
inviteUserAPI, inviteUserAPI,
usernameList, usernameList,
// The success callback // success callback
function (data, textStatus, jqXHR) { function (data, textStatus, jqXHR) {
if (jqXHR.status == 200) { if (jqXHR.status == 200) {
$(modalPopupContent).html($('#invite-user-success-content').html()); $(modalPopupContent).html($('#invite-user-success-content').html());
@ -117,7 +117,7 @@ $("a.invite-user-link").click(function () {
}); });
} }
}, },
// The error callback // error callback
function (jqXHR) { function (jqXHR) {
console.log("error in invite-user API, status code: " + jqXHR.status); console.log("error in invite-user API, status code: " + jqXHR.status);
$(modalPopupContent).html($('#invite-user-error-content').html()); $(modalPopupContent).html($('#invite-user-error-content').html());
@ -212,7 +212,7 @@ function resetPassword(uname) {
invokerUtil.post( invokerUtil.post(
resetPasswordServiceURL, resetPasswordServiceURL,
resetPasswordFormData, resetPasswordFormData,
// The success callback // success callback
function (data, textStatus, jqXHR) { function (data, textStatus, jqXHR) {
if (jqXHR.status == 200) { if (jqXHR.status == 200) {
$(modalPopupContent).html($('#reset-password-success-content').html()); $(modalPopupContent).html($('#reset-password-success-content').html());
@ -221,7 +221,7 @@ function resetPassword(uname) {
}); });
} }
}, },
// The error callback // error callback
function (jqXHR) { function (jqXHR) {
console.log("error in reset-password API, status code: " + jqXHR.status); console.log("error in reset-password API, status code: " + jqXHR.status);
var payload = JSON.parse(jqXHR.responseText); var payload = JSON.parse(jqXHR.responseText);
@ -271,14 +271,19 @@ function loadUsers() {
var objects = []; var objects = [];
$(data.users).each(function (index) { $(data.users).each(
objects.push({ function (index) {
username: data.users[index].username, objects.push(
firstname: data.users[index].firstname ? data.users[index].firstname: '' , {
lastname: data.users[index].lastname ? data.users[index].lastname : '', username: data.users[index].username,
emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress: '', firstname: data.users[index].firstname ? data.users[index].firstname: '' ,
DT_RowId : "user-" + data.users[index].username}) lastname: data.users[index].lastname ? data.users[index].lastname : '',
}); emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress: '',
DT_RowId : "user-" + data.users[index].username
}
)
}
);
var json = { var json = {
"recordsTotal": data.count, "recordsTotal": data.count,
@ -349,11 +354,11 @@ function loadUsers() {
'<span class="fw-stack">' + '<span class="fw-stack">' +
'<i class="fw fw-ring fw-stack-2x"></i>' + '<i class="fw fw-ring fw-stack-2x"></i>' +
'<i class="fw fw-key fw-stack-1x"></i>' + '<i class="fw fw-key fw-stack-1x"></i>' +
'<span class="fw-stack fw-move-right fw-move-bottom">' + '<span class="fw-stack fw-move-right fw-move-bottom">' +
'<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i> ' + '<i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"></i> ' +
'<i class="fw fw-circle fw-stack-2x"></i>' + '<i class="fw fw-circle fw-stack-2x"></i>' +
'<i class="fw fw-refresh fw-stack-1x fw-inverse"></i> ' + '<i class="fw fw-refresh fw-stack-1x fw-inverse"></i> ' +
'</span>' + '</span>' +
'</span>' + '</span>' +
'<span class="hidden-xs hidden-on-grid-view">&nbsp;&nbsp;Reset Password</span>' + '<span class="hidden-xs hidden-on-grid-view">&nbsp;&nbsp;Reset Password</span>' +
'</a>' + '</a>' +
@ -374,7 +379,9 @@ function loadUsers() {
]; ];
$("#user-grid").datatables_extended_serverside_paging(null, '/api/device-mgt/v1.0/users', dataFilter, columns, fnCreatedRow, null); $("#user-grid").datatables_extended_serverside_paging(
null, '/api/device-mgt/v1.0/users', dataFilter, columns, fnCreatedRow, null
);
$("#loading-content").hide(); $("#loading-content").hide();
} }

Loading…
Cancel
Save