You've already forked haproxy-wi
mirror of
https://github.com/roxy-wi/roxy-wi.git
synced 2025-12-18 12:04:07 +08:00
v7.2.5.0: Refactor execution of group changes in user settings
This commit streamlines the way user group data is handled, both in scripts and server-side logic. The group settings URL has been simplified and the logic for updating user groups also has been optimized. Eliminated unnecessary checks in the user.py module, and updated the routing logic for group data to utilize a single route with HTTP GET and PUT methods. Removed unsuccessful group changing errors.
This commit is contained in:
@@ -941,7 +941,7 @@ $( function() {
|
||||
$('#disable_alerting').prop('checked', true).checkboxradio('refresh');
|
||||
}
|
||||
$.ajax({
|
||||
url: "/app/user/group/current",
|
||||
url: "/app/user/group",
|
||||
success: function (data) {
|
||||
if (data.indexOf('danger') != '-1') {
|
||||
$("#ajax").html(data);
|
||||
@@ -1184,21 +1184,20 @@ createHistroy();
|
||||
listHistroy();
|
||||
|
||||
function changeCurrentGroupF() {
|
||||
Cookies.remove('group');
|
||||
Cookies.set('group', $('#newCurrentGroup').val(), {expires: 365, path: '/', samesite: 'strict', secure: 'true'});
|
||||
$.ajax({
|
||||
url: "/app/user/group/change",
|
||||
url: "/app/user/group",
|
||||
data: {
|
||||
changeUserCurrentGroupId: $('#newCurrentGroup').val(),
|
||||
changeUserGroupsUser: Cookies.get('uuid'),
|
||||
token: $('#token').val()
|
||||
group: $('#newCurrentGroup').val(),
|
||||
uuid: Cookies.get('uuid')
|
||||
},
|
||||
type: "POST",
|
||||
type: "PUT",
|
||||
success: function (data) {
|
||||
if (data.indexOf('error: ') != '-1') {
|
||||
toastr.error(data);
|
||||
} else {
|
||||
toastr.clear();
|
||||
Cookies.remove('group');
|
||||
Cookies.set('group', $('#newCurrentGroup').val(), {expires: 365, path: '/', samesite: 'strict', secure: 'true'});
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user