Commit efbcdb4d
Changed files (5)
app
controllers
admin
views
admin
blobs
shared
config
app/controllers/admin/blobs_controller.rb
@@ -0,0 +1,22 @@
+module Admin
+ class BlobsController < AdminController
+ def index
+ @objects = bucket.objects
+ end
+
+ def show
+ @object = bucket.objects[params[:id]]
+ end
+
+ private
+
+ def connection
+ @connection ||= AWS::S3.new
+ end
+
+ def bucket
+ bucket_name = ENV['FOG_DIRECTORY']
+ connection.buckets[bucket_name]
+ end
+ end
+end
app/views/admin/blobs/index.html.erb
@@ -0,0 +1,22 @@
+<div class="row-fluid">
+ <div class="span12">
+ <%= render partial: 'admin/shared/admin_nav' %>
+ <h1>Blobs <small><%= @objects.count %></small></h1>
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>bucket</th>
+ <th>key</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @objects.each do |object| %>
+ <tr>
+ <td><%= object.bucket.name %></td>
+ <td><%= link_to object.key, admin_blob_path(object.key) %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+</div>
app/views/admin/blobs/show.html.erb
@@ -0,0 +1,27 @@
+<div class="row-fluid">
+ <div class="span12">
+ <h1>Blob <small><%= @object.key %></small></h1>
+ <p><%= link_to "<< Back", admin_blobs_path %></p>
+ <table class="table table-condensed">
+ <thead>
+ <tr>
+ <th>id</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><%= link_to @object.key, admin_blob_path(@object.key) %></td>
+ </tr>
+ </tbody>
+ </table>
+ <ul>
+ <li><%= @object.acl %></li>
+ <li><%= @object.versions %></li>
+ <li><%= @object.public_url %></li>
+ <li><%= @object.last_modified %></li>
+ <li><%= @object.etag %></li>
+ <li><%= @object.content_type %></li>
+ <li><%= @object.content_length %></li>
+ </ul>
+ </div>
+</div>
config/routes.rb
@@ -57,6 +57,7 @@ Cake::Application.routes.draw do
resources :activities, only: [:index]
resources :subscriptions, only: [:index]
resources :photos, only: [:index, :show]
+ resources :blobs, only: [:index, :show]
resources :errors, only: [:index, :create]
end