mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 13:28:35 +01:00
Add filter form for OpenHandler
Provide a form to search for method/uri/ip. Doesn't seem to handle multiple filters at once, but that seems a server-side problem. Also, improvement could be to fill the form when clicking on a link, but it works :)
This commit is contained in:
parent
7fb14da75b
commit
ef41586ae0
@ -58,6 +58,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
self.hide();
|
self.hide();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.addSearch();
|
||||||
|
|
||||||
this.$overlay = $('<div />').addClass(csscls('overlay')).hide().appendTo('body');
|
this.$overlay = $('<div />').addClass(csscls('overlay')).hide().appendTo('body');
|
||||||
this.$overlay.on('click', function() {
|
this.$overlay.on('click', function() {
|
||||||
@ -70,6 +72,33 @@ if (typeof(PhpDebugBar) == 'undefined') {
|
|||||||
this.$loadmorebtn.show();
|
this.$loadmorebtn.show();
|
||||||
this.find({}, 0, this.handleFind.bind(this));
|
this.find({}, 0, this.handleFind.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addSearch: function(){
|
||||||
|
var self = this;
|
||||||
|
var searchBtn = $('<button />')
|
||||||
|
.text('Search')
|
||||||
|
.on('click', function(e) {
|
||||||
|
self.$table.empty();
|
||||||
|
var search = {};
|
||||||
|
var a = $(this).parent().serializeArray();
|
||||||
|
$.each(a, function() {
|
||||||
|
if(this.value){
|
||||||
|
search[this.name] = this.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
self.find(search, 0, self.handleFind.bind(self));
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('<form />')
|
||||||
|
.append('<br/><b>Filter results</b><br/>')
|
||||||
|
.append('Method: <select name="method"><option></option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select><br/>')
|
||||||
|
.append('Uri: <input type="text" name="uri"><br/>')
|
||||||
|
.append('IP: <input type="text" name="ip"><br/>')
|
||||||
|
.append(searchBtn)
|
||||||
|
.appendTo(this.$actions);
|
||||||
|
},
|
||||||
|
|
||||||
handleFind: function(data) {
|
handleFind: function(data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user