added device number parametr

This commit is contained in:
Ivan
2023-09-19 16:31:40 +03:00
parent 0b34293389
commit 9c56099c33
9 changed files with 139 additions and 56 deletions

View File

@ -93,7 +93,12 @@
<input type="number" id="channels-{{this.serial}}" value="{{this.channels}}" hidden>
<input type="radio" name="camera-serial" id="radio-{{this.serial}}" class="radio-input" value="{{this.serial}}" hidden>
<label for="radio-{{this.serial}}" class="radio-label active-{{this.status}}">
{{this.serial}}
{{#if this.number}}
{{this.number}}
{{else}}
{{this.serial}}
{{/if}}
</label>
</li>
{{/each}}
@ -421,13 +426,13 @@ const selectedDevices = Array.from(checkboxes)
function addMarker(device) {
const { serial, status, longitude, latitude, direction, speed } = device;
const { serial, status, longitude, latitude, direction, speed, number } = device;
if (serial === $("input[name=camera-serial]:checked").val()) {
var marker = L.divIcon({
className: 'marker',
html: `<div class="marker-name active-${status}">${serial}</div>
html: `<div class="marker-name active-${status}">${number !== null ? number : serial}</div>
<svg class="active-${status}" id="marker-${serial}" style="transform: rotate(${direction}deg)" xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26" fill="none">
<path fill="#FF6A4B" d="M12.669 24.673c6.565 0 12-5.435 12-12 0-6.553-5.447-12-12.012-12C6.104.673.67 6.12.67 12.673c0 6.565 5.447 12 12 12Z"/>
<path fill="#fff" fill-opacity=".85" d="m7.104 17.92 4.683-11.93c.33-.823 1.423-.846 1.753-.023l4.682 11.953c.318.788-.553 1.47-1.294.73l-3.953-3.953c-.188-.2-.424-.2-.612 0L8.41 18.65c-.753.74-1.623.059-1.306-.73Z"/>
@ -436,7 +441,7 @@ const selectedDevices = Array.from(checkboxes)
} else {
var marker = L.divIcon({
className: 'marker',
html: `<div class="marker-name active-${status}">${serial}</div>
html: `<div class="marker-name active-${status}">${number !== null ? number : serial}</div>
<svg class="active-${status}" id="marker-${serial}" style="transform: rotate(${direction}deg)" xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26" fill="none">
<path d="M12.9815 25.0195C19.5462 25.0336 24.9931 19.6101 25.0073 13.0454C25.0214 6.49253 19.5861 1.03375 13.0214 1.01961C6.46848 1.00549 1.02147 6.44081 1.00735 12.9937C0.993201 19.5584 6.42852 25.0054 12.9815 25.0195Z" fill="#8086F9"/>
<path d="M7.43175 18.2547L12.1398 6.33536C12.471 5.51254 13.5652 5.49137 13.8928 6.31561L18.5493 18.2786C18.8653 19.0675 17.9932 19.748 17.2537 19.0052L13.3092 15.0438C13.1215 14.8434 12.8862 14.8429 12.6975 15.0425L8.73605 18.9868C7.98152 19.7264 7.1124 19.0422 7.43175 18.2547Z" fill="white" fill-opacity="0.85"/>