|
@@ -10,7 +10,7 @@ export default (langName, lang) => new Elysia({ prefix: `/history` })
|
|
|
return eta.render(`${langName}/history/index`, { })
|
|
return eta.render(`${langName}/history/index`, { })
|
|
|
})
|
|
})
|
|
|
.get(`/:property`, ({ params: { property }, set }) => {
|
|
.get(`/:property`, ({ params: { property }, set }) => {
|
|
|
- const data = Meteostanica.getDataProperty(property)
|
|
|
|
|
|
|
+ const data = Meteostanica.getDataPropertyMonthly(property, `2026-03`)
|
|
|
|
|
|
|
|
if (!data) {
|
|
if (!data) {
|
|
|
set.headers['content-type'] = 'text/html; charset=utf8'
|
|
set.headers['content-type'] = 'text/html; charset=utf8'
|
|
@@ -19,4 +19,48 @@ export default (langName, lang) => new Elysia({ prefix: `/history` })
|
|
|
|
|
|
|
|
set.headers['content-type'] = 'text/html; charset=utf8'
|
|
set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
return eta.render(`${langName}/history/property`, { lang, property, data })
|
|
return eta.render(`${langName}/history/property`, { lang, property, data })
|
|
|
|
|
+ })
|
|
|
|
|
+ .get(`/:property/daily`, ({ params: { property }, set }) => {
|
|
|
|
|
+ const data = Meteostanica.getDataPropertyDaily(property, `2026-03-01`)
|
|
|
|
|
+
|
|
|
|
|
+ if (!data) {
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/notFound`, { property })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/property`, { lang, type: `daily`, property, data })
|
|
|
|
|
+ })
|
|
|
|
|
+ .get(`/:property/monthly`, ({ params: { property }, set }) => {
|
|
|
|
|
+ const data = Meteostanica.getDataPropertyMonthly(property, `2026-03`)
|
|
|
|
|
+
|
|
|
|
|
+ if (!data) {
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/notFound`, { property })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/property`, { lang, type: `monthly`, property, data })
|
|
|
|
|
+ })
|
|
|
|
|
+ .get(`/:property/yearly`, ({ params: { property }, set }) => {
|
|
|
|
|
+ const data = Meteostanica.getDataPropertyYearly(property, `2026`)
|
|
|
|
|
+
|
|
|
|
|
+ if (!data) {
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/notFound`, { property })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/property`, { lang, type: `yearly`, property, data })
|
|
|
|
|
+ })
|
|
|
|
|
+ .get(`/:property/allTime`, ({ params: { property }, set }) => {
|
|
|
|
|
+ const data = Meteostanica.getDataPropertyAllTime(property)
|
|
|
|
|
+
|
|
|
|
|
+ if (!data) {
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/notFound`, { property })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ set.headers['content-type'] = 'text/html; charset=utf8'
|
|
|
|
|
+ return eta.render(`${langName}/history/property`, { lang, type: `allTime`, property, data })
|
|
|
})
|
|
})
|