dbwatcher 1.1.1 → 1.1.3

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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -2
  3. data/app/assets/config/dbwatcher_manifest.js +1 -0
  4. data/app/assets/javascripts/dbwatcher/components/changes_table_hybrid.js +196 -119
  5. data/app/assets/javascripts/dbwatcher/components/dashboard.js +325 -0
  6. data/app/assets/javascripts/dbwatcher/components/timeline.js +211 -0
  7. data/app/assets/javascripts/dbwatcher/dbwatcher.js +5 -0
  8. data/app/assets/stylesheets/dbwatcher/application.css +691 -41
  9. data/app/assets/stylesheets/dbwatcher/application.scss +5 -0
  10. data/app/assets/stylesheets/dbwatcher/components/_badges.scss +68 -23
  11. data/app/assets/stylesheets/dbwatcher/components/_compact_table.scss +83 -26
  12. data/app/assets/stylesheets/dbwatcher/components/_diagrams.scss +3 -3
  13. data/app/assets/stylesheets/dbwatcher/components/_navigation.scss +9 -0
  14. data/app/assets/stylesheets/dbwatcher/components/_tabulator.scss +248 -0
  15. data/app/assets/stylesheets/dbwatcher/components/_timeline.scss +326 -0
  16. data/app/assets/stylesheets/dbwatcher/vendor/_tabulator_overrides.scss +37 -0
  17. data/app/controllers/dbwatcher/api/v1/sessions_controller.rb +18 -4
  18. data/app/controllers/dbwatcher/api/v1/system_info_controller.rb +180 -0
  19. data/app/controllers/dbwatcher/dashboard/system_info_controller.rb +64 -0
  20. data/app/controllers/dbwatcher/dashboard_controller.rb +17 -0
  21. data/app/controllers/dbwatcher/sessions_controller.rb +3 -19
  22. data/app/helpers/dbwatcher/application_helper.rb +43 -11
  23. data/app/helpers/dbwatcher/diagram_helper.rb +0 -88
  24. data/app/views/dbwatcher/dashboard/_layout.html.erb +27 -0
  25. data/app/views/dbwatcher/dashboard/_overview.html.erb +188 -0
  26. data/app/views/dbwatcher/dashboard/_system_info.html.erb +22 -0
  27. data/app/views/dbwatcher/dashboard/_system_info_content.html.erb +389 -0
  28. data/app/views/dbwatcher/dashboard/index.html.erb +8 -177
  29. data/app/views/dbwatcher/sessions/_layout.html.erb +26 -0
  30. data/app/views/dbwatcher/sessions/{_summary_tab.html.erb → _summary.html.erb} +1 -1
  31. data/app/views/dbwatcher/sessions/_tables.html.erb +170 -0
  32. data/app/views/dbwatcher/sessions/_timeline.html.erb +260 -0
  33. data/app/views/dbwatcher/sessions/index.html.erb +107 -87
  34. data/app/views/dbwatcher/sessions/show.html.erb +12 -4
  35. data/app/views/dbwatcher/tables/index.html.erb +32 -40
  36. data/app/views/layouts/dbwatcher/application.html.erb +101 -48
  37. data/config/routes.rb +25 -7
  38. data/lib/dbwatcher/configuration.rb +18 -1
  39. data/lib/dbwatcher/services/analyzers/table_summary_builder.rb +102 -1
  40. data/lib/dbwatcher/services/api/{changes_data_service.rb → tables_data_service.rb} +6 -6
  41. data/lib/dbwatcher/services/base_service.rb +2 -0
  42. data/lib/dbwatcher/services/system_info/database_info_collector.rb +263 -0
  43. data/lib/dbwatcher/services/system_info/machine_info_collector.rb +387 -0
  44. data/lib/dbwatcher/services/system_info/runtime_info_collector.rb +328 -0
  45. data/lib/dbwatcher/services/system_info/system_info_collector.rb +114 -0
  46. data/lib/dbwatcher/services/timeline_data_service/enhancement_utilities.rb +100 -0
  47. data/lib/dbwatcher/services/timeline_data_service/entry_builder.rb +125 -0
  48. data/lib/dbwatcher/services/timeline_data_service/metadata_builder.rb +93 -0
  49. data/lib/dbwatcher/services/timeline_data_service.rb +130 -0
  50. data/lib/dbwatcher/storage/api/concerns/table_analyzer.rb +1 -1
  51. data/lib/dbwatcher/storage/concerns/error_handler.rb +6 -6
  52. data/lib/dbwatcher/storage/session.rb +5 -0
  53. data/lib/dbwatcher/storage/system_info_storage.rb +242 -0
  54. data/lib/dbwatcher/storage.rb +12 -0
  55. data/lib/dbwatcher/version.rb +1 -1
  56. data/lib/dbwatcher.rb +16 -2
  57. metadata +28 -16
  58. data/app/helpers/dbwatcher/component_helper.rb +0 -29
  59. data/app/views/dbwatcher/sessions/_changes_tab.html.erb +0 -265
  60. data/app/views/dbwatcher/sessions/_tab_navigation.html.erb +0 -12
  61. data/app/views/dbwatcher/sessions/changes.html.erb +0 -21
  62. data/app/views/dbwatcher/sessions/components/changes/_filters.html.erb +0 -44
  63. data/app/views/dbwatcher/sessions/components/changes/_table_list.html.erb +0 -96
  64. data/app/views/dbwatcher/sessions/diagrams.html.erb +0 -21
  65. data/app/views/dbwatcher/sessions/shared/_layout.html.erb +0 -8
  66. data/app/views/dbwatcher/sessions/shared/_navigation.html.erb +0 -35
  67. data/app/views/dbwatcher/sessions/shared/_session_header.html.erb +0 -25
  68. data/app/views/dbwatcher/sessions/summary.html.erb +0 -21
  69. /data/app/views/dbwatcher/sessions/{_diagrams_tab.html.erb → _diagrams.html.erb} +0 -0
