|
@@ -22,10 +22,12 @@
|
|
|
|
|
|
client.onreceive = function(m) {};
|
|
|
|
|
|
+ var max_packets = 100;
|
|
|
+
|
|
|
var on_connect = function(x) {
|
|
|
id = client.subscribe("/queue/kea", function(m) {
|
|
|
- if ($('#tbody tr').length >= 100) {
|
|
|
- $('#tbody tr:last').remove();
|
|
|
+ if ($('#tbody tr').length >= max_packets) {
|
|
|
+ $('#tbody td:not(:contains("' + $filter + '"))').last().parent('tr').remove();
|
|
|
}
|
|
|
|
|
|
$('#tbody').prepend($("<tr>").append($('<td class="sonata-ba-list-field sonata-ba-list-field-text td-bordered">').text(m.body)));
|
|
@@ -52,7 +54,7 @@
|
|
|
var $filter = $('#filter').val();
|
|
|
|
|
|
if ($filter.length >= 3) {
|
|
|
- $('#tbody td:not(:contains("'+$filter+'"))').hide();
|
|
|
+ $('#tbody td:not(:contains("' + $filter + '"))').hide();
|
|
|
} else {
|
|
|
$('#tbody td').show();
|
|
|
}
|
|
@@ -67,7 +69,14 @@
|
|
|
e.preventDefault();
|
|
|
|
|
|
return false;
|
|
|
-
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#max_packets').on('change', function() {
|
|
|
+ var $value = parseInt($(this).val(), 10);
|
|
|
+ if ($value && $value >= 100) {
|
|
|
+ max_packets = $value;
|
|
|
+ console.log('max packets', max_packets);
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
</script>
|
|
@@ -117,8 +126,13 @@
|
|
|
{{ 'Filter'|trans({}, 'KeaBundle') }}
|
|
|
</h4>
|
|
|
<form style="float: left;">
|
|
|
- <input id="filter" autocomplete="off"></input>
|
|
|
+ <input id="filter" style="width: 220px;" autocomplete="off"></input>
|
|
|
</form>
|
|
|
+ <br /><br />
|
|
|
+ <h4 class="box-title" style="float: left; margin-right: 5px;">
|
|
|
+ {{ 'Packets'|trans({}, 'KeaBundle') }}
|
|
|
+ </h4>
|
|
|
+ <input id="max_packets" min="100" max="1000" style="width: 220px;" type="number" value=100 placeholder="{{ 'insert a number upper to 100'|trans({}, 'KeaBundle') }}" title="{{ 'insert a number upper to 100'|trans({}, 'KeaBundle') }}">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|