mit json rum gespielt
This commit is contained in:
@ -2,11 +2,37 @@ import flights from '../data/HoPe_all_flights.json';
|
||||
import {CFlight} from '../classes/CFlight';
|
||||
import {CSeason} from '../classes/CSeason';
|
||||
import {groupByMap} from '../global/tools';
|
||||
import getFlights from '../data/GetAllFlights.json';
|
||||
|
||||
const data_raw = flights.data;
|
||||
export const g_data: CFlight[] = [];
|
||||
export const g_seasondata: CSeason[] = [];
|
||||
|
||||
|
||||
// function GetFlightsFromXcServer(FKpilot: number)
|
||||
// {
|
||||
// var url_raw: string = getFlights[0].url;
|
||||
// const pattern: string = getFlights[0].pattern;
|
||||
// const regex = /XXXXXXXX/gi;
|
||||
// const url = url_raw.replace(regex, FKpilot.toString());
|
||||
|
||||
// var fldata: any;
|
||||
// fetch(url)
|
||||
// .then(function(response)
|
||||
// {
|
||||
// return response.json();
|
||||
// }
|
||||
// ).then(function(myJson)
|
||||
// {
|
||||
// fldata=myJson;
|
||||
// console.log(fldata);
|
||||
// });
|
||||
|
||||
// return fldata;
|
||||
// }
|
||||
|
||||
// const data_raw = GetFlightsFromXcServer(1295).data;
|
||||
|
||||
for (let fl of data_raw)
|
||||
{
|
||||
g_data.push(new CFlight(fl));
|
||||
|
||||
7
src/data/GetAllFlights.json
Executable file
7
src/data/GetAllFlights.json
Executable file
@ -0,0 +1,7 @@
|
||||
[
|
||||
{
|
||||
"name" : "all_flights",
|
||||
"pattern" : "XXXXXXXX",
|
||||
"url" : "https://de.dhv-xc.de/api/fli/flights?fkpil%5B%5D=XXXXXXXX&navpars=%7B%22start%22%3A0%2C%22limit%22%3A4000%7D"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user