diff --git a/src/static/viewer.css b/src/static/viewer.css index 3220435..2480319 100644 --- a/src/static/viewer.css +++ b/src/static/viewer.css @@ -7,6 +7,9 @@ background-color: #dee2e6 !important; } -#notification_wrapper { - display: none; +#fox_map { + box-sizing: border-box; + position: absolute; + width: 100%; + height: calc(100% - 5rem); } diff --git a/src/static/viewer.js b/src/static/viewer.js index 8c0a63d..19f6ade 100644 --- a/src/static/viewer.js +++ b/src/static/viewer.js @@ -1,87 +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" || result["result"] == "error")) { - showAlert("Error while getting ATC information", result["message"]); - 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 = "
" + flightplan["callsign"] + "
"; +// $("#fox_flightplans").append(flightplanElement); +// } - $(".fox_button").click(function() { - if ($(this).hasClass("fox_active")) return; +// $(".fox_button").click(function() { +// if ($(this).hasClass("fox_active")) return; - $(".fox_active").removeClass("fox_active"); - $(this).addClass("fox_active"); +// $(".fox_active").removeClass("fox_active"); +// $(this).addClass("fox_active"); - showFlight(userFlightplans[$(this).attr("id")]); - }); +// showFlight(userFlightplans[$(this).attr("id")]); +// }); - showFlight(result[0]); -}); +// showFlight(result[0]); +// }); -// Fetching airports information -// Get it from localhost -// Becase I think it would be much faster than getting it from VATSIM API -let airports = {}; +// // Fetching airports information +// // Get it from localhost +// // Becase I think it would be much faster than getting it from VATSIM API +// let airports = {}; -$.getJSON("/static/data/airports.json", function(json) { - airports = json; - } -); +// $.getJSON("/static/data/airports.json", function(json) { +// airports = json; +// } +// ); // Map creation const MAP_ELEMENT = L.map("fox_map"); -const MAP_DEFAULT_ZOOM_VIEW = 2; const MAP_DEFAULT_TARGET = L.latLng("0", "0"); +const MAP_DEFAULT_ZOOM_VIEW = 2; let line = null; - MAP_ELEMENT.setView(MAP_DEFAULT_TARGET, MAP_DEFAULT_ZOOM_VIEW); L.tileLayer("https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png", { - attribution: '© OpenStreetMap contributors', + attribution: '© OpenStreetMap contributors | VATSIM Fox by uw935 (1606255)', subdomains: "abcd", maxZoom: 20, minZoom: 2 diff --git a/src/templates/include/template.html b/src/templates/include/template.html index 21f00be..49c4ccd 100644 --- a/src/templates/include/template.html +++ b/src/templates/include/template.html @@ -12,7 +12,6 @@ {% block title %}{% endblock %} - {% block header_css %}{% endblock %} @@ -28,12 +27,26 @@ color: var(--main-rgb); } + .btn-outline-primary:hover, .btn-outline-primary:active { + color: white !important; + background-color: var(--main-rgb) !important; + border-color: var(--main-rgb) !important; + } + + .btn-outline-primary { + border-color: var(--main-rgb); + color: var(--main-rgb); + } + :root { --main-rgb: #FA8232; --bs-primary-rgb: 250, 130, 50 + --main-rgb: #FA8232; + --bs-primary-rgb: 250, 130, 50; } + {% block above_content %}{% endblock %}
diff --git a/src/templates/index.html b/src/templates/index.html index 20e7679..d16a06e 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -2,15 +2,15 @@ {% block title %}VATSIM Fox — view detailed profile statistic{% endblock %} {% block content %}
-
-

Enter your VATSIM CID

-

See your detailed profile statistic

- -

-
+
+

Enter your VATSIM CID

+

See your detailed profile statistic

+ +

+
diff --git a/src/templates/viewer.html b/src/templates/viewer.html index af2b9af..fd72a05 100644 --- a/src/templates/viewer.html +++ b/src/templates/viewer.html @@ -1,150 +1,56 @@ -{% extends "/include/template.html" %} -{% block title %}User {{user["id"]}} statistic — VATSIM Fox{% endblock %} -{% block header_css %} - - -{% endblock %} -{% block content %} -
-
- -
-

Last 50 flightplans

-
-
-
-
-

Flight — from to

- - - -
- - Aircraft type: - - -
- - Enroute time: - - -
- - Departure airport: - - -
- - Arrival airport: - - -
- - Alternative airport: - - -
- - Flight type: - - -
- - Cruise speed: - knots - -
- - Flight altitude: - feet - -
- - Route: - - -
- - Remarks: - - -
- - Squawk: - - -
- - Fligthplan filed at: - - -
-
-
-
-
-

Last 100 ATC shifts

-
- -
-
-

Callsign

- - Start time: - - -
- - End time: - - -
- - Aircraft tracked: - - -
- - Aircraft seen: - - -
- - Squawk assigned: - - -
- - Aircraft's transferred: - - -
- - Aircraft's received: - - -
-
-
-{% endblock %} -{% block javascript_code %} - - - -{% endblock %} + + + + +