mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-11 11:02:41 +00:00
update toastr js and close #8
This commit is contained in:
parent
7fd224e690
commit
8cdc4674d7
223
apps/static/css/plugins/toastr/toastr.min.css
vendored
223
apps/static/css/plugins/toastr/toastr.min.css
vendored
File diff suppressed because one or more lines are too long
1
apps/static/js/plugins/toastr/toastr.js.map
Normal file
1
apps/static/js/plugins/toastr/toastr.js.map
Normal file
File diff suppressed because one or more lines are too long
4
apps/static/js/plugins/toastr/toastr.min.js
vendored
4
apps/static/js/plugins/toastr/toastr.min.js
vendored
File diff suppressed because one or more lines are too long
@ -211,6 +211,7 @@
|
||||
{% block custom_foot_js %}
|
||||
<script>
|
||||
jumpserver.selected_groups = {};
|
||||
|
||||
function updateUserGroups(user_groups) {
|
||||
var the_url = "{% url 'users:user-group-edit-api' pk=user_object.id %}";
|
||||
var body = {
|
||||
@ -235,8 +236,12 @@ function updateUserGroups(user_groups) {
|
||||
jumpserver.selected_groups = {};
|
||||
toastr.success('{% trans "UserGroup Update Success!" %}')
|
||||
};
|
||||
APIUpdateAttr({ url: the_url, body: JSON.stringify(body), success: success, method: 'PUT'});
|
||||
|
||||
APIUpdateAttr({
|
||||
url: the_url,
|
||||
body: JSON.stringify(body),
|
||||
success: success,
|
||||
method: 'PUT'
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2()
|
||||
@ -250,15 +255,27 @@ $(document).ready(function () {
|
||||
}).on('click', '#is_active', function() {
|
||||
var the_url = "{% url 'users:user-patch-api' pk=user_object.id %}";
|
||||
var checked = !$(this).prop('checked');
|
||||
var body = {'is_active': checked };
|
||||
var body = {
|
||||
'is_active': checked
|
||||
};
|
||||
var success = '{% trans "Update Successfully!" %}';
|
||||
APIUpdateAttr({ url: the_url, body: JSON.stringify(body), success_message: success});
|
||||
APIUpdateAttr({
|
||||
url: the_url,
|
||||
body: JSON.stringify(body),
|
||||
success_message: success
|
||||
});
|
||||
}).on('click', '#enable_otp', function() {
|
||||
var the_url = "{% url 'users:user-patch-api' pk=user_object.id %}";
|
||||
var checked = !$(this).prop('checked');
|
||||
var body = {'enable_otp': checked };
|
||||
var body = {
|
||||
'enable_otp': checked
|
||||
};
|
||||
var success = '{% trans "Update Successfully!" %}';
|
||||
APIUpdateAttr({ url: the_url, body: JSON.stringify(body), success_message: success});
|
||||
APIUpdateAttr({
|
||||
url: the_url,
|
||||
body: JSON.stringify(body),
|
||||
success_message: success
|
||||
});
|
||||
}).on('click', '#btn_add_user_group', function() {
|
||||
if (Object.keys(jumpserver.selected_groups).length === 0) {
|
||||
return false;
|
||||
@ -292,8 +309,12 @@ $(document).ready(function () {
|
||||
var success = function() {
|
||||
var msg = "{% trans 'E-mail sent successfully. An e-mail has been sent to the user\'s mailbox.' %}";
|
||||
swal("{% trans 'Password-Reset' %}", msg, "success");
|
||||
}
|
||||
APIUpdateAttr({ url: the_url, body: JSON.stringify(body), success: success});
|
||||
};
|
||||
APIUpdateAttr({
|
||||
url: the_url,
|
||||
body: JSON.stringify(body),
|
||||
success: success
|
||||
});
|
||||
}
|
||||
swal({
|
||||
title: "{% trans 'Are you sure?' %}",
|
||||
@ -305,8 +326,7 @@ $(document).ready(function () {
|
||||
closeOnConfirm: false
|
||||
}, function() {
|
||||
doReset();
|
||||
}
|
||||
);
|
||||
});
|
||||
}).on('click', '#btn_reset_pk', function() {
|
||||
function doReset() {
|
||||
var the_url = '{% url "users:user-reset-pk-api" pk=user_object.id %}';
|
||||
@ -314,8 +334,12 @@ $(document).ready(function () {
|
||||
var success = function() {
|
||||
var msg = "{% trans 'The reset-ssh-public-key E-mail has been sent successfully. Please inform the user to update his new ssh public key.' %}";
|
||||
swal("{% trans 'SSH-Public-Key Reset' %}", msg, "success");
|
||||
}
|
||||
APIUpdateAttr({ url: the_url, body: JSON.stringify(body), success: success});
|
||||
};
|
||||
APIUpdateAttr({
|
||||
url: the_url,
|
||||
body: JSON.stringify(body),
|
||||
success: success
|
||||
});
|
||||
}
|
||||
swal({
|
||||
title: "{% trans 'Are you sure?' %}",
|
||||
@ -327,8 +351,7 @@ $(document).ready(function () {
|
||||
closeOnConfirm: false
|
||||
}, function() {
|
||||
doReset();
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user