solid_litequeen 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76ba9e2dc8bd46eb5a1c1451a2ec50997f4752be0b40e63d6327d29dbb371a42
4
- data.tar.gz: 3fd62654db0ed40e63356ebe47f9e09ba6b06f4846b9d3624ca628b794b3a5de
3
+ metadata.gz: f9ea219d6e8a41230ac06a3cfbbd7bc15e4005c8e0744a329bed82dc01e2d252
4
+ data.tar.gz: 9650a0ddd050018b17a044e3c8320b367d8fdc054e4ebe1ca0dc99453651239d
5
5
  SHA512:
6
- metadata.gz: fc01d4bd36e6dcd9b781f23ad688591a992d2f12648f938d3e6cf4f5cb2d8fdb0a5dbf8aa51d71c38e170e69c6d9a0f16d68834ac98a5dc825781c04f3002a17
7
- data.tar.gz: f9c5f557e58e3184276fe1f0f06e0b68a0aea507164b47d23dbc7108871a6110bd8867b80565d48bf0ec5efce959c74ee5600469f9e2be52ccf666b18f26d2ac
6
+ metadata.gz: fa23b13e73d5fb47a9b569b1b222fc0614bbe10c19d0a0b98a996e32cdc519f76ad84f5ca32b2df9d97fd5009f6c158061d3c253979e1c96b2e1f6b1757c0d13
7
+ data.tar.gz: ccf90477b30454b6836011ff25cb5b619627afb0b3010c8c5bea95844ca456a6cbe075153819fcfbb7ffb08258fb7d3214b580cf50774ad936c9ec6d4cd2a16b
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left"><path d="m15 18-6-6 6-6"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg>
@@ -39,7 +39,27 @@ module SolidLitequeen
39
39
  database: @database_location
40
40
  )
41
41
 
42
- @data = DynamicDatabase.connection.select_all("SELECT * FROM #{@table_name} LIMIT 100")
42
+ @data = DynamicDatabase.connection.select_all("SELECT * FROM #{@table_name} LIMIT 50")
43
+ end
44
+
45
+ def download
46
+ database_id = params.expect(:id)
47
+ database_location = Base64.urlsafe_decode64(database_id)
48
+
49
+ # Verify the file exists
50
+ unless File.exist?(database_location)
51
+ flash[:error] = "Database file not found"
52
+ redirect_to databases_path and return
53
+ end
54
+
55
+ # Get the filename from the path
56
+ filename = File.basename(database_location)
57
+
58
+ # Send the file as a download
59
+ send_file database_location,
60
+ filename: filename,
61
+ type: "application/x-sqlite3",
62
+ disposition: "attachment"
43
63
  end
44
64
  end
45
65
  end
@@ -7,7 +7,7 @@
7
7
 
8
8
  <%= yield :head %>
9
9
 
10
- <%= stylesheet_link_tag "solid_litequeen/application", media: "all" %>
10
+ <%= stylesheet_link_tag "solid_litequeen/application", media: "all" %>
11
11
  <script src="https://unpkg.com/@tailwindcss/browser@4"></script>
12
12
  <style type="text/tailwindcss">
13
13
 
@@ -1,5 +1,10 @@
1
1
  <div class="container mx-auto px-4 py-8">
2
- <h1 class="text-3xl font-bold text-gray-900 mb-6">Database: <%= @database_location %></h1>
2
+ <h1 class="text-3xl font-bold text-gray-900 mb-6 flex gap-1 items-center justify-center">
3
+ <%= image_tag "solid_litequeen/icons/database.svg", class: "size-6" %>
4
+ <span>
5
+ <%= @database_location %>
6
+ </span>
7
+ </h1>
3
8
 
4
9
  <div class="mb-6">
5
10
  <h2 class="text-xl font-semibold text-gray-800">Tables</h2>
@@ -30,4 +35,5 @@
30
35
  </tbody>
31
36
  </table>
32
37
  </div>
38
+ <%= link_to "Download Database", database_download_path(@database_id), class: "btn btn-primary text-xs mt-4" %>
33
39
  </div>
@@ -1,5 +1,15 @@
1
1
  <div class="container mx-auto px-4 py-8">
2
- <h1 class="text-3xl font-bold text-gray-900 mb-6">Database: <%= @database_location %> - Table: <%= @table_name %></h1>
2
+ <h1 class="text-3xl font-bold text-gray-900 mb-6 flex gap-1 items-center justify-center">
3
+ <%= link_to database_path(params[:database_id]) do %>
4
+ <%= image_tag "solid_litequeen/icons/database.svg", class: "size-6" %>
5
+ <% end %>
6
+
7
+ <%= image_tag "solid_litequeen/icons/chevron-right.svg", class: "size-6" %>
8
+
9
+ <span>
10
+ <%= @table_name %>
11
+ </span>
12
+ </h1>
3
13
 
4
14
  <div class="mb-6">
5
15
  <p class="text-gray-600"><%= pluralize(@data.rows.count, "row") %> found</p>
data/config/routes.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  SolidLitequeen::Engine.routes.draw do
2
2
  resources :databases, only: [ :index, :show ] do
3
- get ":table", to: "databases#table_rows", as: :table_rows
3
+ get "/tables/:table", to: "databases#table_rows", as: :table_rows
4
+ get "databases/:id/download", to: "databases#download", as: "download"
4
5
  end
5
6
  root to: "databases#index"
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module SolidLitequeen
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_litequeen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vik Borges
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-26 00:00:00.000000000 Z
11
+ date: 2025-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -147,6 +147,9 @@ files:
147
147
  - MIT-LICENSE
148
148
  - README.md
149
149
  - Rakefile
150
+ - app/assets/images/solid_litequeen/icons/chevron-left.svg
151
+ - app/assets/images/solid_litequeen/icons/chevron-right.svg
152
+ - app/assets/images/solid_litequeen/icons/database.svg
150
153
  - app/assets/stylesheets/solid_litequeen/application.css
151
154
  - app/controllers/solid_litequeen/application_controller.rb
152
155
  - app/controllers/solid_litequeen/databases_controller.rb