Permalink
Browse files

bugfixes

  • Loading branch information...
Joel Karlsson
Joel Karlsson committed Jan 13, 2012
1 parent 8eb97c8 commit a2f3b1b6a2465b7c82f19a87d49cfffee58d9604
Showing with 13 additions and 3 deletions.
  1. +8 −2 public/scripts/dataset.js
  2. +2 −0 server.rb
  3. +3 −1 views/dataset.erb
View
@@ -90,9 +90,12 @@ function update_datatable(attrs)
return function(data)
{
- var table = $('#data');
- table.children().remove();
+ $('#data').empty();
+
+ var table = $('<table>');
+
+ table.empty();
var tr = $('<tr>').append($('<th>').text('#'));
for ( var a in attrs )
@@ -147,6 +150,9 @@ function update_datatable(attrs)
table.append(tbody);
table.tablesorter({ sortList : [[0,0]] })
.tablesorterFilter({ filterContainer : '#filter' });
+
+ $('#data').append(table);
+
$('#pacman').fadeOut('fast');
};
}
View
@@ -97,6 +97,8 @@ class Server < Sinatra::Base
fields = {}
params.each_pair { |k,v| fields[k] = v.to_i if k != 'captures' && k != 'ip' }
+ fields['ip'] = 0
+
if fields.count > 0
response.body = collection.find({}, { :fields => fields, :sort => 'timestamp'}).to_json
else
View
@@ -40,7 +40,9 @@
</div>
<div class="content" style="padding-right:20px;padding-left: 20px;">
<h3>Data</h3>
- <table id="data" class="zebra-striped condensed-table">
+ <div id="data">
+ <table class="zebra-striped condensed-table">
+ </div>
</table>
<div id="pacman"></div>
</div>

0 comments on commit a2f3b1b

Please sign in to comment.