|
|
@ -228,11 +228,11 @@ function resetPassword(uname) {
|
|
|
|
* when a user type on the search field on User Listing page in
|
|
|
|
* when a user type on the search field on User Listing page in
|
|
|
|
* WSO2 MDM Console then click on the search button.
|
|
|
|
* WSO2 MDM Console then click on the search button.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
$("#search-btn").click(function () {
|
|
|
|
//$("#search-btn").click(function () {
|
|
|
|
var searchQuery = $("#search-by-username").val();
|
|
|
|
// var searchQuery = $("#search-by-username").val();
|
|
|
|
$("#ast-container").empty();
|
|
|
|
// $("#ast-container").empty();
|
|
|
|
loadUsers(searchQuery);
|
|
|
|
// loadUsers(searchQuery);
|
|
|
|
});
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Following function would execute
|
|
|
|
* Following function would execute
|
|
|
@ -248,94 +248,113 @@ function InitiateViewOption() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function loadUsers(searchParam) {
|
|
|
|
function loadUsers() {
|
|
|
|
|
|
|
|
var loadingContentView = "#loading-content";
|
|
|
|
|
|
|
|
$(loadingContentView).show();
|
|
|
|
$("#loading-content").show();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dataFilter = function (data) {
|
|
|
|
var dataFilter = function(data){
|
|
|
|
|
|
|
|
data = JSON.parse(data);
|
|
|
|
data = JSON.parse(data);
|
|
|
|
|
|
|
|
|
|
|
|
var objects = [];
|
|
|
|
var objects = [];
|
|
|
|
|
|
|
|
|
|
|
|
$(data.users).each(function( index ) {
|
|
|
|
$(data.users).each( function (index) {
|
|
|
|
objects.push({
|
|
|
|
objects.push({
|
|
|
|
filter: data.users[index].username,
|
|
|
|
filter: data.users[index].username,
|
|
|
|
firstname: data.users[index].firstname ? data.users[index].firstname: '' ,
|
|
|
|
firstname: data.users[index].firstname ? data.users[index].firstname : '' ,
|
|
|
|
lastname: data.users[index].lastname ? data.users[index].lastname : '',
|
|
|
|
lastname: data.users[index].lastname ? data.users[index].lastname : '',
|
|
|
|
emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress: '',
|
|
|
|
emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress : '',
|
|
|
|
DT_RowId : "role-" + data.users[index].username})
|
|
|
|
DT_RowId : "user-" + data.users[index].username})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
json = {
|
|
|
|
var json = {
|
|
|
|
"recordsTotal": data.count,
|
|
|
|
"recordsTotal": data.count,
|
|
|
|
"recordsFiltered": data.count,
|
|
|
|
"recordsFiltered": data.count,
|
|
|
|
"data": objects
|
|
|
|
"data": objects
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return JSON.stringify( json );
|
|
|
|
return JSON.stringify(json);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var fnCreatedRow = function( nRow, aData, iDataIndex ) {
|
|
|
|
//noinspection JSUnusedLocalSymbols
|
|
|
|
|
|
|
|
var fnCreatedRow = function (nRow, aData, iDataIndex) {
|
|
|
|
$(nRow).attr('data-type', 'selectable');
|
|
|
|
$(nRow).attr('data-type', 'selectable');
|
|
|
|
$(nRow).attr('data-username', aData["filter"]);
|
|
|
|
$(nRow).attr('data-username', aData["filter"]);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//noinspection JSUnusedLocalSymbols
|
|
|
|
var columns = [
|
|
|
|
var columns = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class: "remove-padding icon-only content-fill",
|
|
|
|
class: "remove-padding icon-only content-fill",
|
|
|
|
data: null,
|
|
|
|
data: null,
|
|
|
|
defaultContent: '<div class="thumbnail icon"> <i class="square-element text fw fw-user" style="font-size: 30px;"></i> </div>'
|
|
|
|
defaultContent: '<div class="thumbnail icon">' +
|
|
|
|
|
|
|
|
'<i class="square-element text fw fw-user" style="font-size: 30px;"></i>' +
|
|
|
|
|
|
|
|
'</div>'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class: "fade-edge",
|
|
|
|
class: "fade-edge",
|
|
|
|
data: null,
|
|
|
|
data: null,
|
|
|
|
render: function ( data, type, row, meta ) {
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
return '<h4>' + data.firstname + ' ' + data.lastname + '</h4>';
|
|
|
|
return '<h4>' + data.firstname + ' ' + data.lastname + '</h4>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class: "fade-edge remove-padding-top",
|
|
|
|
class: "fade-edge remove-padding-top",
|
|
|
|
data: 'filter',
|
|
|
|
data: 'filter',
|
|
|
|
render: function ( filter, type, row, meta ) {
|
|
|
|
render: function (filter, type, row, meta) {
|
|
|
|
return '<i class="fw-user"></i> ' + filter;
|
|
|
|
return '<i class="fw-user"></i> ' + filter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class: "fade-edge remove-padding-top",
|
|
|
|
class: "fade-edge remove-padding-top",
|
|
|
|
data: null,
|
|
|
|
data: null,
|
|
|
|
render: function ( data, type, row, meta ) {
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
return '<a href="mailto:' + data.emailAddress + ' " class="wr-list-email"> <i class="fw-mail"></i> ' + data.emailAddress + ' </a>';
|
|
|
|
return '<a href="mailto:' + data.emailAddress + ' " class="wr-list-email"> <i class="fw-mail"></i> ' + data.emailAddress + ' </a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
class: "text-right content-fill text-left-on-grid-view no-wrap",
|
|
|
|
class: "text-right content-fill text-left-on-grid-view no-wrap",
|
|
|
|
data: null,
|
|
|
|
data: null,
|
|
|
|
render: function ( data, type, row, meta ) {
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
return '<a href="/emm/user/edit?username=' + data.filter + '" data-username="' + data.filter +
|
|
|
|
return '<a href="/emm/user/edit?username=' + data.filter + '" data-username="' + data.filter + '" ' +
|
|
|
|
'" data-click-event="edit-form" class="btn padding-reduce-on-grid-view edit-user-link"> ' +
|
|
|
|
'data-click-event="edit-form" ' +
|
|
|
|
'<span class="fw-stack"> <i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-edit fw-stack-1x"></i>' +
|
|
|
|
'class="btn padding-reduce-on-grid-view edit-user-link"> ' +
|
|
|
|
' </span> <span class="hidden-xs hidden-on-grid-view">Edit</span> </a>' +
|
|
|
|
'<span class="fw-stack"> ' +
|
|
|
|
|
|
|
|
'<i class="fw fw-ring fw-stack-2x"></i>' +
|
|
|
|
'<a href="#" data-username="' + data.filter + '" data-userid=' + data.filter +
|
|
|
|
'<i class="fw fw-edit fw-stack-1x"></i>' +
|
|
|
|
' data-click-event="remove-form" onclick="javascript:removeUser(\'' + data.filter + '\')" ' +
|
|
|
|
'</span>' +
|
|
|
|
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">' +
|
|
|
|
|
|
|
|
' Edit' +
|
|
|
|
|
|
|
|
'</span>' +
|
|
|
|
|
|
|
|
'</a>' +
|
|
|
|
|
|
|
|
'<a href="#" data-username="' + data.filter + '" data-userid="' + data.filter + '" ' +
|
|
|
|
|
|
|
|
'data-click-event="edit-form" ' +
|
|
|
|
|
|
|
|
'onclick="javascript:resetPassword(\'' + data.filter + '\')" ' +
|
|
|
|
|
|
|
|
'class="btn padding-reduce-on-grid-view remove-user-link">' +
|
|
|
|
|
|
|
|
'<span class="fw-stack">' +
|
|
|
|
|
|
|
|
'<i class="fw fw-ring fw-stack-2x"></i>' +
|
|
|
|
|
|
|
|
'<i class="fw fw-key fw-stack-1x"></i>' +
|
|
|
|
|
|
|
|
'</span>' +
|
|
|
|
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">' +
|
|
|
|
|
|
|
|
' Reset Password' +
|
|
|
|
|
|
|
|
'</span>' +
|
|
|
|
|
|
|
|
'</a>' +
|
|
|
|
|
|
|
|
'<a href="#" data-username="' + data.filter + '" data-userid="' + data.filter + '" ' +
|
|
|
|
|
|
|
|
'data-click-event="remove-form" ' +
|
|
|
|
|
|
|
|
'onclick="javascript:removeUser(\'' + data.filter + '\')" ' +
|
|
|
|
'class="btn padding-reduce-on-grid-view remove-user-link">' +
|
|
|
|
'class="btn padding-reduce-on-grid-view remove-user-link">' +
|
|
|
|
'<span class="fw-stack"> <i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-delete fw-stack-1x">' +
|
|
|
|
'<span class="fw-stack">' +
|
|
|
|
'</i> </span> <span class="hidden-xs hidden-on-grid-view">Remove</span> </a>' +
|
|
|
|
'<i class="fw fw-ring fw-stack-2x"></i>' +
|
|
|
|
|
|
|
|
'<i class="fw fw-delete fw-stack-1x"></i>' +
|
|
|
|
'<a href="#" data-username="' + data.filter + '" data-userid="' + data.filter +
|
|
|
|
'</span>' +
|
|
|
|
'" data-click-event="edit-form" onclick="javascript:resetPassword(\'' + data.filter +
|
|
|
|
'<span class="hidden-xs hidden-on-grid-view">' +
|
|
|
|
'\')" class="btn padding-reduce-on-grid-view remove-user-link"> <span class="fw-stack"> <i class="fw fw-ring fw-stack-2x">' +
|
|
|
|
' Remove' +
|
|
|
|
'</i> <i class="fw fw-key fw-stack-1x"></i> <span class="fw-stack fw-move-right fw-move-bottom"> <i class="fw fw-circle fw-stack-2x fw-stroke fw-inverse"><' +
|
|
|
|
'</span>' +
|
|
|
|
'/i> <i class="fw fw-circle fw-stack-2x"></i> <i class="fw fw-refresh fw-stack-1x fw-inverse">' +
|
|
|
|
'</a>';
|
|
|
|
'</i> </span> </span> <span class="hidden-xs hidden-on-grid-view">Reset</span> </a>'
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var options = {
|
|
|
|
var options = {
|
|
|
|
"placeholder": "Search By Username",
|
|
|
|
"placeholder": "Search By Username",
|
|
|
|
"searchKey" : "filter"
|
|
|
|
"searchKey" : "filter"
|
|
|
@ -347,7 +366,6 @@ function loadUsers(searchParam) {
|
|
|
|
$("#loading-content").hide();
|
|
|
|
$("#loading-content").hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $("#loading-content").show();
|
|
|
|
// $("#loading-content").show();
|
|
|
|
// var userListing = $("#user-listing");
|
|
|
|
// var userListing = $("#user-listing");
|
|
|
|
// var userListingSrc = userListing.attr("src");
|
|
|
|
// var userListingSrc = userListing.attr("src");
|
|
|
@ -410,7 +428,6 @@ function loadUsers(searchParam) {
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(document).ready(function () {
|
|
|
|
loadUsers();
|
|
|
|
loadUsers();
|
|
|
|
|
|
|
|
|
|
|
|
$(".viewEnabledIcon").click(function () {
|
|
|
|
$(".viewEnabledIcon").click(function () {
|
|
|
|
InitiateViewOption();
|
|
|
|
InitiateViewOption();
|
|
|
|
});
|
|
|
|
});
|
|
|
|