dbviewer 0.6.7 → 0.7.0
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 +4 -4
- data/app/assets/javascripts/dbviewer/entity_relationship_diagram.js +553 -0
- data/app/assets/javascripts/dbviewer/home.js +287 -0
- data/app/assets/javascripts/dbviewer/layout.js +194 -0
- data/app/assets/javascripts/dbviewer/query.js +277 -0
- data/app/assets/javascripts/dbviewer/table.js +1563 -0
- data/app/assets/stylesheets/dbviewer/application.css +1460 -21
- data/app/assets/stylesheets/dbviewer/entity_relationship_diagram.css +181 -0
- data/app/assets/stylesheets/dbviewer/home.css +229 -0
- data/app/assets/stylesheets/dbviewer/logs.css +64 -0
- data/app/assets/stylesheets/dbviewer/query.css +171 -0
- data/app/assets/stylesheets/dbviewer/table.css +1144 -0
- data/app/views/dbviewer/connections/index.html.erb +0 -30
- data/app/views/dbviewer/entity_relationship_diagrams/index.html.erb +14 -713
- data/app/views/dbviewer/home/index.html.erb +9 -499
- data/app/views/dbviewer/logs/index.html.erb +5 -220
- data/app/views/dbviewer/tables/index.html.erb +0 -65
- data/app/views/dbviewer/tables/query.html.erb +129 -565
- data/app/views/dbviewer/tables/show.html.erb +4 -2429
- data/app/views/layouts/dbviewer/application.html.erb +13 -1544
- data/lib/dbviewer/version.rb +1 -1
- metadata +12 -7
- data/app/assets/javascripts/dbviewer/connections.js +0 -70
- data/app/assets/stylesheets/dbviewer/dbviewer.css +0 -0
- data/app/assets/stylesheets/dbviewer/enhanced.css +0 -0
- data/app/views/dbviewer/connections/new.html.erb +0 -79
- data/app/views/dbviewer/tables/mini_erd.html.erb +0 -517
data/lib/dbviewer/version.rb
CHANGED
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.
|
4
|
+
version: 0.7.0
|
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-06-
|
11
|
+
date: 2025-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -49,10 +49,17 @@ files:
|
|
49
49
|
- MIT-LICENSE
|
50
50
|
- README.md
|
51
51
|
- Rakefile
|
52
|
-
- app/assets/javascripts/dbviewer/
|
52
|
+
- app/assets/javascripts/dbviewer/entity_relationship_diagram.js
|
53
|
+
- app/assets/javascripts/dbviewer/home.js
|
54
|
+
- app/assets/javascripts/dbviewer/layout.js
|
55
|
+
- app/assets/javascripts/dbviewer/query.js
|
56
|
+
- app/assets/javascripts/dbviewer/table.js
|
53
57
|
- app/assets/stylesheets/dbviewer/application.css
|
54
|
-
- app/assets/stylesheets/dbviewer/
|
55
|
-
- app/assets/stylesheets/dbviewer/
|
58
|
+
- app/assets/stylesheets/dbviewer/entity_relationship_diagram.css
|
59
|
+
- app/assets/stylesheets/dbviewer/home.css
|
60
|
+
- app/assets/stylesheets/dbviewer/logs.css
|
61
|
+
- app/assets/stylesheets/dbviewer/query.css
|
62
|
+
- app/assets/stylesheets/dbviewer/table.css
|
56
63
|
- app/controllers/concerns/dbviewer/connection_management.rb
|
57
64
|
- app/controllers/concerns/dbviewer/data_export.rb
|
58
65
|
- app/controllers/concerns/dbviewer/database_information.rb
|
@@ -86,14 +93,12 @@ files:
|
|
86
93
|
- app/mailers/dbviewer/application_mailer.rb
|
87
94
|
- app/models/dbviewer/application_record.rb
|
88
95
|
- app/views/dbviewer/connections/index.html.erb
|
89
|
-
- app/views/dbviewer/connections/new.html.erb
|
90
96
|
- app/views/dbviewer/entity_relationship_diagrams/index.html.erb
|
91
97
|
- app/views/dbviewer/home/index.html.erb
|
92
98
|
- app/views/dbviewer/logs/index.html.erb
|
93
99
|
- app/views/dbviewer/shared/_tables_sidebar.html.erb
|
94
100
|
- app/views/dbviewer/tables/_table_structure.html.erb
|
95
101
|
- app/views/dbviewer/tables/index.html.erb
|
96
|
-
- app/views/dbviewer/tables/mini_erd.html.erb
|
97
102
|
- app/views/dbviewer/tables/query.html.erb
|
98
103
|
- app/views/dbviewer/tables/show.html.erb
|
99
104
|
- app/views/layouts/dbviewer/application.html.erb
|
@@ -1,70 +0,0 @@
|
|
1
|
-
|
2
|
-
document.addEventListener('DOMContentLoaded', function() {
|
3
|
-
// Add connection form validation
|
4
|
-
const forms = document.querySelectorAll('.needs-validation');
|
5
|
-
|
6
|
-
Array.from(forms).forEach(form => {
|
7
|
-
form.addEventListener('submit', event => {
|
8
|
-
if (!form.checkValidity()) {
|
9
|
-
event.preventDefault();
|
10
|
-
event.stopPropagation();
|
11
|
-
}
|
12
|
-
|
13
|
-
form.classList.add('was-validated');
|
14
|
-
}, false);
|
15
|
-
});
|
16
|
-
|
17
|
-
// Handle connection test
|
18
|
-
const testButtons = document.querySelectorAll('.test-connection-btn');
|
19
|
-
|
20
|
-
Array.from(testButtons).forEach(button => {
|
21
|
-
button.addEventListener('click', async function(event) {
|
22
|
-
event.preventDefault();
|
23
|
-
const connectionKey = this.dataset.connectionKey;
|
24
|
-
const statusElement = document.getElementById(`connection-status-${connectionKey}`);
|
25
|
-
|
26
|
-
if (!statusElement) return;
|
27
|
-
|
28
|
-
statusElement.innerHTML = '<i class="bi bi-arrow-repeat spin me-1"></i> Testing connection...';
|
29
|
-
statusElement.classList.remove('text-success', 'text-danger');
|
30
|
-
|
31
|
-
try {
|
32
|
-
const response = await fetch(`/dbviewer/api/connections/${connectionKey}/test`, {
|
33
|
-
method: 'GET',
|
34
|
-
headers: {
|
35
|
-
'Accept': 'application/json',
|
36
|
-
'X-Requested-With': 'XMLHttpRequest'
|
37
|
-
}
|
38
|
-
});
|
39
|
-
|
40
|
-
const data = await response.json();
|
41
|
-
|
42
|
-
if (data.success) {
|
43
|
-
statusElement.innerHTML = '<i class="bi bi-check-circle-fill me-1"></i> Connection successful';
|
44
|
-
statusElement.classList.add('text-success');
|
45
|
-
} else {
|
46
|
-
statusElement.innerHTML = `<i class="bi bi-x-circle-fill me-1"></i> ${data.error || 'Connection failed'}`;
|
47
|
-
statusElement.classList.add('text-danger');
|
48
|
-
}
|
49
|
-
} catch (error) {
|
50
|
-
statusElement.innerHTML = '<i class="bi bi-x-circle-fill me-1"></i> Error testing connection';
|
51
|
-
statusElement.classList.add('text-danger');
|
52
|
-
}
|
53
|
-
});
|
54
|
-
});
|
55
|
-
});
|
56
|
-
|
57
|
-
// Auto-generate connection key from name
|
58
|
-
function setupConnectionKeyGenerator() {
|
59
|
-
const nameInput = document.getElementById('connection_name');
|
60
|
-
const keyInput = document.getElementById('connection_key');
|
61
|
-
|
62
|
-
if (nameInput && keyInput) {
|
63
|
-
nameInput.addEventListener('input', function() {
|
64
|
-
keyInput.value = this.value
|
65
|
-
.toLowerCase()
|
66
|
-
.replace(/\s+/g, '_')
|
67
|
-
.replace(/[^a-z0-9_]/g, '');
|
68
|
-
});
|
69
|
-
}
|
70
|
-
}
|
File without changes
|
File without changes
|
@@ -1,79 +0,0 @@
|
|
1
|
-
<% content_for :title, "Add New Database Connection" %>
|
2
|
-
|
3
|
-
<div class="container-fluid">
|
4
|
-
<div class="d-flex justify-content-between align-items-center mb-4">
|
5
|
-
<h1><i class="bi bi-plus-circle me-2"></i> Add New Database Connection</h1>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<div class="row">
|
9
|
-
<div class="col-12 col-md-8 col-lg-6 mx-auto">
|
10
|
-
<div class="card dbviewer-card">
|
11
|
-
<div class="card-header">
|
12
|
-
<h5 class="card-title mb-0">Connection Details</h5>
|
13
|
-
</div>
|
14
|
-
<div class="card-body">
|
15
|
-
<%= form_tag connections_path, method: :post, class: "needs-validation", novalidate: true do %>
|
16
|
-
<div class="mb-3">
|
17
|
-
<label for="connection_name" class="form-label">Connection Name*</label>
|
18
|
-
<input type="text" class="form-control" id="connection_name" name="connection_name"
|
19
|
-
placeholder="e.g. Blog Database" required>
|
20
|
-
<div class="form-text">A human-readable name for this connection</div>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<div class="mb-3">
|
24
|
-
<label for="connection_key" class="form-label">Connection Key*</label>
|
25
|
-
<input type="text" class="form-control" id="connection_key" name="connection_key"
|
26
|
-
placeholder="e.g. blog_db" required>
|
27
|
-
<div class="form-text">A unique identifier for this connection (lowercase, no spaces)</div>
|
28
|
-
</div>
|
29
|
-
|
30
|
-
<div class="mb-3">
|
31
|
-
<label for="connection_class" class="form-label">Connection Class*</label>
|
32
|
-
<input type="text" class="form-control" id="connection_class" name="connection_class"
|
33
|
-
placeholder="e.g. BlogDatabase" required>
|
34
|
-
<div class="form-text">
|
35
|
-
The fully qualified class name that establishes the connection.
|
36
|
-
This class must inherit from ActiveRecord::Base.
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
|
40
|
-
<div class="d-flex justify-content-between mt-4">
|
41
|
-
<%= link_to "Cancel", connections_path, class: "btn btn-secondary" %>
|
42
|
-
<button type="submit" class="btn btn-primary">Add Connection</button>
|
43
|
-
</div>
|
44
|
-
<% end %>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<script>
|
52
|
-
// Form validation script
|
53
|
-
document.addEventListener('DOMContentLoaded', function() {
|
54
|
-
const forms = document.querySelectorAll('.needs-validation')
|
55
|
-
|
56
|
-
// Loop over them and prevent submission
|
57
|
-
Array.from(forms).forEach(form => {
|
58
|
-
form.addEventListener('submit', event => {
|
59
|
-
if (!form.checkValidity()) {
|
60
|
-
event.preventDefault()
|
61
|
-
event.stopPropagation()
|
62
|
-
}
|
63
|
-
|
64
|
-
form.classList.add('was-validated')
|
65
|
-
}, false)
|
66
|
-
})
|
67
|
-
|
68
|
-
// Auto-generate a key from the name
|
69
|
-
const nameInput = document.getElementById('connection_name')
|
70
|
-
const keyInput = document.getElementById('connection_key')
|
71
|
-
|
72
|
-
nameInput.addEventListener('input', function() {
|
73
|
-
keyInput.value = this.value
|
74
|
-
.toLowerCase()
|
75
|
-
.replace(/\s+/g, '_')
|
76
|
-
.replace(/[^a-z0-9_]/g, '')
|
77
|
-
})
|
78
|
-
})
|
79
|
-
</script>
|