82 lines
3.8 KiB
Plaintext
82 lines
3.8 KiB
Plaintext
<div class="container mx-auto px-4 py-8">
|
|
<div class="flex justify-between items-center mb-8">
|
|
<h1 class="text-3xl font-bold text-gray-900">Video Library</h1>
|
|
<% if @storage_locations.any? %>
|
|
<%= link_to "New Storage Location", new_storage_location_path,
|
|
class: "bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition-colors" %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if @storage_locations.empty? %>
|
|
<div class="text-center py-12 bg-white rounded-lg shadow">
|
|
<div class="text-gray-500 text-lg mb-4">No storage locations found</div>
|
|
<p class="text-gray-600 mb-6">
|
|
Storage locations are automatically discovered from directories mounted under <code class="bg-gray-100 px-2 py-1 rounded">/videos</code>
|
|
</p>
|
|
<div class="text-sm text-gray-500">
|
|
<p class="mb-2">Example Docker volume mounts:</p>
|
|
<code class="block bg-gray-100 p-3 rounded text-left">
|
|
/path/to/movies:/videos/movies:ro<br>
|
|
/path/to/tv_shows:/videos/tv:ro<br>
|
|
/path/to/documentaries:/videos/docs:ro
|
|
</code>
|
|
</div>
|
|
</div>
|
|
<% else %>
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
<% @storage_locations.each do |storage_location| %>
|
|
<div class="bg-white rounded-lg shadow-md hover:shadow-lg transition-shadow">
|
|
<div class="p-6">
|
|
<h2 class="text-xl font-semibold text-gray-900 mb-2">
|
|
<%= link_to storage_location.name, storage_location,
|
|
class: "hover:text-blue-600 transition-colors" %>
|
|
</h2>
|
|
|
|
<div class="text-gray-600 text-sm mb-4">
|
|
<p class="mb-1">
|
|
<span class="font-medium">Path:</span>
|
|
<code class="bg-gray-100 px-1 py-0.5 rounded text-xs"><%= storage_location.path %></code>
|
|
</p>
|
|
<p class="mb-1">
|
|
<span class="font-medium">Type:</span>
|
|
<%= storage_location.storage_type.titleize %>
|
|
</p>
|
|
<p>
|
|
<span class="font-medium">Videos:</span>
|
|
<%= storage_location.video_count %>
|
|
</p>
|
|
</div>
|
|
|
|
<% if storage_location.accessible? %>
|
|
<div class="flex items-center text-green-600 text-sm mb-4">
|
|
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
|
</svg>
|
|
Accessible
|
|
</div>
|
|
<% else %>
|
|
<div class="flex items-center text-red-600 text-sm mb-4">
|
|
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
|
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/>
|
|
</svg>
|
|
Not Accessible
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="flex space-x-2">
|
|
<%= link_to "View Videos", storage_location,
|
|
class: "bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-3 rounded text-sm transition-colors" %>
|
|
|
|
<%= form_with(url: scan_storage_location_path(storage_location), method: :post,
|
|
class: "inline-flex") do |form| %>
|
|
<%= form.submit "Scan",
|
|
class: "bg-gray-600 hover:bg-gray-700 text-white font-medium py-2 px-3 rounded text-sm cursor-pointer transition-colors" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|