From e87cd0d8c02f9b95981baabc0b29d922f665405e Mon Sep 17 00:00:00 2001 From: Johan Ohly Date: Sat, 14 Sep 2024 23:58:47 +0200 Subject: [PATCH] feat: import from JetLog --- docs/docs/features/import.md | 24 +++- .../modals/settings/pages/ImportPage.svelte | 2 +- src/lib/import/index.ts | 5 +- src/lib/import/jetlog.ts | 122 ++++++++++++++++++ src/lib/utils/datetime.ts | 8 ++ src/lib/utils/index.ts | 2 +- src/routes/+page.server.ts | 6 +- 7 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 src/lib/import/jetlog.ts diff --git a/docs/docs/features/import.md b/docs/docs/features/import.md index 3f22f85..2323e75 100644 --- a/docs/docs/features/import.md +++ b/docs/docs/features/import.md @@ -6,7 +6,7 @@ sidebar_position: 1 The import feature allows you to import flight data from other sources into AirTrail. Currently, AirTrail supports importing flights from [MyFlightradar24](https://my.flightradar24.com) -and [App in the Air](https://appintheair.com). +, [App in the Air](https://appintheair.com) and [JetLog](https://github.com/pbogre/jetlog). ## Import flights from MyFlightradar24 @@ -45,3 +45,25 @@ Once you have the text file, you can import it into AirTrail by following these 5. Click on the "Import" button to start the import process. After the import process is complete, you will see your flights on the map. + +## Import flights from JetLog + +:::tip +Make sure the file you are importing is called `jetlog.csv`. If it is not, rename it to `jetlog.csv` before importing. +::: + +While logged in to your JetLog account, follow these steps to export your flights: + +1. Go to your JetLog instance. +2. Go to the "Settings" page in the top right corner. +3. Click on the "Export to CSV" button to download your flights as a CSV file. + +Once you have the CSV file, you can import it into AirTrail by following these steps: + +1. Go to the AirTrail application. +2. Go to the settings page. +3. Click on the "Import" tab. +4. Click on the "Choose File" button and select the CSV file you downloaded from JetLog. +5. Click on the "Import" button to start the import process. + +After the import process is complete, you will see your flights on the map. diff --git a/src/lib/components/modals/settings/pages/ImportPage.svelte b/src/lib/components/modals/settings/pages/ImportPage.svelte index 77ca6e1..e004f8b 100644 --- a/src/lib/components/modals/settings/pages/ImportPage.svelte +++ b/src/lib/components/modals/settings/pages/ImportPage.svelte @@ -53,7 +53,7 @@