rails_nexus 2.0.3 → 2.1.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/rails_nexus/controllers.js +103 -6
- data/app/assets/stylesheets/rails_nexus/application.css +418 -42
- data/app/controllers/rails_nexus/backup_controller.rb +27 -19
- data/app/helpers/rails_nexus/application_helper.rb +5 -0
- data/app/javascript/controllers/rails_nexus_controller.js +8 -2
- data/app/javascript/controllers/rails_nexus_sidebar_controller.js +84 -3
- data/app/jobs/rails_nexus/backup_job.rb +18 -0
- data/app/models/rails_nexus/backup.rb +11 -11
- data/app/models/rails_nexus/backup_config.rb +84 -16
- data/app/services/rails_nexus/backup_service.rb +521 -115
- data/app/views/layouts/rails_nexus/_sidebar_navigation.html.erb +113 -0
- data/app/views/layouts/rails_nexus/application.html.erb +132 -26
- data/app/views/rails_nexus/backup/_form.html.erb +186 -37
- data/app/views/rails_nexus/backup/history.html.erb +17 -2
- data/app/views/rails_nexus/backup/index.html.erb +29 -72
- data/app/views/rails_nexus/logged_exceptions/_exceptions.html.erb +24 -55
- data/app/views/rails_nexus/logged_exceptions/index.html.erb +24 -102
- data/db/seeds/backup_configs.rb +140 -0
- data/lib/generators/rails_nexus/templates/migration.rb +32 -6
- data/lib/rails_nexus/version.rb +1 -1
- data/lib/tasks/rails_nexus.rake +14 -4
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3deddaf8307ffc780ab2c69de90a02a6dc4c8baf8c780af2e107b08ff8798337
|
|
4
|
+
data.tar.gz: 73ab2141acb40a433ca2db21a1dd35b1a2a642ff74a1ad420be2978cfa237821
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7195e03556acf7084d881c264166564a02da3273feff2abbcb6ee56e93b9e5ae2e797309cd82e586ac4310ea083c7fde125e4d492b78268fcefdea19dfac58de
|
|
7
|
+
data.tar.gz: bb61711dba4e993e79ff6fab0185afe29ef4b20021fcf5c2fdc9ca79b11292bfcb005afe35ebb8fc243760e0f5513cb6a7207cefa7c225a7eb37fc43ef545675
|
|
@@ -43,16 +43,103 @@
|
|
|
43
43
|
// ═══════════════════════════════════════════════════════════════
|
|
44
44
|
|
|
45
45
|
class RailsNexusSidebarController {
|
|
46
|
-
static get targets() { return ["drawer", "overlay"] }
|
|
46
|
+
static get targets() { return ["drawer", "overlay", "sidebar", "toggleButton"] }
|
|
47
|
+
|
|
48
|
+
connect() {
|
|
49
|
+
this.handleResize = this.syncButtonState.bind(this)
|
|
50
|
+
window.addEventListener("resize", this.handleResize)
|
|
51
|
+
|
|
52
|
+
if (this.desktop() && this.sidebarHidden() && this.hasSidebarTarget) {
|
|
53
|
+
this.sidebarTarget.classList.add("is-hidden")
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
this.syncButtonState()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
disconnect() {
|
|
60
|
+
window.removeEventListener("resize", this.handleResize)
|
|
61
|
+
}
|
|
47
62
|
|
|
48
63
|
toggle() {
|
|
49
|
-
if (this.
|
|
50
|
-
|
|
64
|
+
if (this.desktop()) {
|
|
65
|
+
if (this.hasSidebarTarget) {
|
|
66
|
+
var hidden = this.sidebarTarget.classList.toggle("is-hidden")
|
|
67
|
+
this.storeSidebarState(hidden)
|
|
68
|
+
}
|
|
69
|
+
} else if (this.hasDrawerTarget) {
|
|
70
|
+
var opening = !this.drawerTarget.classList.contains("open")
|
|
71
|
+
this.drawerTarget.classList.toggle("open", opening)
|
|
72
|
+
if (this.hasOverlayTarget) this.overlayTarget.classList.toggle("open", opening)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
this.syncButtonState()
|
|
51
76
|
}
|
|
52
77
|
|
|
53
78
|
close() {
|
|
54
79
|
if (this.hasDrawerTarget) this.drawerTarget.classList.remove("open")
|
|
55
80
|
if (this.hasOverlayTarget) this.overlayTarget.classList.remove("open")
|
|
81
|
+
this.syncButtonState()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
desktop() {
|
|
85
|
+
return window.matchMedia("(min-width: 1024px)").matches
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
sidebarHidden() {
|
|
89
|
+
try {
|
|
90
|
+
return localStorage.getItem("rails_nexus-sidebar-hidden") === "true"
|
|
91
|
+
} catch (_error) {
|
|
92
|
+
return false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
storeSidebarState(hidden) {
|
|
97
|
+
try {
|
|
98
|
+
localStorage.setItem("rails_nexus-sidebar-hidden", hidden.toString())
|
|
99
|
+
} catch (_error) {
|
|
100
|
+
// The toggle still works when storage is unavailable.
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
syncButtonState() {
|
|
105
|
+
if (!this.hasToggleButtonTarget) return
|
|
106
|
+
|
|
107
|
+
var expanded
|
|
108
|
+
if (this.desktop()) {
|
|
109
|
+
expanded = this.hasSidebarTarget && !this.sidebarTarget.classList.contains("is-hidden")
|
|
110
|
+
} else {
|
|
111
|
+
expanded = this.hasDrawerTarget && this.drawerTarget.classList.contains("open")
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
this.toggleButtonTarget.setAttribute("aria-expanded", expanded.toString())
|
|
115
|
+
this.toggleButtonTarget.setAttribute("aria-label", expanded ? "Hide navigation" : "Show navigation")
|
|
116
|
+
this.toggleButtonTarget.title = expanded ? "Hide navigation" : "Show navigation"
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
closeOtherMenus(event) {
|
|
120
|
+
var currentMenu = event.currentTarget
|
|
121
|
+
if (!currentMenu.open) return
|
|
122
|
+
|
|
123
|
+
var navigation = currentMenu.closest(".rn-sidebar-nav")
|
|
124
|
+
if (!navigation) return
|
|
125
|
+
|
|
126
|
+
navigation.querySelectorAll("details.rn-nav-section[open]").forEach(function(menu) {
|
|
127
|
+
if (menu !== currentMenu) menu.open = false
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
toggleShortcuts(event) {
|
|
132
|
+
var dialog = document.querySelector("[data-rails_nexus-target='shortcutsDialog']")
|
|
133
|
+
if (!dialog) return
|
|
134
|
+
|
|
135
|
+
var isOpening = !dialog.classList.contains("open")
|
|
136
|
+
dialog.classList.toggle("open", isOpening)
|
|
137
|
+
event.currentTarget.setAttribute("aria-expanded", isOpening.toString())
|
|
138
|
+
|
|
139
|
+
if (isOpening) {
|
|
140
|
+
var closeButton = dialog.querySelector("button")
|
|
141
|
+
if (closeButton) closeButton.focus()
|
|
142
|
+
}
|
|
56
143
|
}
|
|
57
144
|
}
|
|
58
145
|
|
|
@@ -277,11 +364,17 @@
|
|
|
277
364
|
this.closeShortcuts()
|
|
278
365
|
} else {
|
|
279
366
|
this.shortcutsDialogTarget.classList.add("open")
|
|
367
|
+
var button = document.getElementById("rn-shortcuts-button")
|
|
368
|
+
if (button) button.setAttribute("aria-expanded", "true")
|
|
280
369
|
}
|
|
281
370
|
}
|
|
282
371
|
|
|
283
372
|
closeShortcuts() {
|
|
284
|
-
if (this.hasShortcutsDialogTarget)
|
|
373
|
+
if (this.hasShortcutsDialogTarget) {
|
|
374
|
+
this.shortcutsDialogTarget.classList.remove("open")
|
|
375
|
+
var button = document.getElementById("rn-shortcuts-button")
|
|
376
|
+
if (button) button.setAttribute("aria-expanded", "false")
|
|
377
|
+
}
|
|
285
378
|
}
|
|
286
379
|
|
|
287
380
|
// ─── Navigation (prev/next) ───────────────────────────────
|
|
@@ -373,11 +466,15 @@
|
|
|
373
466
|
// ─── Loading State ────────────────────────────────────────
|
|
374
467
|
|
|
375
468
|
showActivity() {
|
|
376
|
-
if (this.hasActivityTarget)
|
|
469
|
+
if (!this.hasActivityTarget) return
|
|
470
|
+
this.activityTarget.hidden = false
|
|
471
|
+
this.activityTarget.classList.remove("hidden")
|
|
377
472
|
}
|
|
378
473
|
|
|
379
474
|
hideActivity() {
|
|
380
|
-
if (this.hasActivityTarget)
|
|
475
|
+
if (!this.hasActivityTarget) return
|
|
476
|
+
this.activityTarget.hidden = true
|
|
477
|
+
this.activityTarget.classList.add("hidden")
|
|
381
478
|
}
|
|
382
479
|
}
|
|
383
480
|
|