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
@@ -146,19 +146,20 @@ class Airworthiness
|
||||
desc = ""
|
||||
|
||||
if c.replacement_critical? && c.replacement_hours
|
||||
if c.hours_since_overhaul >= c.replacement_hours
|
||||
used = c.replacement_hours_used
|
||||
if used >= c.replacement_hours
|
||||
overdue = true
|
||||
desc = "Replace every #{c.replacement_hours} hrs. Current: #{c.hours_since_overhaul} hrs."
|
||||
elsif c.hours_since_overhaul + HOURS_WARNING >= c.replacement_hours
|
||||
desc = "Replace every #{c.replacement_hours} hrs. Current: #{used} hrs#{' since installed' if c.replacement_from_install?}."
|
||||
elsif used + HOURS_WARNING >= c.replacement_hours
|
||||
approaching = true
|
||||
desc = "Replace in #{c.replacement_hours - c.hours_since_overhaul} hrs."
|
||||
desc = "Replace in #{c.replacement_hours - used} hrs."
|
||||
end
|
||||
end
|
||||
|
||||
if c.replacement_critical? && (due = c.next_replacement_date)
|
||||
if @today >= due
|
||||
overdue = true
|
||||
desc = "Replace every #{c.replacement_interval_label}. Last serviced #{c.overhaul_date}."
|
||||
desc = "Replace every #{c.replacement_interval_label}. #{c.replacement_from_install? ? 'Installed' : 'Last serviced'} #{c.replacement_counted_from}."
|
||||
elsif @today + DAYS_WARNING >= due
|
||||
approaching = true
|
||||
desc = "Replace in #{(due - @today).to_i} days."
|
||||
|
||||
Reference in new issue
Block a user