Commit 7d7865f4 authored by EnesKarakas's avatar EnesKarakas
Browse files

dawd

parent 37f4a8f6
...@@ -242,31 +242,47 @@ const Currentdata = (props) => { ...@@ -242,31 +242,47 @@ const Currentdata = (props) => {
const localtime_epoch = document.getElementById("localtime_epoch").checked; const localtime_epoch = document.getElementById("localtime_epoch").checked;
const localtime = document.getElementById("localtime").checked; const localtime = document.getElementById("localtime").checked;
//current //current
const temperature = document.getElementById("temperature").checked; const last_updated_epoch =
const isDay = document.getElementById("isDay").checked; document.getElementById("last_updated_epoch").checked;
const condition = document.getElementById("condition").checked; const last_updated = document.getElementById("last_updated").checked;
const temp_c = document.getElementById("temp_c").checked;
const temp_f = document.getElementById("temp_f").checked;
const id_day = document.getElementById("id_day").checked;
const condition_text = document.getElementById("condition_text").checked;
const condition_icon = document.getElementById("condition_icon").checked;
const condition_code = document.getElementById("condition_code").checked;
const wind = document.getElementById("wind").checked;
const wind_degree = document.getElementById("wind_degree").checked;
const wind_dir = document.getElementById("wind_dir").checked;
const pressure = document.getElementById("pressure").checked; const pressure = document.getElementById("pressure").checked;
const precipitation = document.getElementById("precipitation").checked; const precip = document.getElementById("precip").checked;
const humidity = document.getElementById("humidity").checked; const humidity = document.getElementById("humidity").checked;
const cloud = document.getElementById("cloud").checked; const cloud = document.getElementById("cloud").checked;
const feelslikeTemp = document.getElementById("feelslikeTemp").checked; const feelslike = document.getElementById("feelslike").checked;
const visibility = document.getElementById("visibility").checked; const windchill = document.getElementById("windchill").checked;
const heatindex = document.getElementById("heatindex").checked;
const dewpoint = document.getElementById("dewpoint").checked;
const vis = document.getElementById("vis").checked;
const uv = document.getElementById("uv").checked; const uv = document.getElementById("uv").checked;
const gust = document.getElementById("gust").checked; const gust = document.getElementById("gust").checked;
const airquality = boolToWord( const air_quality_co = document.getElementById("air_quality_co").checked;
document.getElementById("airquality").checked const air_quality_no2 = document.getElementById("air_quality_no2").checked;
); const air_quality_o3 = document.getElementById("air_quality_o3").checked;
const unitTemperature = document.getElementById("unitTemperature").value; const air_quality_so2 = document.getElementById("air_quality_so2").checked;
const unitWindSpeed = document.getElementById("unitWindSpeed").value; const air_quality_pm2_5 =
const unitPressure = document.getElementById("unitPressure").value; document.getElementById("air_quality_pm2_5").checked;
const unitPrecipitation = const air_quality_pm10 =
document.getElementById("unitPrecipitation").value; document.getElementById("air_quality_pm10").checked;
const output = document.getElementById("output").value; const air_quality_us_epa_index = document.getElementById(
const format = document.getElementById("format").value; "air_quality_us_epa_index"
).checked;
const air_quality_gb_defra_index = document.getElementById(
"air_quality_gb_defra_index"
).checked;
let filterArray = []; let filterArray = [];
if (document.getElementById("name").checked) { if (name) {
filterArray.push("name"); filterArray.push("name");
} }
if (region) { if (region) {
...@@ -290,11 +306,102 @@ const Currentdata = (props) => { ...@@ -290,11 +306,102 @@ const Currentdata = (props) => {
if (localtime) { if (localtime) {
filterArray.push("localtime"); filterArray.push("localtime");
} }
if (last_updated_epoch) {
filterArray.push("last_updated_epoch");
}
if (last_updated) {
filterArray.push("last_updated");
}
if (temp_c) {
filterArray.push("temp_c");
}
if (temp_f) {
filterArray.push("temp_f");
}
if (id_day) {
filterArray.push("id_day");
}
if (condition_text) {
filterArray.push("condition_text");
}
if (condition_icon) {
filterArray.push("condition_icon");
}
if (condition_code) {
filterArray.push("condition_code");
}
if (wind) {
filterArray.push("wind");
}
if (wind_degree) {
filterArray.push("wind_degree");
}
if (wind_dir) {
filterArray.push("wind_dir");
}
if (pressure) {
filterArray.push("pressure");
}
if (precip) {
filterArray.push("precip");
}
if (humidity) {
filterArray.push("humidity");
}
if (cloud) {
filterArray.push("cloud");
}
if (feelslike) {
filterArray.push("feelslike");
}
if (windchill) {
filterArray.push("windchill");
}
if (heatindex) {
filterArray.push("heatindex");
}
if (dewpoint) {
filterArray.push("dewpoint");
}
if (vis) {
filterArray.push("vis");
}
if (uv) {
filterArray.push("uv");
}
if (gust) {
filterArray.push("gust");
}
if (air_quality_co) {
filterArray.push("air_quality_co");
}
if (air_quality_no2) {
filterArray.push("air_quality_no2");
}
if (air_quality_o3) {
filterArray.push("air_quality_o3");
}
if (air_quality_so2) {
filterArray.push("air_quality_so2");
}
if (air_quality_pm2_5) {
filterArray.push("air_quality_pm2_5");
}
if (air_quality_pm10) {
filterArray.push("air_quality_pm10");
}
if (air_quality_us_epa_index) {
filterArray.push("air_quality_us_epa_index");
}
if (air_quality_gb_defra_index) {
filterArray.push("air_quality_gb_defra_index");
}
let filterString = filterArray.join(","); let filterString = filterArray.join(",");
console.log(filterString); console.log("FilterString = " + filterString);
const apiUrl = `localhost:8080/currentwaether?q=${city_text}&filter=${filterString}`; const apiUrl = `http://localhost:8080/currentweather?q=${city_text}&filter=${filterString}`;
fetch(apiUrl) fetch(apiUrl)
.then((response) => { .then((response) => {
......
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