Add spreadsheet flight import; fix oil/fuel consumption charts

Flight import (owners, Flights tab → Import from spreadsheet):
- Upload .xlsx or .csv, preview, then confirm. Columns are matched by
  header name (Date, From, To, Tach, Hobbs, Oil, Fuel, Flight Time).
- Each flight's time is derived from the previous row's meter reading;
  rows are kept in file order so typos (tach going backwards) are
  flagged and skipped while the next good row absorbs the time.
- Unchanged tach imports as a 0.0 hr entry so fuel/oil isn't lost;
  "Full" fuel is warned about; re-imports skip existing rows.
- History only: component hours are untouched unless the owner opts in
  to advancing the aircraft's meters to the last reading.
- Upload redirects to a GET preview (Turbo ignores 200 renders after a
  form POST, which made the button appear to do nothing).

Consumption charts:
- Replace per-fill math (qty ÷ hours since last add), which spiked to
  80 gal/hr on partial fills and top-offs, with a rolling rate (total
  added ÷ hours over a trailing 10 h fuel / 25 h oil window).
- Headline shows recent (last ~50/100 hrs) and lifetime rates; straight
  chart lines instead of splines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-04 19:23:47 -05:00
1 parent 38df19c331
commit 4d3dc7150a
21 files changed
+820 -75

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
Date,From,To,Tach Time,Hobbs Time,Oil Added,Fuel Added,Flight Time
10/17/26,KAAA,KBBB,7277.8,141.3,N,14.3,1.6
10/17/26,KBBB,KCCC,7278.4,142.1,N,N,0.8
10/18/26,KCCC,KDDD,7278.9,143.0,N,12.1,0.9
10/18/26,KDDD,KCCC,7279.5,143.8,N,N,0.8
10/20/26,KCCC,KEEE,7280.6,145.0,N,N,1.2
10/20/26,KEEE,KCCC,7281.8,146.4,N,12.9,1.4
10/21/26,KCCC,KFFF,7282.4,147.2,N,7.3,0.8
10/21/26,KFFF,KCCC,7283.2,148.1,N,N,0.9
10/23/26,KCCC,KGGG,7283.0,149.0,1,8.7,0.9
10/23/26,KGGG,KCCC,7284.5,149.8,N,N,0.8
10/24/26,KCCC,KHHH,7287.2,152.8,N,8.1,3.0
10/24/26,KHHH,KJJJ,7289.1,154.8,N,15.45,2.0
10/24/26,KJJJ,KKKK,7290.3,156.1,N,N,1.3
,,,,,,,
1 Date From To Tach Time Hobbs Time Oil Added Fuel Added Flight Time
2 10/17/26 KAAA KBBB 7277.8 141.3 N 14.3 1.6
3 10/17/26 KBBB KCCC 7278.4 142.1 N N 0.8
4 10/18/26 KCCC KDDD 7278.9 143.0 N 12.1 0.9
5 10/18/26 KDDD KCCC 7279.5 143.8 N N 0.8
6 10/20/26 KCCC KEEE 7280.6 145.0 N N 1.2
7 10/20/26 KEEE KCCC 7281.8 146.4 N 12.9 1.4
8 10/21/26 KCCC KFFF 7282.4 147.2 N 7.3 0.8
9 10/21/26 KFFF KCCC 7283.2 148.1 N N 0.9
10 10/23/26 KCCC KGGG 7283.0 149.0 1 8.7 0.9
11 10/23/26 KGGG KCCC 7284.5 149.8 N N 0.8
12 10/24/26 KCCC KHHH 7287.2 152.8 N 8.1 3.0
13 10/24/26 KHHH KJJJ 7289.1 154.8 N 15.45 2.0
14 10/24/26 KJJJ KKKK 7290.3 156.1 N N 1.3
15