Commit ca9bdfeb authored by Heinz N. Gies's avatar Heinz N. Gies

Show bucket details

parent 1c63296f
......@@ -41,6 +41,10 @@
<thead>
<tr>
<th>Bucket</th>
<th>Resolution</th>
<th>PPF</th>
<th>Grace</th>
<th>TTL</th>
</tr>
</thead>
<tbody id="buckets">
......
......@@ -2,7 +2,13 @@ $(function() {
msgpack.download("", {header: {accept:"application/x-msgpack"}}, function(d) {
console.log(d)
d.forEach(function(e) {
$("#buckets").append("<tr><td><a href='/buckets/"+ e + "'>" + e +"</a></td></tr>")
$("#buckets").append("<tr>"+
"<td><a href='/buckets/"+ e.name + "'>" + e.name +"</a></td>"+
"<td>" + e.resolution + "ms</td>"+
"<td>" + e.ppf + "</td>"+
"<td>" + e.grace + "ns</td>"+
"<td>" + e.ttl + "</td>"+
"</tr>")
})
})
})
......@@ -24,8 +24,17 @@ handle(Req, State) ->
{ok, Req3, State};
_ ->
{ok, Bs} = ddb_connection:list(),
dalmatiner_idx_handler:send(ContentType, Bs, Req1, State)
Bs1 = [bucket_info(B) || B <- Bs],
dalmatiner_idx_handler:send(ContentType, Bs1, Req1, State)
end.
terminate(_Reason, _Req, _State) ->
ok.
bucket_info(B) ->
case ddb_connection:info(B) of
{ok, I} ->
I#{name => B};
_ ->
#{name => B}
end.
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 to comment