dbviewer 0.3.5 → 0.3.15

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.
@@ -551,6 +551,25 @@
551
551
  .stat-card-bg {
552
552
  background-color: var(--bs-light);
553
553
  }
554
+
555
+ /* Metric icon styling */
556
+ .metric-icon {
557
+ display: flex;
558
+ align-items: center;
559
+ justify-content: center;
560
+ border-radius: 50%;
561
+ width: 60px;
562
+ height: 60px;
563
+ min-width: 60px;
564
+ text-align: center;
565
+ background-color: rgba(var(--bs-primary-rgb), 0.1);
566
+ color: var(--bs-primary);
567
+ }
568
+
569
+ [data-bs-theme="dark"] .metric-icon {
570
+ background-color: rgba(13, 110, 253, 0.2);
571
+ color: #6ea8fe;
572
+ }
554
573
  </style>
555
574
  </head>
556
575
  <body>
@@ -571,9 +590,11 @@
571
590
  <li class="nav-item">
572
591
  <%= link_to raw('<i class="bi bi-diagram-3"></i> ERD'), dbviewer.entity_relationship_diagrams_path, class: "nav-link #{erd_nav_class}" %>
573
592
  </li>
574
- <li class="nav-item">
575
- <%= link_to raw('<i class="bi bi-journal-code"></i> SQL Logs'), dbviewer.logs_path, class: "nav-link #{logs_nav_class}" %>
576
- </li>
593
+ <% if Dbviewer.configuration.enable_query_logging %>
594
+ <li class="nav-item">
595
+ <%= link_to raw('<i class="bi bi-journal-code"></i> SQL Logs'), dbviewer.logs_path, class: "nav-link #{logs_nav_class}" %>
596
+ </li>
597
+ <% end %>
577
598
  </ul>
578
599
  <ul class="navbar-nav ms-auto">
579
600
  <li class="nav-item">
@@ -603,6 +624,17 @@
603
624
  <!-- Main Content Area -->
604
625
  <div class="dbviewer-main">
605
626
  <div class="dbviewer-main-content">
627
+ <!-- Flash Messages -->
628
+ <% if flash.any? %>
629
+ <% flash.each do |type, message| %>
630
+ <% alert_class = type.to_s == 'notice' ? 'alert-info' : 'alert-danger' %>
631
+ <div class="alert <%= alert_class %> alert-dismissible fade show mb-3" role="alert">
632
+ <%= message %>
633
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
634
+ </div>
635
+ <% end %>
636
+ <% end %>
637
+
606
638
  <div class="d-flex d-lg-none align-items-center mb-3">
607
639
  <button class="btn btn-sm btn-outline-primary dbviewer-sidebar-toggle" type="button">
608
640
  <i class="bi bi-list me-1"></i> Tables
data/config/routes.rb CHANGED
@@ -4,6 +4,7 @@ Dbviewer::Engine.routes.draw do
4
4
  get "query"
5
5
  post "query"
6
6
  get "export_csv"
7
+ get "mini_erd"
7
8
  end
8
9
  end
9
10
 
@@ -31,6 +31,9 @@ module Dbviewer
31
31
  # Maximum number of queries to keep in memory
32
32
  attr_accessor :max_memory_queries
33
33
 
34
+ # Enable or disable query logging completely
35
+ attr_accessor :enable_query_logging
36
+
34
37
  # Admin access credentials hash with :username and :password keys
35
38
  # @example { username: 'admin', password: 'secret' }
36
39
  attr_accessor :admin_credentials
@@ -46,6 +49,7 @@ module Dbviewer
46
49
  @query_logging_mode = :memory
47
50
  @query_log_path = "log/dbviewer.log"
48
51
  @max_memory_queries = 1000
52
+ @enable_query_logging = true
49
53
  @admin_credentials = nil
50
54
  end
51
55
  end
@@ -10,6 +10,8 @@ module Dbviewer
10
10
 
11
11
  # Add a new SQL event query to the logger
12
12
  def add(event)
13
+ # Return early if query logging is disabled
14
+ return unless Dbviewer.configuration.enable_query_logging
13
15
  return if QueryParser.should_skip_query?(event)
14
16
 
15
17
  current_time = Time.now
@@ -1,3 +1,3 @@
1
1
  module Dbviewer
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbviewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wailan Tirajoh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-19 00:00:00.000000000 Z
11
+ date: 2025-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -77,6 +77,7 @@ files:
77
77
  - app/views/dbviewer/shared/_sidebar.html.erb
78
78
  - app/views/dbviewer/tables/_table_structure.html.erb
79
79
  - app/views/dbviewer/tables/index.html.erb
80
+ - app/views/dbviewer/tables/mini_erd.html.erb
80
81
  - app/views/dbviewer/tables/query.html.erb
81
82
  - app/views/dbviewer/tables/show.html.erb
82
83
  - app/views/layouts/dbviewer/application.html.erb