mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
2026.11.1: offline flight logging fixed, inspections from logbook entries, life limits from installation, component inspections moved to inspection types
- Service worker keeps the Log Flight form when opened via Turbo, serves the offline page's script and icon, and treats 502/503/504 as offline; the offline page only links forms actually kept - Serviced sub-components restart from the airframe time flown since the entry - New logbook entries can complete inspections (recorded and linked to the entry) - Components: replacement limit can count from installation (life limit) - Component-level "Inspect every" / "Inspection critical" removed; a migration converts any unlinked settings into inspection types with a first record; component page lists its inspections Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7552e4a8a3
commit
352a38c7fb
28 files changed
+289
-69
No files matched your search
+10
-5
@@ -6,10 +6,15 @@ try {
|
||||
var box = document.getElementById("forms")
|
||||
Object.keys(forms).forEach(function (path) {
|
||||
if (!/^\/aircraft\/\d+\/flight_logs\/new$/.test(path)) return
|
||||
var a = document.createElement("a")
|
||||
a.href = path
|
||||
a.textContent = "Log a flight: " + forms[path]
|
||||
box.appendChild(a)
|
||||
box.hidden = false
|
||||
// Only offer forms the service worker actually kept; others just loop back here.
|
||||
var kept = window.caches ? caches.open("sam-flight-forms").then(function (c) { return c.match(location.origin + path) }) : Promise.resolve(null)
|
||||
kept.then(function (hit) {
|
||||
if (!hit) return
|
||||
var a = document.createElement("a")
|
||||
a.href = path
|
||||
a.textContent = "Log a flight: " + forms[path]
|
||||
box.appendChild(a)
|
||||
box.hidden = false
|
||||
}).catch(function () {})
|
||||
})
|
||||
} catch (e) { /* storage off */ }
|
||||
Reference in new issue
Block a user