diff --git a/README.md b/README.md
index e8cef61..b6dc046 100644
--- a/README.md
+++ b/README.md
@@ -37,6 +37,7 @@ python -m venv venv
# downloading requirements && upgrading pip
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
+python -m flask run --host 0.0.0.0 --debug
```
## Feature
diff --git a/src/app.py b/src/app.py
index 00d3658..957500c 100644
--- a/src/app.py
+++ b/src/app.py
@@ -19,7 +19,10 @@ def errorhandler_page(_):
@app.route("/api/request")
def request_handler():
if request_string := request.args.get("request_string"):
- return requests.get(f"{VATSIM_API_URL}{request_string}").json()
+ try:
+ return requests.get(f"{VATSIM_API_URL}{request_string}").json()
+ except requests.exceptions.JSONDecodeError:
+ return jsonify({"result": "not found"})
return jsonify({"result": "not found"})
diff --git a/src/static/viewer.css b/src/static/viewer.css
index c03c1cc..80c7bdb 100644
--- a/src/static/viewer.css
+++ b/src/static/viewer.css
@@ -6,3 +6,8 @@
.fox_active, .fox_atc_active {
background-color: #dee2e6 !important;
}
+
+#fox_map {
+ width: 100%;
+ height: 500px;
+}
diff --git a/src/static/viewer.js b/src/static/viewer.js
index 019fda0..eea0357 100644
--- a/src/static/viewer.js
+++ b/src/static/viewer.js
@@ -1,85 +1,84 @@
-// Fetching user's ATC session informations from API
-let userSession = {};
+// // Fetching user's ATC session informations from API
+// let userSession = {};
-fetch(ATC_API_URL, {}).then(response => response.json()).then(result => {
- if (result && result["result"] == "not found")
- return
+// fetch(ATC_API_URL, {}).then(response => response.json()).then(result => {
+// if (result && result["result"] == "not found")
+// return
- for (let session of result["items"]) {
- // Separate each session by it's connection ID
- let session_id = session["connection_id"]["id"];
- userSession[session_id] = session;
+// for (let session of result["items"]) {
+// // Separate each session by it's connection ID
+// let session_id = session["connection_id"]["id"];
+// userSession[session_id] = session;
- // Long line. Not in the whole file, but still bad
- // Open to any suggestions about fix it
- let sessionElement = "
" + session["connection_id"]["callsign"] + "
";
- $("#fox_atc").append(sessionElement);
- }
+// // Long line. Not in the whole file, but still bad
+// // Open to any suggestions about fix it
+// let sessionElement = "
" + session["connection_id"]["callsign"] + "
";
+// $("#fox_atc").append(sessionElement);
+// }
- // Click event handler to left menu button
- $(".fox_atc").click(function() {
- if ($(this).hasClass("fox_atc_active")) return;
+// // Click event handler to left menu button
+// $(".fox_atc").click(function() {
+// if ($(this).hasClass("fox_atc_active")) return;
- $(".fox_atc_active").removeClass("fox_atc_active");
- $(this).addClass("fox_atc_active");
+// $(".fox_atc_active").removeClass("fox_atc_active");
+// $(this).addClass("fox_atc_active");
- showSession(userSession[$(this).attr("id")]);
- });
+// showSession(userSession[$(this).attr("id")]);
+// });
- showSession(result["items"][0]);
-});
+// showSession(result["items"][0]);
+// });
-// Fetching user's flightplans from VATSIM API
-let userFlightplans = {};
+// // Fetching user's flightplans from VATSIM API
+// let userFlightplans = {};
-fetch(FLIGHTPLANS_API_URL, {}).then(response => response.json()).then(result => {
- if (result && result["result"] == "not found")
- return
+// fetch(FLIGHTPLANS_API_URL, {}).then(response => response.json()).then(result => {
+// if (result && result["result"] == "not found")
+// return
- for (let flightplan of result) {
- // Separate each flight by it's connection ID
- // Like it was with ATC session's
- let flightplan_id = flightplan["id"]
- userFlightplans[flightplan_id] = flightplan;
- userFlightplans[flightplan_id]["not_filed"] = flightplan["connection_id"] === 0
+// for (let flightplan of result) {
+// // Separate each flight by it's connection ID
+// // Like it was with ATC session's
+// let flightplan_id = flightplan["id"]
+// userFlightplans[flightplan_id] = flightplan;
+// userFlightplans[flightplan_id]["not_filed"] = flightplan["connection_id"] === 0
- // Long line again
- let flightplanElement = "
" + flightplan["callsign"] + "
";
- $("#fox_flightplans").append(flightplanElement);
- }
+// // Long line again
+// let flightplanElement = "