Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Karakas
SWP_SS24_Wetterdaten_sammeln
Commits
7d7865f4
Commit
7d7865f4
authored
Jun 09, 2024
by
EnesKarakas
Browse files
dawd
parent
37f4a8f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/weather/currentData.js
View file @
7d7865f4
...
...
@@ -242,31 +242,47 @@ const Currentdata = (props) => {
const
localtime_epoch
=
document
.
getElementById
(
"
localtime_epoch
"
).
checked
;
const
localtime
=
document
.
getElementById
(
"
localtime
"
).
checked
;
//current
const
temperature
=
document
.
getElementById
(
"
temperature
"
).
checked
;
const
isDay
=
document
.
getElementById
(
"
isDay
"
).
checked
;
const
condition
=
document
.
getElementById
(
"
condition
"
).
checked
;
const
last_updated_epoch
=
document
.
getElementById
(
"
last_updated_epoch
"
).
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
precip
itation
=
document
.
getElementById
(
"
precip
itation
"
).
checked
;
const
precip
=
document
.
getElementById
(
"
precip
"
).
checked
;
const
humidity
=
document
.
getElementById
(
"
humidity
"
).
checked
;
const
cloud
=
document
.
getElementById
(
"
cloud
"
).
checked
;
const
feelslikeTemp
=
document
.
getElementById
(
"
feelslikeTemp
"
).
checked
;
const
visibility
=
document
.
getElementById
(
"
visibility
"
).
checked
;
const
feelslike
=
document
.
getElementById
(
"
feelslike
"
).
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
gust
=
document
.
getElementById
(
"
gust
"
).
checked
;
const
airquality
=
boolToWord
(
document
.
getElementById
(
"
airquality
"
).
checked
);
const
unitTemperature
=
document
.
getElementById
(
"
unitTemperature
"
).
value
;
const
unitWindSpeed
=
document
.
getElementById
(
"
unitWindSpeed
"
).
value
;
const
unitPressure
=
document
.
getElementById
(
"
unitPressure
"
).
value
;
const
unitPrecipitation
=
document
.
getElementById
(
"
unitPrecipitation
"
).
value
;
const
output
=
document
.
getElementById
(
"
output
"
).
value
;
const
format
=
document
.
getElementById
(
"
format
"
).
value
;
const
air_quality_co
=
document
.
getElementById
(
"
air_quality_co
"
).
checked
;
const
air_quality_no2
=
document
.
getElementById
(
"
air_quality_no2
"
).
checked
;
const
air_quality_o3
=
document
.
getElementById
(
"
air_quality_o3
"
).
checked
;
const
air_quality_so2
=
document
.
getElementById
(
"
air_quality_so2
"
).
checked
;
const
air_quality_pm2_5
=
document
.
getElementById
(
"
air_quality_pm2_5
"
).
checked
;
const
air_quality_pm10
=
document
.
getElementById
(
"
air_quality_pm10
"
).
checked
;
const
air_quality_us_epa_index
=
document
.
getElementById
(
"
air_quality_us_epa_index
"
).
checked
;
const
air_quality_gb_defra_index
=
document
.
getElementById
(
"
air_quality_gb_defra_index
"
).
checked
;
let
filterArray
=
[];
if
(
document
.
getElementById
(
"
name
"
).
checked
)
{
if
(
name
)
{
filterArray
.
push
(
"
name
"
);
}
if
(
region
)
{
...
...
@@ -290,11 +306,102 @@ const Currentdata = (props) => {
if
(
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
(
"
,
"
);
console
.
log
(
filterString
);
console
.
log
(
"
FilterString =
"
+
filterString
);
const
apiUrl
=
`localhost:8080/currentw
a
ether?q=
${
city_text
}
&filter=
${
filterString
}
`
;
const
apiUrl
=
`
http://
localhost:8080/currentwe
a
ther?q=
${
city_text
}
&filter=
${
filterString
}
`
;
fetch
(
apiUrl
)
.
then
((
response
)
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment