|
|
|
@ -14,7 +14,7 @@ function changePassword() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:"/api/1.0/users/changePassword",
|
|
|
|
|
url: "/api/1.0/users/changePassword",
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
|
"oldPassword": oldPassword,
|
|
|
|
@ -22,12 +22,12 @@ function changePassword() {
|
|
|
|
|
"confirmPassword": confirmPassword,
|
|
|
|
|
}),
|
|
|
|
|
method: "POST",
|
|
|
|
|
success: function() {
|
|
|
|
|
success: function () {
|
|
|
|
|
$("#closeModalPassword").click();
|
|
|
|
|
showFeedbackMessage("Пароль был обновлен", MessageTypesEnum.SUCCESS)
|
|
|
|
|
showFeedbackMessage("Пароль был обновлен", MessageTypesEnum.SUCCESS)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error: function(errorData) {
|
|
|
|
|
error: function (errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -41,14 +41,14 @@ function inviteUser() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:"/api/1.0/users/invite?email=" + email,
|
|
|
|
|
url: "/api/1.0/users/invite?email=" + email,
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
method: "POST",
|
|
|
|
|
success: function() {
|
|
|
|
|
success: function () {
|
|
|
|
|
$("#closeModalInvite").click();
|
|
|
|
|
showFeedbackMessage("Пользователь был успешно приглашен", MessageTypesEnum.SUCCESS)
|
|
|
|
|
},
|
|
|
|
|
error: function(errorData) {
|
|
|
|
|
error: function (errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -64,10 +64,10 @@ function requestResetPassword() {
|
|
|
|
|
$("#dvloader").show();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:"/api/1.0/users/password-reset-request?email=" + email,
|
|
|
|
|
url: "/api/1.0/users/password-reset-request?email=" + email,
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
method: "POST",
|
|
|
|
|
success: function() {
|
|
|
|
|
success: function () {
|
|
|
|
|
showFeedbackMessage("Проверочный код был отправлен на указанный почтовый ящик", MessageTypesEnum.SUCCESS)
|
|
|
|
|
$("#passwordNew").show()
|
|
|
|
|
$("#passwordConfirm").show()
|
|
|
|
@ -78,7 +78,7 @@ function requestResetPassword() {
|
|
|
|
|
$("#dvloader").hide()
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
error: function(errorData) {
|
|
|
|
|
error: function (errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
$("#dvloader").hide()
|
|
|
|
|
}
|
|
|
|
@ -102,7 +102,7 @@ function resetPassword() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:"/api/1.0/users/password-reset",
|
|
|
|
|
url: "/api/1.0/users/password-reset",
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
method: "POST",
|
|
|
|
|
data: JSON.stringify({
|
|
|
|
@ -110,11 +110,11 @@ function resetPassword() {
|
|
|
|
|
"passwordConfirm": passwordConfirm,
|
|
|
|
|
"resetKey": resetKey,
|
|
|
|
|
}),
|
|
|
|
|
success: function() {
|
|
|
|
|
success: function () {
|
|
|
|
|
showFeedbackMessage("Пользователь был успешно приглашен", MessageTypesEnum.SUCCESS)
|
|
|
|
|
window.location.href = "/login"
|
|
|
|
|
},
|
|
|
|
|
error: function(errorData) {
|
|
|
|
|
error: function (errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -123,13 +123,13 @@ function resetPassword() {
|
|
|
|
|
function blockUser() {
|
|
|
|
|
userId = $('#userId').val();
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:"/api/1.0/users/block?userId=" + userId,
|
|
|
|
|
url: "/api/1.0/users/block?userId=" + userId,
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
method: "POST",
|
|
|
|
|
success: function() {
|
|
|
|
|
success: function () {
|
|
|
|
|
showFeedbackMessage("Пользователь заблокирован", MessageTypesEnum.SUCCESS)
|
|
|
|
|
},
|
|
|
|
|
error: function(errorData) {
|
|
|
|
|
error: function (errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
@ -144,30 +144,30 @@ function drawChart() {
|
|
|
|
|
userId = $('#author :selected').val()
|
|
|
|
|
activity = $('#activity :selected').val()
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:`/api/1.0/users/activities/pings?userId=${userId}&activity=${activity}`,
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
method: "GET",
|
|
|
|
|
success: function(response) {
|
|
|
|
|
if (response.data.length == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
array = [['Активности', 'Количество']]
|
|
|
|
|
|
|
|
|
|
Object.keys(response.data).forEach(function(key) {
|
|
|
|
|
console.table('Key : ' + key + ', Value : ' + response.data[key])
|
|
|
|
|
array.push([key, response.data[key]])
|
|
|
|
|
})
|
|
|
|
|
var data = google.visualization.arrayToDataTable(array);
|
|
|
|
|
var options = {
|
|
|
|
|
title: 'Активности',
|
|
|
|
|
is3D: true,
|
|
|
|
|
pieResidueSliceLabel: 'Остальное'
|
|
|
|
|
};
|
|
|
|
|
var chart = new google.visualization.PieChart(document.getElementById('air'));
|
|
|
|
|
chart.draw(data, options);
|
|
|
|
|
},
|
|
|
|
|
error: function(errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
url: `/api/1.0/users/activities/pings?userId=${userId}&activity=${activity}`,
|
|
|
|
|
contentType: "application/json; charset=utf-8",
|
|
|
|
|
method: "GET",
|
|
|
|
|
success: function (response) {
|
|
|
|
|
if (response.data.length == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
array = [['Активности', 'Количество']]
|
|
|
|
|
|
|
|
|
|
Object.keys(response.data).forEach(function (key) {
|
|
|
|
|
console.table('Key : ' + key + ', Value : ' + response.data[key])
|
|
|
|
|
array.push([key, response.data[key]])
|
|
|
|
|
})
|
|
|
|
|
var data = google.visualization.arrayToDataTable(array);
|
|
|
|
|
var options = {
|
|
|
|
|
title: 'Активности',
|
|
|
|
|
is3D: true,
|
|
|
|
|
pieResidueSliceLabel: 'Остальное'
|
|
|
|
|
};
|
|
|
|
|
var chart = new google.visualization.PieChart(document.getElementById('air'));
|
|
|
|
|
chart.draw(data, options);
|
|
|
|
|
},
|
|
|
|
|
error: function (errorData) {
|
|
|
|
|
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|