Commit a24667bb by Bence Dányi

firewall_gui: provide typeahead for various fields

parent 2810e1e2
......@@ -153,6 +153,25 @@ function EntityController(url) {
return true;
}
});
['vlan', 'host', 'firewall'].forEach(function(t) {
$('#' + t).typeahead({
source: function(query, process) {
$.ajax({
url: '/firewall/autocomplete/' + t + '/',
type: 'post',
data: 'name=' + query,
success: function autocompleteSuccess(data) {
process(data.map(function(obj) {
return obj.name;
}));
}
});
},
matcher: function() {
return true;
}
});
})
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment