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
ca8fe76d
Commit
ca8fe76d
authored
Jun 09, 2024
by
EnesKarakas
Browse files
csy
parent
3c0e9b8d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/weather/currentData.js
View file @
ca8fe76d
...
...
@@ -18,8 +18,24 @@ const Currentdata = (props) => {
<
div
>
<
div
className
=
"
thq-grid-5
"
>
<
div
class
=
"
filter
"
>
<
label
for
=
"
location
"
>
Location
:
<
/label
>
<
input
type
=
"
text
"
id
=
"
city_text
"
placeholder
=
"
Location
"
/>
<
label
htmlFor
=
"
location
"
>
Location
:
<
/label
>
<
input
type
=
"
text
"
id
=
"
city_text
"
placeholder
=
"
Location
"
value
=
{
query
}
onChange
=
{
handleInputChange
}
/
>
{
data
.
map
((
item
)
=>
(
<
ListItem
key
=
{
item
.
id
}
name
=
{
item
.
name
}
country
=
{
item
.
country
}
region
=
{
item
.
region
}
lat
=
{
item
.
lat
}
lon
=
{
item
.
lon
}
/
>
))}
<
br
/>
<
label
for
=
"
region
"
>
Region
:
<
/label
>
<
input
type
=
"
text
"
id
=
"
region_text
"
placeholder
=
"
Region
"
/>
...
...
@@ -420,7 +436,7 @@ const Currentdata = (props) => {
console
.
log
(
"
FilterString =
"
+
filterString
);
const
apiUrl
=
`http://localhost:8080/currentweather?q=
${
city
_text
}
&filter=
${
filterString
}
`
;
const
apiUrl
=
`http://localhost:8080/currentweather?q=
${
latitude_text
}
,
${
longitude
_text
}
&filter=
${
filterString
}
`
;
fetch
(
apiUrl
)
.
then
((
response
)
=>
{
...
...
@@ -470,7 +486,11 @@ const Currentdata = (props) => {
const
ListItem
=
({
name
,
country
,
region
,
lat
,
lon
})
=>
{
const
handleClick
=
()
=>
{
alert
(
`Element geklickt:
${
name
}
`
);
document
.
getElementById
(
"
city_text
"
).
value
=
name
;
document
.
getElementById
(
"
region_text
"
).
value
=
country
;
document
.
getElementById
(
"
country_text
"
).
value
=
region
;
document
.
getElementById
(
"
latitude_text
"
).
value
=
lat
;
document
.
getElementById
(
"
longitude_text
"
).
value
=
lon
;
};
return
(
...
...
frontend/src/components/weather/historicalWeatherData.js
View file @
ca8fe76d
This diff is collapsed.
Click to expand it.
frontend/src/components/weather/weatherForecastData.js
View file @
ca8fe76d
This diff is collapsed.
Click to expand it.
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