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) => { ...@@ -93,7 +93,7 @@ const Currentdata = (props) => {
<label> Last Updated</label> <label> Last Updated</label>
<br /> <br />
<input type="checkbox" id="temp" className="checkBoxFilter" /> <input type="checkbox" id="temp" className="checkBoxFilter" />
<label for="temp">Temp C</label> <label for="temp">Temp</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>
...@@ -344,7 +344,7 @@ const Currentdata = (props) => { ...@@ -344,7 +344,7 @@ const Currentdata = (props) => {
filterArray.push("last_updated"); filterArray.push("last_updated");
} }
if (temp) { if (temp) {
if (units == world) { if (units == "world") {
filterArray.push("temp_c"); filterArray.push("temp_c");
} else { } else {
filterArray.push("temp_f"); filterArray.push("temp_f");
...@@ -364,7 +364,7 @@ const Currentdata = (props) => { ...@@ -364,7 +364,7 @@ const Currentdata = (props) => {
filterArray.push("condition_code"); filterArray.push("condition_code");
} }
if (wind) { if (wind) {
if (units == world) { if (units == "world") {
filterArray.push("wind_kph"); filterArray.push("wind_kph");
} else { } else {
filterArray.push("wind_mph"); filterArray.push("wind_mph");
...@@ -377,14 +377,14 @@ const Currentdata = (props) => { ...@@ -377,14 +377,14 @@ const Currentdata = (props) => {
filterArray.push("wind_dir"); filterArray.push("wind_dir");
} }
if (pressure) { if (pressure) {
if (units == world) { if (units == "world") {
filterArray.push("temp_mb"); filterArray.push("temp_mb");
} else { } else {
filterArray.push("pressure_in"); filterArray.push("pressure_in");
} }
} }
if (precip) { if (precip) {
if (units == world) { if (units == "world") {
filterArray.push("temp_mm"); filterArray.push("temp_mm");
} else { } else {
filterArray.push("precip_in"); filterArray.push("precip_in");
...@@ -397,35 +397,35 @@ const Currentdata = (props) => { ...@@ -397,35 +397,35 @@ const Currentdata = (props) => {
filterArray.push("cloud"); filterArray.push("cloud");
} }
if (feelslike) { if (feelslike) {
if (units == world) { if (units == "world") {
filterArray.push("feelslike_c"); filterArray.push("feelslike_c");
} else { } else {
filterArray.push("feelslike_f"); filterArray.push("feelslike_f");
} }
} }
if (windchill) { if (windchill) {
if (units == world) { if (units == "world") {
filterArray.push("windchill_c"); filterArray.push("windchill_c");
} else { } else {
filterArray.push("windchill_f"); filterArray.push("windchill_f");
} }
} }
if (heatindex) { if (heatindex) {
if (units == world) { if (units == "world") {
filterArray.push("heatindex_c"); filterArray.push("heatindex_c");
} else { } else {
filterArray.push("heatindex_f"); filterArray.push("heatindex_f");
} }
} }
if (dewpoint) { if (dewpoint) {
if (units == world) { if (units == "world") {
filterArray.push("dewpoint_c"); filterArray.push("dewpoint_c");
} else { } else {
filterArray.push("dewpoint_f"); filterArray.push("dewpoint_f");
} }
} }
if (vis) { if (vis) {
if (units == world) { if (units == "world") {
filterArray.push("vis_miles"); filterArray.push("vis_miles");
} else { } else {
filterArray.push("vis_miles"); filterArray.push("vis_miles");
...@@ -435,7 +435,7 @@ const Currentdata = (props) => { ...@@ -435,7 +435,7 @@ const Currentdata = (props) => {
filterArray.push("uv"); filterArray.push("uv");
} }
if (gust) { if (gust) {
if (units == world) { if (units == "world") {
filterArray.push("gust_kph"); filterArray.push("gust_kph");
} else { } else {
filterArray.push("gust_mph"); filterArray.push("gust_mph");
......
...@@ -213,27 +213,6 @@ const WeatherForecastData = (props) => { ...@@ -213,27 +213,6 @@ const WeatherForecastData = (props) => {
<input type="checkbox" id="hour_is_day" class="checkBoxFilter" /> <input type="checkbox" id="hour_is_day" class="checkBoxFilter" />
<label for="hour_is_day">Hour Is Day</label> <label for="hour_is_day">Hour Is Day</label>
<br /> <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" /> <input type="checkbox" id="hour_wind" class="checkBoxFilter" />
<label for="hour_wind">Hour Wind</label> <label for="hour_wind">Hour Wind</label>
<br /> <br />
...@@ -299,6 +278,18 @@ const WeatherForecastData = (props) => { ...@@ -299,6 +278,18 @@ const WeatherForecastData = (props) => {
/> />
<label for="hour_dewpoint">Hour Dew Point</label> <label for="hour_dewpoint">Hour Dew Point</label>
<br /> <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" /> <input type="checkbox" id="hour_vis" class="checkBoxFilter" />
<label for="hour_vis">Hour Visibility</label> <label for="hour_vis">Hour Visibility</label>
<br /> <br />
...@@ -349,6 +340,9 @@ const WeatherForecastData = (props) => { ...@@ -349,6 +340,9 @@ const WeatherForecastData = (props) => {
); );
function getData() { function getData() {
const units = document.getElementById("units").value;
const city = document.getElementById("city_text").value; const city = document.getElementById("city_text").value;
const region = document.getElementById("region_text").value; const region = document.getElementById("region_text").value;
const country = document.getElementById("country_text").value; const country = document.getElementById("country_text").value;
...@@ -421,6 +415,10 @@ const WeatherForecastData = (props) => { ...@@ -421,6 +415,10 @@ const WeatherForecastData = (props) => {
const hour_windchill = document.getElementById("hour_windchill").checked; const hour_windchill = document.getElementById("hour_windchill").checked;
const hour_heatindex = document.getElementById("hour_heatindex").checked; const hour_heatindex = document.getElementById("hour_heatindex").checked;
const hour_dewpoint = document.getElementById("hour_dewpoint").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_vis = document.getElementById("hour_vis").checked;
const hour_gust = document.getElementById("hour_gust").checked; const hour_gust = document.getElementById("hour_gust").checked;
const hour_uv = document.getElementById("hour_uv").checked; const hour_uv = document.getElementById("hour_uv").checked;
...@@ -439,12 +437,27 @@ const WeatherForecastData = (props) => { ...@@ -439,12 +437,27 @@ const WeatherForecastData = (props) => {
if (last_updated) filterArray.push("last_updated"); if (last_updated) filterArray.push("last_updated");
if (date) filterArray.push("date"); if (date) filterArray.push("date");
if (date_epoch) filterArray.push("date_epoch"); if (date_epoch) filterArray.push("date_epoch");
if (maxtemp) filterArray.push("maxtemp"); if (maxtemp) if(units=="world"){
if (mintemp) filterArray.push("mintemp"); filterArray.push("maxtemp_c");
if (avgtemp) filterArray.push("avgtemp"); }else{
if (maxwind) filterArray.push("maxwind"); filterArray.push("maxtemp_f");}
if (totalprecip) filterArray.push("totalprecip"); if (mintemp) if(units=="world"){
if (avgvis) filterArray.push("avgvis"); 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 (avghumidity) filterArray.push("avghumidity");
if (daily_will_it_rain) filterArray.push("daily_will_it_rain"); if (daily_will_it_rain) filterArray.push("daily_will_it_rain");
if (daily_chance_of_rain) filterArray.push("daily_chance_of_rain"); if (daily_chance_of_rain) filterArray.push("daily_chance_of_rain");
...@@ -453,7 +466,7 @@ const WeatherForecastData = (props) => { ...@@ -453,7 +466,7 @@ const WeatherForecastData = (props) => {
if (condition_text) filterArray.push("condition_text"); if (condition_text) filterArray.push("condition_text");
if (condition_icon) filterArray.push("condition_icon"); if (condition_icon) filterArray.push("condition_icon");
if (condition_code) filterArray.push("condition_code"); if (condition_code) filterArray.push("condition_code");
if (uv) filterArray.push("uv"); if (uv) filterArray.push("uv_day");
if (sunrise) filterArray.push("sunrise"); if (sunrise) filterArray.push("sunrise");
if (sunset) filterArray.push("sunset"); if (sunset) filterArray.push("sunset");
if (moonrise) filterArray.push("moonrise"); if (moonrise) filterArray.push("moonrise");
...@@ -462,24 +475,51 @@ const WeatherForecastData = (props) => { ...@@ -462,24 +475,51 @@ const WeatherForecastData = (props) => {
if (moon_illumination) filterArray.push("moon_illumination"); if (moon_illumination) filterArray.push("moon_illumination");
if (hour_time_epoch) filterArray.push("hourly_time_epoch"); if (hour_time_epoch) filterArray.push("hourly_time_epoch");
if (hour_time) filterArray.push("hourly_time"); 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_is_day) filterArray.push("hourly_is_day");
if (hour_condition_text) filterArray.push("hourly_condition_text"); if (hour_wind)if(units=="world"){
if (hour_condition_icon) filterArray.push("hourly_condition_icon"); filterArray.push("hourly_wind_kph");
if (hour_condition_code) filterArray.push("hourly_condition_code"); }else{
if (hour_wind) filterArray.push("hourly_wind"); filterArray.push("hourly_wind_mph");}
if (hour_wind_degree) filterArray.push("hourly_wind_degree"); if (hour_wind_degree) filterArray.push("hourly_wind_degree");
if (hour_wind_dir) filterArray.push("hourly_wind_dir"); if (hour_wind_dir) filterArray.push("hourly_wind_dir");
if (hour_pressure) filterArray.push("hourly_pressure"); if (hour_pressure) if(units=="world"){
if (hour_precip) filterArray.push("hourly_precip"); 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_humidity) filterArray.push("hourly_humidity");
if (hour_cloud) filterArray.push("hourly_cloud"); if (hour_cloud) filterArray.push("hourly_cloud");
if (hour_feelslike) filterArray.push("hourly_feelslike"); if (hour_feelslike) if(units=="world"){
if (hour_windchill) filterArray.push("hourly_windchill"); filterArray.push("hourly_feelslike_c");
if (hour_heatindex) filterArray.push("hourly_heatindex"); }else{filterArray.push("hourly_feelslike_f");}
if (hour_dewpoint) filterArray.push("hourly_dewpoint"); if (hour_windchill) if(units=="world"){
if (hour_vis) filterArray.push("hourly_vis"); filterArray.push("hourly_windchill_c");
if (hour_gust) filterArray.push("hourly_gust"); }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"); if (hour_uv) filterArray.push("hourly_uv");
let filterString = filterArray.join(","); 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