Commit f31da304 authored by EnesKarakas's avatar EnesKarakas
Browse files

Merge branch 'devbackend' of...

Merge branch 'devbackend' of https://transfer.hft-stuttgart.de/gitlab/22kaen1bdi/swp_ss24_wetterdaten_sammeln into devbackend
parents ca8fe76d 5150990f
...@@ -92,11 +92,8 @@ const Currentdata = (props) => { ...@@ -92,11 +92,8 @@ const Currentdata = (props) => {
/> />
<label> Last Updated</label> <label> Last Updated</label>
<br /> <br />
<input type="checkbox" id="temp_c" className="checkBoxFilter" /> <input type="checkbox" id="temp" className="checkBoxFilter" />
<label for="temp_c">Temp C</label> <label for="temp">Temp C</label>
<br />
<input type="checkbox" id="temp_f" className="checkBoxFilter" />
<label for="temp_f">Temp F</label>
<br /> <br />
<input type="checkbox" id="id_day" className="checkBoxFilter" /> <input type="checkbox" id="id_day" className="checkBoxFilter" />
<label for="id_day">ID Day</label> <label for="id_day">ID Day</label>
...@@ -260,6 +257,9 @@ const Currentdata = (props) => { ...@@ -260,6 +257,9 @@ const Currentdata = (props) => {
); );
function getData() { function getData() {
//switch
const units = document.getElementById("units").value;
const city_text = document.getElementById("city_text").value; const city_text = document.getElementById("city_text").value;
const region_text = document.getElementById("region_text").value; const region_text = document.getElementById("region_text").value;
const country_text = document.getElementById("country_text").value; const country_text = document.getElementById("country_text").value;
...@@ -280,8 +280,7 @@ const Currentdata = (props) => { ...@@ -280,8 +280,7 @@ const Currentdata = (props) => {
const last_updated_epoch = const last_updated_epoch =
document.getElementById("last_updated_epoch").checked; document.getElementById("last_updated_epoch").checked;
const last_updated = document.getElementById("last_updated").checked; const last_updated = document.getElementById("last_updated").checked;
const temp_c = document.getElementById("temp_c").checked; const temp_c = document.getElementById("temp").checked;
const temp_f = document.getElementById("temp_f").checked;
const id_day = document.getElementById("id_day").checked; const id_day = document.getElementById("id_day").checked;
const condition_text = document.getElementById("condition_text").checked; const condition_text = document.getElementById("condition_text").checked;
const condition_icon = document.getElementById("condition_icon").checked; const condition_icon = document.getElementById("condition_icon").checked;
...@@ -347,12 +346,13 @@ const Currentdata = (props) => { ...@@ -347,12 +346,13 @@ const Currentdata = (props) => {
if (last_updated) { if (last_updated) {
filterArray.push("last_updated"); filterArray.push("last_updated");
} }
if (temp_c) { if (temp) {
filterArray.push("temp_c"); if(units == world){
filterArray.push("temp_f");
} }
if (temp_f) {
filterArray.push("temp_f"); filterArray.push("temp_f");
} }
if (id_day) { if (id_day) {
filterArray.push("id_day"); filterArray.push("id_day");
} }
...@@ -366,7 +366,10 @@ const Currentdata = (props) => { ...@@ -366,7 +366,10 @@ const Currentdata = (props) => {
filterArray.push("condition_code"); filterArray.push("condition_code");
} }
if (wind) { if (wind) {
filterArray.push("wind"); if(units == world){
filterArray.push("wind_mph");
}
filterArray.push("wind_kph");
} }
if (wind_degree) { if (wind_degree) {
filterArray.push("wind_degree"); filterArray.push("wind_degree");
...@@ -375,10 +378,15 @@ const Currentdata = (props) => { ...@@ -375,10 +378,15 @@ const Currentdata = (props) => {
filterArray.push("wind_dir"); filterArray.push("wind_dir");
} }
if (pressure) { if (pressure) {
filterArray.push("pressure"); if(units == world){
filterArray.push("temp_mb");
}
filterArray.push("pressure_in");
}
if (precip) {if(units == world){
filterArray.push("temp_mm");
} }
if (precip) { filterArray.push("precip_in");
filterArray.push("precip");
} }
if (humidity) { if (humidity) {
filterArray.push("humidity"); filterArray.push("humidity");
...@@ -387,25 +395,43 @@ const Currentdata = (props) => { ...@@ -387,25 +395,43 @@ const Currentdata = (props) => {
filterArray.push("cloud"); filterArray.push("cloud");
} }
if (feelslike) { if (feelslike) {
filterArray.push("feelslike"); if(units == world){
filterArray.push("feelslike_c");
}
filterArray.push("feelslike_f");
} }
if (windchill) { if (windchill) {
filterArray.push("windchill"); if(units == world){
filterArray.push("windchill_c");
}
filterArray.push("windchill_f");
} }
if (heatindex) { if (heatindex) {
filterArray.push("heatindex"); if(units == world){
filterArray.push("heatindex_c");
}
filterArray.push("heatindex_f");
} }
if (dewpoint) { if (dewpoint) {
filterArray.push("dewpoint"); if(units == world){
filterArray.push("dewpoint_c");
}
filterArray.push("dewpoint_f");
} }
if (vis) { if (vis) {
filterArray.push("vis"); if(units == world){
filterArray.push("vis_miles");
}
filterArray.push("vis_miles");
} }
if (uv) { if (uv) {
filterArray.push("uv"); filterArray.push("uv");
} }
if (gust) { if (gust) {
filterArray.push("gust"); if(units == world){
filterArray.push("gust_kph");
}
filterArray.push("gust_mph");
} }
if (air_quality_co) { if (air_quality_co) {
filterArray.push("air_quality_co"); filterArray.push("air_quality_co");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment