Skip to content

Commit

Permalink
Merge pull request #6 from hhz-saner/fix-js
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
z-song authored Nov 26, 2018
2 parents 391d683 + 80c3c48 commit bada3f7
Showing 1 changed file with 39 additions and 35 deletions.
74 changes: 39 additions & 35 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,25 @@
title: "Delete key ["+key+"] ?",
type: "error",
showCancelButton: true
},
function(){
var params = {
conn: "{{ $conn }}",
key: key,
_token: LA.token
};
$.ajax({
url: '{{ route('redis-key-delete') }}',
type: 'DELETE',
data: params,
success: function(result) {
toastr.success('Key '+key+' deleted');
$.pjax.reload('#pjax-container');
}
});
}).then(function (result) {
if (result.value) {
var params = {
conn: "{{ $conn }}",
key: key,
_token: LA.token
};
$.ajax({
url: '{{ route('redis-key-delete') }}',
type: 'DELETE',
data: params,
success: function (result) {
toastr.success('Key ' + key + ' deleted');
$.pjax.reload('#pjax-container');
}
});
}
});
});
Expand All @@ -143,24 +145,26 @@ function(){
title: "Delete selected keys ?",
type: "error",
showCancelButton: true
},
function(){
var params = {
conn: "{{ $conn }}",
key: keys,
_token: LA.token
};
$.ajax({
url: '{{ route('redis-key-delete') }}',
type: 'DELETE',
data: params,
success: function(result) {
toastr.success(params.key.length+' keys deleted');
$.pjax.reload('#pjax-container');
}
});
}).then(function (result) {
if (result.value) {
var params = {
conn: "{{ $conn }}",
key: keys,
_token: LA.token
};
$.ajax({
url: '{{ route('redis-key-delete') }}',
type: 'DELETE',
data: params,
success: function (result) {
toastr.success(params.key.length + ' keys deleted');
$.pjax.reload('#pjax-container');
}
});
}
});
});
Expand Down

0 comments on commit bada3f7

Please sign in to comment.