Commit 82d812a0 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 613e2d74 130df6b6
......@@ -93,7 +93,7 @@ const Currentdata = (props) => {
<label> Last Updated</label>
<br />
<input type="checkbox" id="temp" className="checkBoxFilter" />
<label for="temp">Temp C</label>
<label for="temp">Temp</label>
<br />
<input type="checkbox" id="id_day" className="checkBoxFilter" />
<label for="id_day">ID Day</label>
......@@ -344,7 +344,7 @@ const Currentdata = (props) => {
filterArray.push("last_updated");
}
if (temp) {
if (units == world) {
if (units == "world") {
filterArray.push("temp_c");
} else {
filterArray.push("temp_f");
......@@ -364,7 +364,7 @@ const Currentdata = (props) => {
filterArray.push("condition_code");
}
if (wind) {
if (units == world) {
if (units == "world") {
filterArray.push("wind_kph");
} else {
filterArray.push("wind_mph");
......@@ -377,14 +377,14 @@ const Currentdata = (props) => {
filterArray.push("wind_dir");
}
if (pressure) {
if (units == world) {
if (units == "world") {
filterArray.push("temp_mb");
} else {
filterArray.push("pressure_in");
}
}
if (precip) {
if (units == world) {
if (units == "world") {
filterArray.push("temp_mm");
} else {
filterArray.push("precip_in");
......@@ -397,35 +397,35 @@ const Currentdata = (props) => {
filterArray.push("cloud");
}
if (feelslike) {
if (units == world) {
if (units == "world") {
filterArray.push("feelslike_c");
} else {
filterArray.push("feelslike_f");
}
}
if (windchill) {
if (units == world) {
if (units == "world") {
filterArray.push("windchill_c");
} else {
filterArray.push("windchill_f");
}
}
if (heatindex) {
if (units == world) {
if (units == "world") {
filterArray.push("heatindex_c");
} else {
filterArray.push("heatindex_f");
}
}
if (dewpoint) {
if (units == world) {
if (units == "world") {
filterArray.push("dewpoint_c");
} else {
filterArray.push("dewpoint_f");
}
}
if (vis) {
if (units == world) {
if (units == "world") {
filterArray.push("vis_miles");
} else {
filterArray.push("vis_miles");
......@@ -435,7 +435,7 @@ const Currentdata = (props) => {
filterArray.push("uv");
}
if (gust) {
if (units == world) {
if (units == "world") {
filterArray.push("gust_kph");
} else {
filterArray.push("gust_mph");
......
......@@ -213,27 +213,6 @@ const WeatherForecastData = (props) => {
<input type="checkbox" id="hour_is_day" class="checkBoxFilter" />
<label for="hour_is_day">Hour Is Day</label>
<br />
<input
type="checkbox"
id="hour_condition_text"
class="checkBoxFilter"
/>
<label for="hour_condition_text">Hour Condition Text</label>
<br />
<input
type="checkbox"
id="hour_condition_icon"
class="checkBoxFilter"
/>
<label for="hour_condition_icon">Hour Condition Icon</label>
<br />
<input
type="checkbox"
id="hour_condition_code"
class="checkBoxFilter"
/>
<label for="hour_condition_code">Hour Condition Code</label>
<br />
<input type="checkbox" id="hour_wind" class="checkBoxFilter" />
<label for="hour_wind">Hour Wind</label>
<br />
......@@ -299,6 +278,18 @@ const WeatherForecastData = (props) => {
/>
<label for="hour_dewpoint">Hour Dew Point</label>
<br />
<input type="checkbox" id="hourly_will_it_rain" class="checkBoxFilter" />
<label for="hourly_will_it_rain">Will it Rain</label>
<br />
<input type="checkbox" id="hourly_chance_of_rain" class="checkBoxFilter" />
<label for="hourly_chance_of_rain">Chance of Rain</label>
<br />
<input type="checkbox" id="hourly_will_it_snow" class="checkBoxFilter" />
<label for="hourly_will_it_snow">Will it Snow</label>
<br />
<input type="checkbox" id="hourly_chance_of_snow" class="checkBoxFilter" />
<label for="hourly_chance_of_snow">Chance of Snow</label>
<br />
<input type="checkbox" id="hour_vis" class="checkBoxFilter" />
<label for="hour_vis">Hour Visibility</label>
<br />
......@@ -349,6 +340,9 @@ const WeatherForecastData = (props) => {
);
function getData() {
const units = document.getElementById("units").value;
const city = document.getElementById("city_text").value;
const region = document.getElementById("region_text").value;
const country = document.getElementById("country_text").value;
......@@ -421,6 +415,10 @@ const WeatherForecastData = (props) => {
const hour_windchill = document.getElementById("hour_windchill").checked;
const hour_heatindex = document.getElementById("hour_heatindex").checked;
const hour_dewpoint = document.getElementById("hour_dewpoint").checked;
const hourly_will_it_rain = document.getElementById("hourly_will_it_rain").checked;
const hourly_chance_of_rain = document.getElementById("hourly_chance_of_rain").checked;
const hourly_will_it_snow = document.getElementById("hourly_will_it_snow").checked;
const hourly_chance_of_snow = document.getElementById("hourly_chance_of_snow").checked;
const hour_vis = document.getElementById("hour_vis").checked;
const hour_gust = document.getElementById("hour_gust").checked;
const hour_uv = document.getElementById("hour_uv").checked;
......@@ -439,12 +437,27 @@ const WeatherForecastData = (props) => {
if (last_updated) filterArray.push("last_updated");
if (date) filterArray.push("date");
if (date_epoch) filterArray.push("date_epoch");
if (maxtemp) filterArray.push("maxtemp");
if (mintemp) filterArray.push("mintemp");
if (avgtemp) filterArray.push("avgtemp");
if (maxwind) filterArray.push("maxwind");
if (totalprecip) filterArray.push("totalprecip");
if (avgvis) filterArray.push("avgvis");
if (maxtemp) if(units=="world"){
filterArray.push("maxtemp_c");
}else{
filterArray.push("maxtemp_f");}
if (mintemp) if(units=="world"){
filterArray.push("mintemp_c");
}else{filterArray.push("mintemp");}
if (avgtemp) if(units=="world"){
filterArray.push("avgtemp_c");
}else{filterArray.push("avgtemp_f");
}
if (maxwind) if(units=="world"){
filterArray.push("maxwind_kph");
}else{filterArray.push("maxwind_mph");}
if (totalprecip)if(units=="world"){
filterArray.push("totalprecip_mm");
}else{ filterArray.push("totalprecip_in");}
if (avgvis) if(units=="world"){
filterArray.push("avgis_km");
}else{
filterArray.push("avgvis_miles");}
if (avghumidity) filterArray.push("avghumidity");
if (daily_will_it_rain) filterArray.push("daily_will_it_rain");
if (daily_chance_of_rain) filterArray.push("daily_chance_of_rain");
......@@ -453,7 +466,7 @@ const WeatherForecastData = (props) => {
if (condition_text) filterArray.push("condition_text");
if (condition_icon) filterArray.push("condition_icon");
if (condition_code) filterArray.push("condition_code");
if (uv) filterArray.push("uv");
if (uv) filterArray.push("uv_day");
if (sunrise) filterArray.push("sunrise");
if (sunset) filterArray.push("sunset");
if (moonrise) filterArray.push("moonrise");
......@@ -462,24 +475,51 @@ const WeatherForecastData = (props) => {
if (moon_illumination) filterArray.push("moon_illumination");
if (hour_time_epoch) filterArray.push("hourly_time_epoch");
if (hour_time) filterArray.push("hourly_time");
if (hour_temp) filterArray.push("hourly_temp");
if (hour_temp) if(units=="world"){
filterArray.push("hourly_temp_c");
}else{
filterArray.push("hourly_temp_f");}
if (hour_is_day) filterArray.push("hourly_is_day");
if (hour_condition_text) filterArray.push("hourly_condition_text");
if (hour_condition_icon) filterArray.push("hourly_condition_icon");
if (hour_condition_code) filterArray.push("hourly_condition_code");
if (hour_wind) filterArray.push("hourly_wind");
if (hour_wind)if(units=="world"){
filterArray.push("hourly_wind_kph");
}else{
filterArray.push("hourly_wind_mph");}
if (hour_wind_degree) filterArray.push("hourly_wind_degree");
if (hour_wind_dir) filterArray.push("hourly_wind_dir");
if (hour_pressure) filterArray.push("hourly_pressure");
if (hour_precip) filterArray.push("hourly_precip");
if (hour_pressure) if(units=="world"){
filterArray.push("hourly_pressure_mb");
}else{filterArray.push("hourly_pressure_in");}
if (hour_precip) if(units=="world"){
filterArray.push("hourly_precip_mm");
}else{
filterArray.push("hourly_precip_in");}
if (hour_humidity) filterArray.push("hourly_humidity");
if (hour_cloud) filterArray.push("hourly_cloud");
if (hour_feelslike) filterArray.push("hourly_feelslike");
if (hour_windchill) filterArray.push("hourly_windchill");
if (hour_heatindex) filterArray.push("hourly_heatindex");
if (hour_dewpoint) filterArray.push("hourly_dewpoint");
if (hour_vis) filterArray.push("hourly_vis");
if (hour_gust) filterArray.push("hourly_gust");
if (hour_feelslike) if(units=="world"){
filterArray.push("hourly_feelslike_c");
}else{filterArray.push("hourly_feelslike_f");}
if (hour_windchill) if(units=="world"){
filterArray.push("hourly_windchill_c");
}else{filterArray.push("hourly_windchill_f");}
if (hour_heatindex)if(units=="world"){
filterArray.push("hourly_heatindex_c");
}else{ filterArray.push("hourly_heatindex_f");}
if (hour_dewpoint) if(units=="world"){
filterArray.push("hourly_dewpoint_c");
}else{
filterArray.push("hourly_dewpoint_f");}
if (hourly_will_it_rain) filterArray.push("hourly_will_it_rain");
if (hourly_chance_of_rain) filterArray.push("hourly_chance_of_rain");
if (hourly_will_it_snow) filterArray.push("hourly_will_it_snow");
if (hourly_chance_of_snow) filterArray.push("hourly_chance_of_snow");
if (hour_vis) if(units=="world"){
filterArray.push("hourly_vis_km");
}else{
filterArray.push("hourly_vis_miles");}
if (hour_gust) if(units=="world"){
filterArray.push("hourly_gust_kph");
}else{
filterArray.push("hourly_gust_mph");}
if (hour_uv) filterArray.push("hourly_uv");
let filterString = filterArray.join(",");
......
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