mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-05 17:30:30 +00:00
[Fixture] 添加command log backends, 未来支持es
This commit is contained in:
@@ -187,28 +187,28 @@ function activeNav() {
|
||||
}
|
||||
|
||||
function APIUpdateAttr(props) {
|
||||
// props = {url: .., body: , success: , error: , method: ,}
|
||||
props = props || {};
|
||||
var success_message = props.success_message || 'Update Successfully!';
|
||||
var fail_message = props.fail_message || 'Error occurred while updating.';
|
||||
$.ajax({
|
||||
url: props.url,
|
||||
type: props.method || "PATCH",
|
||||
data: props.body,
|
||||
contentType: props.content_type || "application/json; charset=utf-8",
|
||||
dataType: props.data_type || "json"
|
||||
}).done(function(data, textStatue, jqXHR) {
|
||||
toastr.success(success_message);
|
||||
if (typeof props.success === 'function') {
|
||||
return props.success(data);
|
||||
}
|
||||
|
||||
}).fail(function(jqXHR, textStatue, errorThrown) {
|
||||
toastr.error(fail_message);
|
||||
if (typeof props.error === 'function') {
|
||||
return props.error(errorThrown);
|
||||
}
|
||||
});
|
||||
// props = {url: .., body: , success: , error: , method: ,}
|
||||
props = props || {};
|
||||
var success_message = props.success_message || 'Update Successfully!';
|
||||
var fail_message = props.fail_message || 'Error occurred while updating.';
|
||||
$.ajax({
|
||||
url: props.url,
|
||||
type: props.method || "PATCH",
|
||||
data: props.body,
|
||||
contentType: props.content_type || "application/json; charset=utf-8",
|
||||
dataType: props.data_type || "json"
|
||||
}).done(function(data, textStatue, jqXHR) {
|
||||
toastr.success(success_message);
|
||||
if (typeof props.success === 'function') {
|
||||
return props.success(data);
|
||||
}
|
||||
|
||||
}).fail(function(jqXHR, textStatue, errorThrown) {
|
||||
toastr.error(fail_message);
|
||||
if (typeof props.error === 'function') {
|
||||
return props.error(errorThrown);
|
||||
}
|
||||
});
|
||||
// return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user