diff --git a/frontend/admin_panel.html b/frontend/admin_panel.html index 972fa39..5cee1ec 100644 --- a/frontend/admin_panel.html +++ b/frontend/admin_panel.html @@ -61,7 +61,7 @@

Администрирование

downloadObjectAsJson(body, 'data'); })); } - + function showFiles(input) { const file = input.files[0]; console.log(file); @@ -72,16 +72,15 @@

Администрирование

headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - data: e.target.result - }) + body: + e.target.result }) .then((resp) => resp.json().then((body) => { console.log(body); })); }; - reader.readAsDataURL(file); + reader.readAsText(file); } diff --git a/frontend/statistics.html b/frontend/statistics.html index 648e3e9..2cf88d3 100644 --- a/frontend/statistics.html +++ b/frontend/statistics.html @@ -35,17 +35,6 @@

Статистика

-
-
- - -
-
- - -
-
-
@@ -95,33 +84,19 @@

Статистика

const visit_date_min = document.querySelector("input[name='visit_date_min']").value; const visit_date_max = document.querySelector("input[name='visit_date_max']").value; - const longitude_from = document.querySelector("input[name='longitude_from']").value; - const longitude_to = document.querySelector("input[name='longitude_to']").value; - - const latitude_from = document.querySelector("input[name='latitude_from']").value; - const latitude_to = document.querySelector("input[name='latitude_to']").value; - let params = {}; if (address) params.address = address; if (title) params.title = title; if (rating_from) - params.rating_from = rating_from; + params.courtyard_rating_from = rating_from; if (rating_to) - params.rating_to = rating_to; + params.courtyard_rating_to = rating_to; if (visit_date_min) params.visited_from = visit_date_min; if (visit_date_max) params.visited_to = visit_date_max; - if (longitude_from) - params.longitude_from = longitude_from; - if (longitude_to) - params.longitude_to = longitude_to; - if (latitude_from) - params.latitude_from = latitude_from; - if (latitude_to) - params.latitude_to = latitude_to; fetch(`http://localhost:8081/statistic/visits?` + new URLSearchParams(params).toString(), { method: 'GET',