@@ -13,3 +13,8 @@
13
13
  @import "components/forms";
14
14
  @import "components/badges";
15
15
  @import "components/diagrams";
16
+ @import "components/tabulator";
17
+ @import "components/timeline";
18
+
19
+ // Vendor overrides - must be imported after our components
20
+ @import "vendor/tabulator_overrides";
@@ -3,27 +3,7 @@
3
3
  * Operation and status indicators
4
4
  */
5
5
 
6
- /* Status badges */
7
- .badge-insert {
8
- background: var(--status-insert);
9
- color: white;
10
- }
11
-
12
- .badge-update {
13
- background: var(--status-update);
14
- color: white;
15
- }
16
-
17
- .badge-delete {
18
- background: var(--status-delete);
19
- color: white;
20
- }
21
-
22
- .badge-select {
23
- background: var(--status-select);
24
- color: white;
25
- }
26
-
6
+ /* Base badge style */
27
7
  .badge {
28
8
  padding: 1px 6px;
29
9
  font-size: 10px;
@@ -31,8 +11,73 @@
31
11
  font-weight: 500;
32
12
  text-transform: uppercase;
33
13
  display: inline-block;
34
- width: 18px;
14
+ min-width: 18px;
35
15
  height: 18px;
36
16
  line-height: 18px;
37
17
  text-align: center;
38
- }
18
+ }
19
+
20
+ /* Operation type badges */
21
+ .badge-insert {
22
+ background: var(--status-insert, #10b981);
23
+ color: white;
24
+ }
25
+
26
+ .badge-update {
27
+ background: var(--status-update, #6CADDF);
28
+ color: white;
29
+ }
30
+
31
+ .badge-delete {
32
+ background: var(--status-delete, #ef4444);
33
+ color: white;
34
+ }
35
+
36
+ .badge-select {
37
+ background: var(--status-select, #6b7280);
38
+ color: white;
39
+ }
40
+
41
+ /* Status badges */
42
+ .badge-success {
43
+ background: var(--status-insert, #10b981);
44
+ color: white;
45
+ }
46
+
47
+ .badge-primary {
48
+ background: var(--blue-medium, #3b82f6);
49
+ color: white;
50
+ }
51
+
52
+ .badge-warning {
53
+ background: var(--status-warning, #f59e0b);
54
+ color: white;
55
+ }
56
+
57
+ .badge-error {
58
+ background: var(--status-delete, #ef4444);
59
+ color: white;
60
+ }
61
+
62
+ /* Badge sizes */
63
+ .badge-sm {
64
+ font-size: 9px;
65
+ padding: 0px 4px;
66
+ height: 16px;
67
+ line-height: 16px;
68
+ }
69
+
70
+ .badge-lg {
71
+ font-size: 11px;
72
+ padding: 2px 8px;
73
+ height: 20px;
74
+ line-height: 16px;
75
+ }
76
+
77
+ /* Changes table specific badges */
78
+ .changes-table-badge {
79
+ width: 18px;
80
+ display: inline-flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ }
@@ -12,6 +12,7 @@
12
12
  border-spacing: 0;
13
13
  }
14
14
 
15
+ /* Header styles */
15
16
  .compact-table th {
16
17
  padding: 4px 8px;
17
18
  font-weight: 500;
@@ -27,6 +28,18 @@
27
28
  height: 32px;
28
29
  }
29
30
 
31
+ /* Cell styles */
32
+ .compact-table td {
33
+ padding: 2px 8px;
34
+ border-right: 1px solid var(--border-light);
35
+ border-bottom: 1px solid var(--border-light);
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ vertical-align: top;
40
+ }
41
+
42
+ /* Sticky columns */
30
43
  /* Enhanced sticky header styling */
31
44
  .compact-table th.sticky-left-0 {
32
45
  position: sticky;
@@ -49,16 +62,6 @@
49
62
  box-shadow: 2px 0px 3px rgba(0,0,0,0.05);
50
63
  }
51
64
 
52
- .compact-table td {
53
- padding: 2px 8px;
54
- border-right: 1px solid var(--border-light);
55
- border-bottom: 1px solid var(--border-light);
56
- overflow: hidden;
57
- text-overflow: ellipsis;
58
- white-space: nowrap;
59
- vertical-align: top;
60
- }
61
-
62
65
  /* Enhanced sticky cell styling */
63
66
  .compact-table td.sticky-left-0 {
64
67
  position: sticky;
@@ -84,19 +87,6 @@
84
87
  box-shadow: 2px 0px 3px rgba(0,0,0,0.05);
85
88
  }
86
89
 
87
- /* Special cell formatting */
88
- .compact-table td.highlight-change {
89
- background-color: var(--highlight-change);
90
- }
91
-
92
- .compact-table td.highlight-new {
93
- color: #047857;
94
- }
95
-
96
- .compact-table td.highlight-deleted {
97
- color: #b91c1c;
98
- }
99
-
100
90
  /* Row styles */
101
91
  .compact-table tr:hover td:not(.sticky-left-0):not(.sticky-left-1):not(.sticky-left-2) {
102
92
  background-color: rgba(243, 244, 246, 0.7);
@@ -118,7 +108,7 @@
118
108
  background-color: #e6f3ff;
119
109
  }
120
110
 
121
- /* Smart column width distribution */
111
+ /* Text overflow handling */
122
112
  .compact-table th,
123
113
  .compact-table td {
124
114
  overflow: hidden;
@@ -126,7 +116,7 @@
126
116
  white-space: nowrap;
127
117
  }
128
118
 
129
- /* Fixed widths for sticky columns only */
119
+ /* Fixed widths for common columns */
130
120
  .compact-table th:first-child,
131
121
  .compact-table td:first-child {
132
122
  width: 60px;
@@ -151,12 +141,79 @@
151
141
  font-size: 11px;
152
142
  }
153
143
 
144
+ /* Sessions table specific overrides */
145
+ .sessions-table th:nth-child(2),
146
+ .sessions-table td:nth-child(2) {
147
+ width: 22%;
148
+ min-width: 160px;
149
+ max-width: 260px;
150
+ text-align: left;
151
+ padding-left: 16px;
152
+ }
153
+
154
+ /* Enhanced sessions table styling */
155
+ .sessions-table tr {
156
+ border-bottom: 1px solid var(--border-light);
157
+ transition: all 0.15s ease;
158
+ }
159
+
160
+ .sessions-table tr:hover {
161
+ background-color: rgba(230, 243, 255, 0.5);
162
+ }
163
+
164
+ .sessions-table td {
165
+ padding: 6px 8px;
166
+ vertical-align: middle;
167
+ }
168
+
169
+ .sessions-table td:first-child .font-mono {
170
+ color: var(--navy-dark);
171
+ font-weight: 500;
172
+ background: var(--gray-50);
173
+ padding: 2px 4px;
174
+ border-radius: 3px;
175
+ border: 1px solid var(--border-medium);
176
+ display: inline-block;
177
+ }
178
+
179
+ .sessions-table .badge {
180
+ min-width: 60px;
181
+ width: auto;
182
+ height: auto;
183
+ padding: 2px 8px;
184
+ }
185
+
186
+ .sessions-table .actions-cell {
187
+ width: 80px;
188
+ }
189
+
190
+ .sessions-table .actions-cell .compact-button {
191
+ transition: transform 0.15s ease, background-color 0.15s ease;
192
+ }
193
+
194
+ .sessions-table .actions-cell .compact-button:hover {
195
+ transform: translateY(-1px);
196
+ }
197
+
154
198
  /* Font styling for specific column types */
155
199
  .compact-table .text-right {
156
200
  font-family: monospace;
157
201
  }
158
202
 
203
+ /* Special cell formatting */
204
+ .compact-table td.highlight-change {
205
+ background-color: var(--highlight-change);
206
+ }
207
+
208
+ .compact-table td.highlight-new {
209
+ color: #047857;
210
+ }
211
+
212
+ .compact-table td.highlight-deleted {
213
+ color: #b91c1c;
214
+ }
215
+
159
216
  /* Highlight colors */
160
217
  .highlight-change { background: var(--highlight-change); }
161
218
  .highlight-new { background: var(--highlight-new); }
162
- .highlight-deleted { background: var(--highlight-deleted); }
219
+ .highlight-deleted { background: var(--highlight-deleted); }
@@ -2,7 +2,7 @@
2
2
  * Diagram Component Styles
3
3
  */
4
4
 
5
- // Code view styles
5
+ /* Code view container */
6
6
  .diagram-code-view {
7
7
  position: relative;
8
8
  height: 100%;
@@ -20,7 +20,7 @@
20
20
  }
21
21
  }
22
22
 
23
- // Mermaid diagram container
23
+ /* Mermaid diagram container */
24
24
  [x-ref="diagramContainer"] {
25
25
  .mermaid {
26
26
  overflow: auto;
@@ -28,7 +28,7 @@
28
28
  }
29
29
  }
30
30
 
31
- // Code container scrollbar styling
31
+ /* Code container scrollbar styling */
32
32
  pre[x-ref="codeContainer"] {
33
33
  &::-webkit-scrollbar {
34
34
  width: 8px;
@@ -52,4 +52,13 @@
52
52
  background: white;
53
53
  color: var(--navy-dark);
54
54
  font-weight: 500;
55
+ }
56
+
57
+ /* Tab content styles */
58
+ .tab-content {
59
+ display: none;
60
+ }
61
+
62
+ .tab-content.active {
63
+ display: block;
55
64
  }
@@ -0,0 +1,248 @@
1
+ // Tabulator Component Styles
2
+ // Custom styling for the Tabulator.js library used in DBWatcher
3
+
4
+ // Base Tabulator styling
5
+ .tabulator {
6
+ font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
7
+ font-size: 12px;
8
+ border: none;
9
+ background: white;
10
+ border-collapse: separate;
11
+ border-spacing: 0;
12
+ margin: 0;
13
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
14
+
15
+ // Header styling
16
+ .tabulator-header {
17
+ background: #f3f3f3;
18
+ border-bottom: 2px solid #e8e8e8;
19
+ font-size: 11px;
20
+
21
+ .tabulator-col {
22
+ background: #f3f3f3;
23
+ border-right: 1px solid #e8e8e8;
24
+ padding: 4px 8px;
25
+ font-weight: 500;
26
+ text-transform: none;
27
+ height: 32px;
28
+ text-align: left;
29
+ position: sticky;
30
+ top: 0;
31
+ z-index: 10;
32
+
33
+ // Sticky columns in header
34
+ &.sticky-left-0 {
35
+ position: sticky;
36
+ left: 0;
37
+ z-index: 20;
38
+ background: #f3f3f3;
39
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
40
+ }
41
+
42
+ &.sticky-left-1 {
43
+ position: sticky;
44
+ left: 60px;
45
+ z-index: 19;
46
+ background: #f3f3f3;
47
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
48
+ }
49
+
50
+ &.sticky-left-2 {
51
+ position: sticky;
52
+ left: 108px;
53
+ z-index: 18;
54
+ background: #f3f3f3;
55
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
56
+ }
57
+ }
58
+ }
59
+
60
+ // Table body styling
61
+ .tabulator-tableholder {
62
+ .tabulator-table {
63
+ .tabulator-row {
64
+ background: white;
65
+ border-bottom: 1px solid #f0f0f0;
66
+ min-height: auto;
67
+ transition: background-color 0.15s ease;
68
+
69
+ &:hover {
70
+ background: #f3f4f6;
71
+ }
72
+
73
+ // Row colors based on operation
74
+ &.operation-insert {
75
+ background-color: rgba(16, 185, 129, 0.05);
76
+ &:hover {
77
+ background-color: rgba(16, 185, 129, 0.1);
78
+ }
79
+ }
80
+
81
+ &.operation-update {
82
+ background-color: rgba(108, 173, 223, 0.05);
83
+ &:hover {
84
+ background-color: rgba(108, 173, 223, 0.1);
85
+ }
86
+ }
87
+
88
+ &.operation-delete {
89
+ background-color: rgba(239, 68, 68, 0.05);
90
+ &:hover {
91
+ background-color: rgba(239, 68, 68, 0.1);
92
+ }
93
+ }
94
+
95
+ // Cell styling
96
+ .tabulator-cell {
97
+ border-right: 1px solid #f0f0f0;
98
+ padding: 2px 8px;
99
+ overflow: hidden;
100
+ text-overflow: ellipsis;
101
+ white-space: nowrap;
102
+ vertical-align: top;
103
+ font-size: 12px;
104
+ height: auto;
105
+ min-height: 28px;
106
+
107
+ // Special styling for cells with multi-line content
108
+ &:has(.space-y-1) {
109
+ white-space: normal;
110
+ height: auto;
111
+ padding: 4px 8px;
112
+ }
113
+
114
+ // Sticky columns in body
115
+ &.sticky-left-0 {
116
+ position: sticky;
117
+ left: 0;
118
+ background: white;
119
+ z-index: 5;
120
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
121
+ }
122
+
123
+ &.sticky-left-1 {
124
+ position: sticky;
125
+ left: 60px;
126
+ background: white;
127
+ z-index: 4;
128
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
129
+ }
130
+
131
+ &.sticky-left-2 {
132
+ position: sticky;
133
+ left: 108px;
134
+ background: white;
135
+ z-index: 3;
136
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
137
+ }
138
+ }
139
+
140
+ // Hover state for sticky cells
141
+ &:hover {
142
+ .tabulator-cell {
143
+ &.sticky-left-0,
144
+ &.sticky-left-1,
145
+ &.sticky-left-2 {
146
+ background: #f9fafb;
147
+ }
148
+ }
149
+ }
150
+
151
+ // Operation-specific sticky cell backgrounds
152
+ &.operation-insert .tabulator-cell {
153
+ &.sticky-left-0, &.sticky-left-1, &.sticky-left-2 {
154
+ background-color: rgba(16, 185, 129, 0.05);
155
+ }
156
+ }
157
+
158
+ &.operation-update .tabulator-cell {
159
+ &.sticky-left-0, &.sticky-left-1, &.sticky-left-2 {
160
+ background-color: rgba(108, 173, 223, 0.05);
161
+ }
162
+ }
163
+
164
+ &.operation-delete .tabulator-cell {
165
+ &.sticky-left-0, &.sticky-left-1, &.sticky-left-2 {
166
+ background-color: rgba(239, 68, 68, 0.05);
167
+ }
168
+ }
169
+
170
+ // Operation-specific sticky cell hover backgrounds
171
+ &.operation-insert:hover .tabulator-cell {
172
+ &.sticky-left-0, &.sticky-left-1, &.sticky-left-2 {
173
+ background-color: rgba(16, 185, 129, 0.1);
174
+ }
175
+ }
176
+
177
+ &.operation-update:hover .tabulator-cell {
178
+ &.sticky-left-0, &.sticky-left-1, &.sticky-left-2 {
179
+ background-color: rgba(108, 173, 223, 0.1);
180
+ }
181
+ }
182
+
183
+ &.operation-delete:hover .tabulator-cell {
184
+ &.sticky-left-0, &.sticky-left-1, &.sticky-left-2 {
185
+ background-color: rgba(239, 68, 68, 0.1);
186
+ }
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ // Row detail styling for expanded rows
194
+ .row-detail {
195
+ border-top: 1px solid #e5e7eb;
196
+ background: #f9fafb;
197
+ padding: 0;
198
+
199
+ td {
200
+ padding: 8px;
201
+ vertical-align: top;
202
+ border-right: 1px solid #e5e7eb;
203
+ }
204
+
205
+ h4 {
206
+ font-weight: 600;
207
+ color: #374151;
208
+ margin-bottom: 8px;
209
+ }
210
+
211
+ // Sticky column in expanded view
212
+ .sticky-left-0 {
213
+ position: sticky;
214
+ left: 0;
215
+ z-index: 5;
216
+ background: #f9fafb;
217
+ box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
218
+ width: 268px;
219
+ min-width: 268px;
220
+ }
221
+ }
222
+
223
+ // Expand button styling
224
+ .expand-btn {
225
+ padding: 2px;
226
+ border-radius: 2px;
227
+ transition: all 0.15s ease;
228
+
229
+ &:hover {
230
+ background-color: #f3f4f6;
231
+ }
232
+ }
233
+
234
+ // Table container
235
+ .table-container {
236
+ min-height: 200px;
237
+ width: 100%;
238
+ overflow: auto;
239
+ border-bottom-left-radius: 0.25rem;
240
+ border-bottom-right-radius: 0.25rem;
241
+ }
242
+
243
+ // Column selector dropdown
244
+ .column-selector {
245
+ right: 1rem;
246
+ margin-top: -2px;
247
+ z-index: 100;
248
+ }