devices organisation update, map optimize, bug fix

This commit is contained in:
Ivan
2023-10-06 03:57:23 +03:00
parent c1a4322410
commit d9cef4dac9
10 changed files with 174 additions and 14 deletions

View File

@ -100,7 +100,7 @@
<ul class="area">
{{#each Groups}}
<li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="{{name}}" class="checkbox-input" hidden checked><label for="{{name}}" class="checkbox-label">{{name}}</label>
<li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="{{name}}" class="checkbox-input" hidden checked><label for="{{name}}" class="checkbox-label checkbox-name"><span class="text">{{name}}</span></label>
<ul class="area-devices" id="devices-1">
{{#each devices}}
<li class="device">
@ -235,6 +235,22 @@
<script src="../scripts/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var containers = document.querySelectorAll('.checkbox-name');
containers.forEach(function (container) {
var text = container.querySelector('.text');
if (text.clientWidth > container.clientWidth) {
text.classList.add('animated');
}
});
});
</script>
<script>
function updateCameraOptions() {
var selectedSerial = document.querySelector('input[name="camera-serial"]:checked').value;
@ -468,6 +484,12 @@ async function sendPostRequest() {
// Создаем линию маршрута
const route = L.polyline(routePoints, { color: 'red',weight: 5 }).addTo(routeLayer);
// Находим границы координат для центрирования карты
const bounds = L.latLngBounds(routePoints);
// Центрируем карту по первой координате
map.fitBounds(bounds, { padding: [50, 50] });
})