Skip to content

Commit 10fe80f

Browse files
gravisdefunkt
authored andcommitted
Fix key viewing in stats. Sets (or eq. like zsets, lists) now have pagination.
1 parent a5c8449 commit 10fe80f

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<% if key = params[:key] %>
2+
3+
<p class='sub'>
4+
Showing <%= start = params[:start].to_i %> to <%= start + 20 %> of <b><%=size = redis_get_size(key) %></b>
5+
</p>
6+
7+
8+
<h1>Key "<%= key %>" is a <%= resque.redis.type key %></h1>
9+
<table>
10+
<% for row in redis_get_value_as_array(key, start) %>
11+
<tr>
12+
<td>
13+
<%= row %>
14+
</td>
15+
</tr>
16+
<% end %>
17+
</table>
18+
19+
<%= partial :next_more, :start => start, :size => size %>
20+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
<% if key = params[:key] %>
2-
32
<h1>Key "<%= key %>" is a <%= resque.redis.type key %></h1>
43
<h2>size: <%= redis_get_size(key) %></h2>
54
<table>
6-
<% for row in redis_get_value_as_array(key) %>
75
<tr>
86
<td>
9-
<%= row %>
7+
<%= redis_get_value_as_array(key) %>
108
</td>
119
</tr>
12-
<% end %>
1310
</table>
14-
15-
<% else %>
16-
17-
<% end %>
11+
<% end %>

lib/resque/server/views/stats.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
<% if params[:key] %>
44

5-
<%= partial :key %>
5+
<%#= partial resque.redis.type :key %>
6+
<%= partial resque.redis.type(params[:key]).eql?("string") ? :key_string : :key_sets %>
67

78
<% elsif params[:id] == "resque" %>
89

@@ -59,4 +60,4 @@
5960

6061
<% else %>
6162

62-
<% end %>
63+
<% end %>

0 commit comments

Comments
 (0)