devices, drivers, alerts and more
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Устройства</title>
|
||||
<title>Водители</title>
|
||||
<link rel="stylesheet" href="../styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
@ -49,19 +49,30 @@
|
||||
</section>
|
||||
|
||||
<section class="main">
|
||||
{{#if ifDBError}}
|
||||
<section class="dberror">
|
||||
<div class="erorr-container">
|
||||
<img src="../img/warning.svg"> <br>
|
||||
<h1>Ошибка </h1> <br>
|
||||
<span>Не удалось получить данные из БД</span>
|
||||
<button type="button" onclick="location.reload();">Повторить попытку</button>
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
<div class="name">
|
||||
<span>Устройства</span>
|
||||
</div>
|
||||
<nav>
|
||||
<a href="/devices">Список устройств</a>
|
||||
<a class="selected" href="/devices/drivers">Водители</a>
|
||||
<a href="/devices/newdevice">Добавить устройство</a>
|
||||
<a href="/devices/newdriver">Добавить водителя</a>
|
||||
<!-- <a href="/devices/newdevice">Добавить устройство</a> -->
|
||||
<!-- <a href="/devices/newdriver">Добавить водителя</a> -->
|
||||
|
||||
<a class="update" href="/devices/update">Обновление ПО</a>
|
||||
</nav>
|
||||
<section class="bg">
|
||||
<section class="content">
|
||||
|
||||
|
||||
<section class="for-table">
|
||||
|
||||
@ -69,7 +80,7 @@
|
||||
<h1>Организация</h1>
|
||||
|
||||
<ul class="area">
|
||||
<li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="name-1" class="checkbox-input" hidden checked><label for="name-1" class="checkbox-label">Группа 1</label>
|
||||
<!-- <li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="name-1" class="checkbox-input" hidden checked><label for="name-1" class="checkbox-label">Группа 1</label>
|
||||
<ul class="area-devices" id="devices-1">
|
||||
<li class="device"><img><input type="checkbox" id="1-device-1" class="checkbox-input device-filter" value="1-device-1" hidden checked><label for="1-device-1" class="checkbox-label"><div class="checkmark"></div>Трамваи</label></li>
|
||||
<li class="device"><img><input type="checkbox" id="1-device-2" class="checkbox-input device-filter" value="1-device-2" hidden checked><label for="1-device-2" class="checkbox-label"><div class="checkmark"></div>Маршрутки</label></li>
|
||||
@ -87,8 +98,10 @@
|
||||
<ul class="area-devices" id="devices-3">
|
||||
<li class="device"><img><input type="checkbox" id="3-device-1" class="checkbox-input device-filter" value="3-device-1" hidden checked><label for="3-device-1" class="checkbox-label"><div class="checkmark"></div>Маршрутки</label></li>
|
||||
</ul>
|
||||
</li>
|
||||
</li> -->
|
||||
</ul>
|
||||
|
||||
<button onclick="openNew()">Добавить водителя</button>
|
||||
|
||||
</section>
|
||||
|
||||
@ -138,8 +151,543 @@
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section id="form-bg" class="edit-container">
|
||||
|
||||
<section id="editForm">
|
||||
<section class="for-new">
|
||||
|
||||
<section class="stages">
|
||||
<input name="newStageEdit" type="radio" value="main" id="stage-main-edit" checked><label for="stage-main-edit">Основная информация</label>
|
||||
<div class="vertical-line"></div>
|
||||
<input name="newStageEdit" type="radio" value="details" id="stage-details-edit"><label for="stage-details-edit">Детали</label>
|
||||
</section>
|
||||
</section>
|
||||
<section id="add-new-container" class="add-new">
|
||||
<img src="../img/xmark.svg" id="close-form-btn" onclick="closeForm()">
|
||||
|
||||
<form id="edit-form" enctype="multipart/form-data" method="post" action="/updatedriver">
|
||||
<input type="text" id="driver-id-edit" name="driverID" hidden>
|
||||
|
||||
<div id="main-edit" class="new-parameters drivers active">
|
||||
|
||||
<h1>Основная информация</h1>
|
||||
<h2>Сперва самое необходимое</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<label for="parameters-plate">Фотография<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<div id="upload-photo-edit" class="upload-input">
|
||||
<!-- <img src="../img/upload.svg">
|
||||
<span class="upload-text">Загрузить фотографию водителя</span>
|
||||
<span class="upload-description">PNG, JPG (макс 20 мб)</span> -->
|
||||
<img src="../img/warning.svg">
|
||||
<span class="upload-text">Временно недоступно редактирование фотографии</span>
|
||||
<span class="upload-description">Остальная информация изменяется</span>
|
||||
</div>
|
||||
<input id="input-upload-photo-edit" type="file" accept=".png, .jpg, .jpeg" name="upload-file" style="display: none;">
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<label for="driver-name-edit">Имя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverName" type="text" id="driver-name-edit" placeholder="Имя водителя" required>
|
||||
|
||||
<label for="driver-surname-edit">Фамилия<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverSurname" type="text" id="driver-surname-edit" placeholder="Фамилия водителя" required>
|
||||
|
||||
<label for="driver-card-edit">Карта водителя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverCard" type="text" id="driver-card-edit" placeholder="Номер карты водителя" required>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button id="continue-main-edit" type="button">Продолжить</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="details-edit" class="new-parameters">
|
||||
|
||||
<h1>Детальная информация</h1>
|
||||
<h2>Для удобства в идентификации</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-gender-edit">Пол</label>
|
||||
<select name="driverGender" id="driver-gender-edit">
|
||||
<option value="NS">Не указывать</option>
|
||||
<option value="male">Мужской</option>
|
||||
<option value="female">Женский</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-license-edit">Водительское удостоверение<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverLicense" type="text" id="driver-license-edit" placeholder="Номер водительского удостоверения" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-passport-edit">Удостоверение личности<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverPassport" type="text" id="driver-passport-edit" placeholder="Номер удостоверения личности" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-phone-edit">Мобильный телефон<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverPhone" type="text" id="driver-phone-edit" placeholder="Номер мобильного телефона" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-email-edit">Электронная почта<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverEmail" type="text" id="driver-email-edit" placeholder="Электронная почта" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-transport-edit">Транспортное средство</label>
|
||||
<select name="driverTransport" id="driver-transport-edit">
|
||||
<option value="NS">Не указывать</option>
|
||||
{{#each Registrars}}
|
||||
<option value="{{this}}">{{this}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="driver-description-edit">Примечание</label>
|
||||
<input name="driverDescription" type="text" id="driver-description-edit" placeholder="Примечание">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button type="submit" id="send-edit">Сохранить</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<section id="newForm">
|
||||
<section class="for-new">
|
||||
|
||||
<section class="stages">
|
||||
<input name="newStage" type="radio" value="main" id="stage-main" checked><label for="stage-main">Основная информация</label>
|
||||
<div class="vertical-line"></div>
|
||||
<input name="newStage" type="radio" value="details" id="stage-details"><label for="stage-details">Детали</label>
|
||||
</section>
|
||||
</section>
|
||||
<section id="add-new-container" class="add-new">
|
||||
<img src="../img/xmark.svg" id="close-form-btn" onclick="closeForm()">
|
||||
|
||||
<form id="new-form" enctype="multipart/form-data" method="post" action="/adddriver">
|
||||
|
||||
<div id="main" class="new-parameters drivers active">
|
||||
|
||||
<h1>Основная информация</h1>
|
||||
<h2>Сперва самое необходимое</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<label for="parameters-plate">Фотография<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<div id="upload-photo" class="upload-input">
|
||||
<img src="../img/upload.svg">
|
||||
<span class="upload-text">Загрузить фотографию водителя</span>
|
||||
<span class="upload-description">PNG, JPG (макс 20 мб)</span>
|
||||
</div>
|
||||
<div class="image-container" id="image-container" style="display: none;">
|
||||
<img id="image-preview" src="#" alt="Uploaded Image">
|
||||
<div class="upload-result">
|
||||
<img id="file-icon" src="../img/file.svg" />
|
||||
<span id="file-name"></span>
|
||||
<span id="file-size"></span>
|
||||
<img id="clear-button" src="../img/xmark.svg" />
|
||||
</div>
|
||||
</div>
|
||||
<input id="input-upload-photo" type="file" accept=".png, .jpg, .jpeg" name="upload-file" style="display: none;">
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<label for="driver-name">Имя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverName" type="text" id="driver-name" placeholder="Имя водителя" required>
|
||||
|
||||
<label for="driver-surname">Фамилия<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverSurname" type="text" id="driver-surname" placeholder="Фамилия водителя" required>
|
||||
|
||||
<label for="driver-card">Карта водителя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverCard" type="text" id="driver-card" placeholder="Номер карты водителя" required>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button id="continue-main" type="button">Продолжить</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="details" class="new-parameters">
|
||||
|
||||
<h1>Детальная информация</h1>
|
||||
<h2>Для удобства в идентификации</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-gender">Пол</label>
|
||||
<select name="driverGender" id="driver-gender">
|
||||
<option value="NS">Не указывать</option>
|
||||
<option value="male">Мужской</option>
|
||||
<option value="female">Женский</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-license">Водительское удостоверение<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverLicense" type="text" id="driver-license" placeholder="Номер водительского удостоверения" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-passport">Удостоверение личности<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverPassport" type="text" id="driver-passport" placeholder="Номер удостоверения личности" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-phone">Мобильный телефон<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverPhone" type="text" id="driver-phone" placeholder="Номер мобильного телефона" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-email">Электронная почта<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverEmail" type="text" id="driver-email" placeholder="Электронная почта" required>
|
||||
</div>
|
||||
|
||||
<div class="parameters-input">
|
||||
<label for="driver-transport">Транспортное средство</label>
|
||||
<select name="driverTransport" id="driver-transport">
|
||||
<option value="NS">Не указывать</option>
|
||||
{{#each Registrars}}
|
||||
<option value="{{this}}">{{this}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label for="driver-description">Примечание</label>
|
||||
<input name="driverDescription" type="text" id="driver-description" placeholder="Примечание">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button type="submit" id="send-form">Сохранить</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
</section>
|
||||
<section style="display: none;" class="dberror" id="deleteConfirmation">
|
||||
<div class="erorr-container">
|
||||
<img src="../img/warning.svg"> <br>
|
||||
<h1>Удаление водителя </h1> <br>
|
||||
<span>Вы уверены что хотите удалить <span id="driverDeleteInfo"></span>?</span>
|
||||
<div class="buttons">
|
||||
<button id="deleteCancel" onclick="closeDeletion();" style="display: inline-block; background-color: white; color: rgba(0, 0, 0, 0.7); margin-right: 5px;" type="button" onclick="deleteDriver()">Отменить</button>
|
||||
<button id="deleteDriver" style="display: inline-block;" type="button">Подтвердить</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
const devices = [
|
||||
{{#each Drivers}}
|
||||
{
|
||||
id: "{{this.id}}",
|
||||
name: "{{this.name}}",
|
||||
surname: "{{this.surname}}",
|
||||
numberTS: "{{this.transport}}",
|
||||
phone: "{{this.phone}}",
|
||||
mail: "{{this.email}}",
|
||||
sim: "{{this.sim}}",
|
||||
driverCard: "{{this.card}}",
|
||||
},
|
||||
{{/each}}
|
||||
];
|
||||
</script>
|
||||
|
||||
<script src="../scripts/table-drivers.js"></script>
|
||||
<script src="../scripts/jquery.min.js"></script>
|
||||
<script src="https://rawgit.com/RobinHerbots/Inputmask/5.x/dist/jquery.inputmask.js"></script>
|
||||
<script src="../scripts/drivers-form.js"></script>
|
||||
|
||||
<script>
|
||||
const uploadPhotoInput = document.getElementById('input-upload-photo');
|
||||
const uploadContainer = document.getElementById('upload-photo');
|
||||
const imageContainer = document.getElementById('image-container');
|
||||
const imagePreview = document.getElementById('image-preview');
|
||||
const fileNameElement = document.getElementById('file-name');
|
||||
const fileSizeElement = document.getElementById('file-size');
|
||||
const clearButton = document.getElementById('clear-button');
|
||||
|
||||
uploadPhotoInput.addEventListener('change', function(event) {
|
||||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function() {
|
||||
uploadContainer.style.display = 'none';
|
||||
imagePreview.src = reader.result;
|
||||
imageContainer.style.display = 'block';
|
||||
fileNameElement.textContent = file.name ;
|
||||
fileSizeElement.textContent = formatFileSize(file.size);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
});
|
||||
|
||||
function formatFileSize(bytes) {
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
||||
if (bytes === 0) return '0 Byte';
|
||||
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
clearButton.addEventListener('click', function() {
|
||||
uploadContainer.style.display = 'block';
|
||||
uploadPhotoInput.value = null;
|
||||
imageContainer.style.display = 'none';
|
||||
imagePreview.src = '#';
|
||||
fileNameElement.textContent = '';
|
||||
fileSizeElement.textContent = '';
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var form = document.getElementById('new-form');
|
||||
const sendButton = document.getElementById('send-form');
|
||||
|
||||
form.addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const formData = new FormData(form);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/adddriver', true);
|
||||
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
console.log('Водитель успешно добавлен!');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Ошибка отправки формы:', xhr.status);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(formData);
|
||||
});
|
||||
|
||||
var form2 = document.getElementById('edit-form');
|
||||
const editSendButton = document.getElementById('send-edit');
|
||||
|
||||
form2.addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const formData = new FormData(form2);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/updatedriver', true);
|
||||
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
console.log('Информация о водителе успешно обновлена!');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Ошибка отправки формы:', xhr.status);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send(formData);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
const fileSelect = document.getElementById("upload-photo");
|
||||
const fileElem = document.getElementById("input-upload-photo");
|
||||
|
||||
fileSelect.addEventListener(
|
||||
"click",
|
||||
(e) => {
|
||||
if (fileElem) {
|
||||
fileElem.click();
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
$(document).ready(function(){
|
||||
|
||||
$('#driver-phone').inputmask({"mask": "+7 (999) 999-9999"});
|
||||
$('#driver-phone-edit').inputmask({"mask": "+7 (999) 999-9999"});
|
||||
|
||||
});
|
||||
|
||||
// Открывает popup форму
|
||||
function openNew() {
|
||||
|
||||
var formContainer = $("#form-bg");
|
||||
var newForm = $("#newForm");
|
||||
var editForm = $("#editForm");
|
||||
|
||||
|
||||
|
||||
activeContent = content1
|
||||
switchContent(content1);
|
||||
|
||||
content2.style.opacity = 0;
|
||||
content2.style.display = "none";
|
||||
content3.style.opacity = 0;
|
||||
content3.style.display = "none";
|
||||
content4.style.opacity = 0;
|
||||
content4.style.display = "none";
|
||||
|
||||
document.getElementById("stage-main").checked = true;
|
||||
|
||||
|
||||
newForm.css("display", "flex");
|
||||
editForm.css("display", "none");
|
||||
// Открытие формы
|
||||
formContainer.addClass("active");
|
||||
newForm.addClass("form-animation");
|
||||
$("body").css("overflow", "hidden");
|
||||
}
|
||||
|
||||
function openEdit(id) {
|
||||
|
||||
var formContainer = $("#form-bg");
|
||||
var newForm = $("#newForm");
|
||||
var editForm = $("#editForm");
|
||||
|
||||
$.ajax({
|
||||
url: "/driverdata",
|
||||
method: "POST",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({ id: id }),
|
||||
success: function(response) {
|
||||
// Установка значений полей формы
|
||||
$("#driver-name-edit").val(response.name);
|
||||
$("#driver-surname-edit").val(response.surname);
|
||||
$("#driver-card-edit").val(response.card);
|
||||
$("#driver-gender-edit").val(response.gender);
|
||||
$("#driver-license-edit").val(response.license);
|
||||
$("#driver-passport-edit").val(response.passport);
|
||||
$("#driver-phone-edit").val(response.phone);
|
||||
$("#driver-email-edit").val(response.email);
|
||||
$("#driver-transport-edit").val(response.transport);
|
||||
$("#driver-description-edit").val(response.description);
|
||||
$("#driver-id-edit").val(response.id);
|
||||
|
||||
activeContent = content3
|
||||
switchContent(content3);
|
||||
|
||||
content1.style.opacity = 0;
|
||||
content1.style.display = "none";
|
||||
content2.style.opacity = 0;
|
||||
content2.style.display = "none";
|
||||
content4.style.opacity = 0;
|
||||
content4.style.display = "none";
|
||||
|
||||
document.getElementById("stage-main").checked = true;
|
||||
|
||||
newForm.css("display", "none");
|
||||
editForm.css("display", "flex");
|
||||
// Открытие формы
|
||||
formContainer.addClass("active");
|
||||
editForm.addClass("form-animation");
|
||||
$("body").css("overflow", "hidden");
|
||||
},
|
||||
error: function() {
|
||||
// Обработка ошибки при запросе к серверу
|
||||
alert("Произошла ошибка при запросе к серверу.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var formContainer = $("#form-bg");
|
||||
var newForm = $("#newForm");
|
||||
var editForm = $("#editForm");
|
||||
|
||||
// Функция для закрытия формы
|
||||
function closeForm() {
|
||||
formContainer.removeClass("active");
|
||||
newForm.removeClass("form-animation");
|
||||
editForm.removeClass("form-animation");
|
||||
newForm.css("display", "none");
|
||||
editForm.css("display", "none");
|
||||
$("body").css("overflow", "auto");
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function deleteDriver(id) {
|
||||
|
||||
var deleteConfirmation = $("#deleteConfirmation");
|
||||
|
||||
$.ajax({
|
||||
url: "/driverdata",
|
||||
method: "POST",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({ id: id }),
|
||||
success: function(response) {
|
||||
// Установка значений полей формы
|
||||
$("#driverDeleteInfo").html(response.name + " " + response.surname);
|
||||
document.getElementById('deleteDriver').setAttribute("onclick", `confirmDelete(${response.id})`);
|
||||
|
||||
|
||||
document.getElementById('deleteConfirmation').style.display = "flex";
|
||||
|
||||
$("body").css("overflow", "hidden");
|
||||
},
|
||||
error: function() {
|
||||
// Обработка ошибки при запросе к серверу
|
||||
alert("Произошла ошибка при запросе к серверу.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function closeDeletion() {
|
||||
document.getElementById('deleteConfirmation').style.display = "none";
|
||||
}
|
||||
|
||||
function confirmDelete(id) {
|
||||
$.ajax({
|
||||
url: "/deletedriver",
|
||||
method: "POST",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify({ id: id }),
|
||||
success: function(response) {
|
||||
location.reload();
|
||||
},
|
||||
error: function() {
|
||||
// Обработка ошибки при запросе к серверу
|
||||
alert("Произошла ошибка при запросе к серверу.");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
// Скрытие/Показ дополнительных меню аккаунта
|
||||
const accountMain = document.getElementById('account-main');
|
||||
|
@ -65,8 +65,8 @@
|
||||
<nav>
|
||||
<a class="selected" href="/devices">Список устройств</a>
|
||||
<a href="/devices/drivers">Водители</a>
|
||||
<a href="/devices/newdevice">Добавить устройство</a>
|
||||
<a href="/devices/newdriver">Добавить водителя</a>
|
||||
<!-- <a href="/devices/newdevice">Добавить устройство</a> -->
|
||||
<!-- <a href="/devices/newdriver">Добавить водителя</a> -->
|
||||
|
||||
<a class="update" href="/devices/update">Обновление ПО</a>
|
||||
</nav>
|
||||
@ -404,8 +404,8 @@
|
||||
<input name="equipmentInstalled" type="date" id="parameters-equipment-installed" required>
|
||||
</div>
|
||||
|
||||
<label for="parameters-device-description">Внешнее описание<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentDescription" type="text" id="parameters-device-description" placeholder="Внешнее описание " required>
|
||||
<label for="parameters-device-description">Внешнее описание</label>
|
||||
<input name="equipmentDescription" type="text" id="parameters-device-description" placeholder="Внешнее описание ">
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1,367 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Устройства</title>
|
||||
<link rel="stylesheet" href="../styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<h1>Аргус</h1>
|
||||
<h2><span>/</span> Название организации</h2>
|
||||
</header>
|
||||
|
||||
<section class="account-info">
|
||||
<div id="account-main">
|
||||
<img id="person" src="../img/person.svg">
|
||||
<span>Тестовое Имя</span>
|
||||
<img id="down" src="../img/down.svg">
|
||||
<img id="up" src="../img/up.svg">
|
||||
</div>
|
||||
<a href="/login"><div id="account-additional" class="additional">Выйти</div></a>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section class="navigation">
|
||||
<a href="/">
|
||||
<div><img src="../img/chart.svg">Главная</div>
|
||||
</a>
|
||||
<a href="/devices">
|
||||
<div class="selected"><img src="../img/cloud.svg">Устройства</div>
|
||||
</a>
|
||||
<a href="/reports">
|
||||
<div><img src="../img/bubble.svg">Отчёты</div>
|
||||
</a>
|
||||
<a href="/live">
|
||||
<div><img src="../img/waves.svg">Трансляция</div>
|
||||
</a>
|
||||
<a href="/">
|
||||
<div><img src="../img/play.svg">Записи</div>
|
||||
</a>
|
||||
<a class="settings" href="/">
|
||||
<div><img src="../img/gear.svg">Настройки</div>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<section class="main">
|
||||
<div class="name">
|
||||
<span>Устройства</span>
|
||||
</div>
|
||||
<nav>
|
||||
<a href="/devices">Список устройств</a>
|
||||
<a href="/devices/drivers">Водители</a>
|
||||
<a class="selected" href="/devices/newdevice">Добавить устройство</a>
|
||||
<a href="/devices/newdriver">Добавить водителя</a>
|
||||
|
||||
<a class="update" href="/devices/update">Обновление ПО</a>
|
||||
</nav>
|
||||
<section class="bg">
|
||||
<section class="content">
|
||||
|
||||
<section class="for-new">
|
||||
|
||||
<section class="stages">
|
||||
<input name="newStage" type="radio" value="details" id="stage-details" checked><label for="stage-details">Детали</label>
|
||||
<div class="vertical-line"></div>
|
||||
<input name="newStage" type="radio" value="sim" id="stage-sim"><label for="stage-sim">SIM - Карта</label>
|
||||
<div class="vertical-line"></div>
|
||||
<input name="newStage" type="radio" value="ts" id="stage-ts"><label for="stage-ts">Транспортное средство</label>
|
||||
<div class="vertical-line"></div>
|
||||
<input name="newStage" type="radio" value="equipment" id="stage-equipment"><label for="stage-equipment">Оборудование</label>
|
||||
</section>
|
||||
</section>
|
||||
<section id="add-new-container" class="add-new">
|
||||
|
||||
<form>
|
||||
|
||||
<div id="details" class="new-parameters active">
|
||||
|
||||
<h1>Детали устройства</h1>
|
||||
<h2>Сперва самое необходимое</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-plate">Номерной знак<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="plateNumber" type="text" id="parameters-plate" placeholder="Номер номерного знака" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-plateColor">Цвет номерного знака<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="plateColor" id="parameters-plateColor">
|
||||
<option value="white">Белый</option>
|
||||
<option value="blue">Синий</option>
|
||||
<option value="yellow">Жёлтый</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-serial">Серийный номер<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="serialNumber" type="text" id="parameters-serial" placeholder="Серийный номер устройства" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-channels">Количество каналов<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="channelsAmount" type="text" id="parameters-channels" placeholder="Кол-во каналов устройства" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-protocol">Протокол<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="connectionProtocol" id="parameters-protocol">
|
||||
<option value="N9M">N9M</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-ip">IP-адрес<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="IPAddress" type="text" id="parameters-ip" placeholder="IP-адрес сервера" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-group">Группа<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="deviceGroup" type="text" id="parameters-group" placeholder="Название группы" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-port">Порт<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="serverPort" type="text" id="parameters-port" placeholder="Порт сервера" required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button id="continue-details" type="button">Продолжить</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="sim" class="new-parameters">
|
||||
|
||||
<h1>Настройки SIM-карты</h1>
|
||||
<h2>Для связи с устройством</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-sim">Номер SIM-карты<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="sumNumber" type="text" id="parameters-sim" placeholder="Номер SIM-карты" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-sim-imei">IMEI<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="simIMEI" type="text" id="parameters-sim-imei" placeholder="IMEI SIM-карты" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-sim-imsi">IMSI<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="simIMSI" type="text" id="parameters-sim-imsi" placeholder="IMSI SIM-карты" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-sim-module">Тип сетевого модуля<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="simModule" id="parameters-sim-module">
|
||||
<option value="GPRS">GPRS</option>
|
||||
<option value="CDMA">CDMA</option>
|
||||
<option value="EVDO">EVDO</option>
|
||||
<option value="WCDMA">WCDMA</option>
|
||||
<option value="EDGE">EDGE</option>
|
||||
<option value="TDSCDMA">TDSCDMA</option>
|
||||
<option value="LTE-TDD">LTE-TDD</option>
|
||||
<option value="LTE-FDD">LTE-FDD</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button id="continue-sim" type="button">Продолжить</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="ts" class="new-parameters">
|
||||
|
||||
<h1>Детали транспортного средства</h1>
|
||||
<h2>Технические характеристики и не только</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-trasnsport-type">Тип автомобиля<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="transportType" id="parameters-trasnsport-type" onchange="truncateText(this)">
|
||||
<option value="1">Пассажирский подвижной состав</option>
|
||||
<option value="2">Большой автобус</option>
|
||||
<option value="3">Средний автобус</option>
|
||||
<option value="4">Микроавтобус</option>
|
||||
<option value="5">Лимузин</option>
|
||||
<option value="6">Большой спальный автобус</option>
|
||||
<option value="7">Спальный автобус среднего размера</option>
|
||||
<option value="8">Обычный грузовик</option>
|
||||
<option value="9">Большой обычный грузовик</option>
|
||||
<option value="10">Среднегабаритный обычный грузовик</option>
|
||||
<option value="11">Маленький обычный грузовик</option>
|
||||
<option value="12">Специальная транспортировочная машина</option>
|
||||
<option value="13">Контейнерная тележка</option>
|
||||
<option value="14">Большой транспортировочный автомобиль</option>
|
||||
<option value="15">Изометрический вагон</option>
|
||||
<option value="16">Спецтехника для перевозки грузовых автомобилей</option>
|
||||
<option value="17">Танкер</option>
|
||||
<option value="18">Тягач</option>
|
||||
<option value="19">Прицеп</option>
|
||||
<option value="20">Транспортер</option>
|
||||
<option value="21">Другая спецтехника</option>
|
||||
<option value="22">Автомобиль для перевозки опасных грузов</option>
|
||||
<option value="23">Сельскохозяйственная машина</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-trasnsport-factory">Номер завода<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportFactory" type="text" id="parameters-trasnsport-factory" placeholder="Номер завода ТС" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-strength">Несущая способность<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportStrength" type="text" id="parameters-transport-strength" placeholder="Несущая способность (тонны)" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-engine">Номер двигателя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportEngine" type="text" id="parameters-transport-engine" placeholder="Номер двигателя ТС" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-stanina">Номер станины<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportStanina" type="text" id="parameters-transport-stanina" placeholder="Номер станины ТС" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-trasnsport-fuel">Тип топливного масла<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="transportFuel" id="parameters-trasnsport-fuel">
|
||||
<option value="gasoline">Бензин</option>
|
||||
<option value="diesel">Дизельное топливо</option>
|
||||
<option value="naturalGas">Природный газ</option>
|
||||
<option value="liquefiedGas">Сжиженный газ</option>
|
||||
<option value="electric">Электрическое</option>
|
||||
<option value="other">Прочие</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<div class="parameters-transport-certificate">
|
||||
<label for="parameters-transport-certificate">Свид-ство о дорожной перевозке<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportCertificate" type="text" id="parameters-transport-certificate" placeholder="Номер свидетельства" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<div class="pparameters-trasnsport-category">
|
||||
<label for="parameters-trasnsport-category">Техническая категория<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="transportCategory" id="parameters-trasnsport-category">
|
||||
<option value="1">Категория 1</option>
|
||||
<option value="2">Категория 2</option>
|
||||
<option value="3">Категория 3</option>
|
||||
<option value="other">Не достает стандарта</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-expire">Срок действия<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportExpire" type="date" id="parameters-transport-expire" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-consumption">Расход топлива на 100 км<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportConsumption" type="text" id="parameters-transport-consumption" placeholder="Расход топлива в литрах" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-province">Провинция<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportProvince" type="text" id="parameters-transport-province" placeholder="Провинция" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-transport-city">Город<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="transportCity" type="text" id="parameters-transport-city" placeholder="Город" required>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button id="continue-ts" type="button">Продолжить</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="equipment" class="new-parameters">
|
||||
|
||||
<h1>Информация о оборудовании</h1>
|
||||
<h2>Технические моменты</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-equipment-name">Имя устройства<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentName" type="text" id="parameters-equipment-name" placeholder="Имя пользовательского устройства" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-equipment-password">Пароль устройства<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentPassword" type="text" id="parameters-equipment-password" placeholder="Пароль устройства" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-equipment-number">Номер партии<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentNumber" type="text" id="parameters-equipment-number" placeholder="Заводской номер партии" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-equipment-released">Дата выпуска<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentReleased" type="date" id="parameters-equipment-released" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-device-installer">Установщик<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentInstaller" type="text" id="parameters-device-installer" placeholder="ФИО установщика" required>
|
||||
</div>
|
||||
<div class="parameters-input">
|
||||
<label for="parameters-equipment-installed">Дата монтажа<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentInstalled" type="date" id="parameters-equipment-installed" required>
|
||||
</div>
|
||||
|
||||
<label for="parameters-device-description">Внешнее описание<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="equipmentDescription" type="text" id="parameters-device-description" placeholder="Внешнее описание " required>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button>Сохранить</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<script src="../scripts/jquery.min.js"></script>
|
||||
<script>
|
||||
// Скрытие/Показ дополнительных меню аккаунта
|
||||
const accountMain = document.getElementById('account-main');
|
||||
const accountAdditional = document.getElementById('account-additional');
|
||||
const accountUp = document.getElementById('up');
|
||||
const accountDown = document.getElementById('down');
|
||||
accountAdditional.style.display = 'none';
|
||||
accountUp.style.display = 'none';
|
||||
|
||||
accountMain.addEventListener('click', () => {
|
||||
if (accountAdditional.style.display === 'none') {
|
||||
accountAdditional.style.display = 'flex';
|
||||
accountUp.style.display = 'unset';
|
||||
accountDown.style.display = 'none';
|
||||
} else {
|
||||
accountAdditional.style.display = 'none';
|
||||
accountUp.style.display = 'none';
|
||||
accountDown.style.display = 'unset';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="../scripts/device-form.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,295 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Устройства</title>
|
||||
<link rel="stylesheet" href="../styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<h1>Аргус</h1>
|
||||
<h2><span>/</span> Название организации</h2>
|
||||
</header>
|
||||
|
||||
<section class="account-info">
|
||||
<div id="account-main">
|
||||
<img id="person" src="../img/person.svg">
|
||||
<span>Тестовое Имя</span>
|
||||
<img id="down" src="../img/down.svg">
|
||||
<img id="up" src="../img/up.svg">
|
||||
</div>
|
||||
<a href="/login"><div id="account-additional" class="additional">Выйти</div></a>
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
|
||||
<section class="navigation">
|
||||
<a href="/">
|
||||
<div><img src="../img/chart.svg">Главная</div>
|
||||
</a>
|
||||
<a href="/devices">
|
||||
<div class="selected"><img src="../img/cloud.svg">Устройства</div>
|
||||
</a>
|
||||
<a href="/reports">
|
||||
<div><img src="../img/bubble.svg">Отчёты</div>
|
||||
</a>
|
||||
<a href="/live">
|
||||
<div><img src="../img/waves.svg">Трансляция</div>
|
||||
</a>
|
||||
<a href="/">
|
||||
<div><img src="../img/play.svg">Записи</div>
|
||||
</a>
|
||||
<a class="settings" href="/">
|
||||
<div><img src="../img/gear.svg">Настройки</div>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<section class="main">
|
||||
<div class="name">
|
||||
<span>Устройства</span>
|
||||
</div>
|
||||
<nav>
|
||||
<a href="/devices">Список устройств</a>
|
||||
<a href="/devices/drivers">Водители</a>
|
||||
<a href="/devices/newdevice">Добавить устройство</a>
|
||||
<a class="selected" href="/devices/newdriver">Добавить водителя</a>
|
||||
|
||||
<a class="update" href="/devices/update">Обновление ПО</a>
|
||||
</nav>
|
||||
<section class="bg">
|
||||
<section class="content">
|
||||
|
||||
<section class="for-new">
|
||||
|
||||
<section class="stages">
|
||||
<input name="newStage" type="radio" value="main" id="stage-main" checked><label for="stage-main">Основная информация</label>
|
||||
<div class="vertical-line"></div>
|
||||
<input name="newStage" type="radio" value="details" id="stage-details"><label for="stage-details">Детали</label>
|
||||
</section>
|
||||
</section>
|
||||
<section id="add-new-container" class="add-new">
|
||||
|
||||
<form>
|
||||
|
||||
<div id="main" class="new-parameters drivers active">
|
||||
|
||||
<h1>Основная информация</h1>
|
||||
<h2>Сперва самое необходимое</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<label for="parameters-plate">Фотография<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<div id="upload-photo" class="upload-input">
|
||||
<img src="../img/upload.svg">
|
||||
<span class="upload-text">Загрузить фотографию водителя</span>
|
||||
<span class="upload-description">PNG, JPG (макс 20 мб)</span>
|
||||
</div>
|
||||
<input id="input-upload-photo" type="file" name="upload-file" style="display: none;">
|
||||
|
||||
<div class="parameters-inputs">
|
||||
<label for="driver-name">Имя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverName" type="text" id="driver-name" placeholder="Имя водителя" required>
|
||||
|
||||
<label for="driver-surname">Фамилия<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverSurname" type="text" id="driver-surname" placeholder="Фамилия водителя" required>
|
||||
|
||||
<label for="driver-card">Карта водителя<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverCard" type="text" id="driver-card" placeholder="Номер карты водителя" required>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button id="continue-main" type="button">Продолжить</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="details" class="new-parameters drivers">
|
||||
|
||||
<h1>Детальная информация</h1>
|
||||
<h2>Для удобства в идентификации</h2>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<div class="parameters-inputs">
|
||||
|
||||
<label for="driver-gender">Пол<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<select name="driverGender" id="driver-gender">
|
||||
<option value="male">Мужской</option>
|
||||
<option value="female">Женский</option>
|
||||
</select>
|
||||
|
||||
<label for="driver-license">Водительское удостоверение<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverLicense" type="text" id="driver-license" placeholder="Номер водительского удостоверения" required>
|
||||
|
||||
<label for="driver-passport">Удостоверение личности<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverPassport" type="text" id="driverPassport" placeholder="Номер удостоверения личности" required>
|
||||
|
||||
<label for="driver-phone">Мобильный телефон<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverPhone" type="text" id="driver-phone" placeholder="Номер мобильного телефона" required>
|
||||
|
||||
<label for="driver-description">Примечание<span style="color: rgba(255, 69, 58, 1);">*</span></label>
|
||||
<input name="driverDescription" type="text" id="driver-description" placeholder="Примечание" required>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="horizontal-line"></div>
|
||||
|
||||
<button>Сохранить</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<script src="../scripts/jquery.min.js"></script>
|
||||
|
||||
<script>
|
||||
const fileSelect = document.getElementById("upload-photo");
|
||||
const fileElem = document.getElementById("input-upload-photo");
|
||||
|
||||
fileSelect.addEventListener(
|
||||
"click",
|
||||
(e) => {
|
||||
if (fileElem) {
|
||||
fileElem.click();
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Скрытие/Показ дополнительных меню аккаунта
|
||||
const accountMain = document.getElementById('account-main');
|
||||
const accountAdditional = document.getElementById('account-additional');
|
||||
const accountUp = document.getElementById('up');
|
||||
const accountDown = document.getElementById('down');
|
||||
accountAdditional.style.display = 'none';
|
||||
accountUp.style.display = 'none';
|
||||
|
||||
accountMain.addEventListener('click', () => {
|
||||
if (accountAdditional.style.display === 'none') {
|
||||
accountAdditional.style.display = 'flex';
|
||||
accountUp.style.display = 'unset';
|
||||
accountDown.style.display = 'none';
|
||||
} else {
|
||||
accountAdditional.style.display = 'none';
|
||||
accountUp.style.display = 'none';
|
||||
accountDown.style.display = 'unset';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$("#continue-main").click(function () {
|
||||
document.getElementById("stage-details").checked = true;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
const container = document.getElementById('new-parameters');
|
||||
const content1 = document.getElementById('main');
|
||||
const content2 = document.getElementById('details');
|
||||
const btn1 = document.getElementById('continue-main');
|
||||
const radioButtons = document.querySelectorAll('input[type="radio"][name="newStage"]');
|
||||
const duration = 100;
|
||||
|
||||
let activeContent = content1;
|
||||
|
||||
function switchContent(newContent) {
|
||||
fadeOut(activeContent, () => {
|
||||
fadeIn(newContent);
|
||||
activeContent = newContent;
|
||||
});
|
||||
}
|
||||
|
||||
function fadeIn(element) {
|
||||
element.style.opacity = 0;
|
||||
element.style.display = 'block';
|
||||
let start = performance.now();
|
||||
|
||||
function animate(time) {
|
||||
let timeFraction = (time - start) / duration;
|
||||
if (timeFraction > 1) {
|
||||
element.style.opacity = 1;
|
||||
} else {
|
||||
element.style.opacity = timeFraction;
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
}
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
function fadeOut(element, callback) {
|
||||
element.style.opacity = 1;
|
||||
let start = performance.now();
|
||||
|
||||
function animate(time) {
|
||||
let timeFraction = (time - start) / duration;
|
||||
if (timeFraction > 1) {
|
||||
element.style.opacity = 0;
|
||||
element.style.display = 'none';
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
} else {
|
||||
element.style.opacity = 1 - timeFraction;
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
}
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
btn1.addEventListener('click', () => {
|
||||
if (activeContent === content1) {
|
||||
switchContent(content2);
|
||||
} else {
|
||||
switchContent(content1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
for (let radioButton of radioButtons) {
|
||||
radioButton.addEventListener('change', () => {
|
||||
if (radioButton.value === 'main') {
|
||||
switchContent(content1);
|
||||
} else if (radioButton.value === 'details') {
|
||||
switchContent(content2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function truncateText(select) {
|
||||
var maxLength = 30;
|
||||
var option = select.options[select.selectedIndex];
|
||||
if (option.text.length > maxLength) {
|
||||
option.text = option.text.substring(0, maxLength) + '...';
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -55,8 +55,8 @@
|
||||
<nav>
|
||||
<a href="/devices">Список устройств</a>
|
||||
<a href="/devices/drivers">Водители</a>
|
||||
<a href="/devices/newdevice">Добавить устройство</a>
|
||||
<a href="/devices/newdriver">Добавить водителя</a>
|
||||
<!-- <a href="/devices/newdevice">Добавить устройство</a> -->
|
||||
<!-- <a href="/devices/newdriver">Добавить водителя</a> -->
|
||||
|
||||
<a class="update selected" href="/devices/update">Обновление ПО</a>
|
||||
</nav>
|
||||
|
@ -278,6 +278,12 @@
|
||||
var signalsList = document.querySelector('.signals-list');
|
||||
var list = document.getElementById('list');
|
||||
|
||||
list.style.height = (signalsList.clientHeight - 50 - 75) + 'px';
|
||||
});
|
||||
window.addEventListener('resize', function() {
|
||||
var signalsList = document.querySelector('.signals-list');
|
||||
var list = document.getElementById('list');
|
||||
|
||||
list.style.height = (signalsList.clientHeight - 50 - 75) + 'px';
|
||||
});
|
||||
</script>
|
||||
@ -290,6 +296,14 @@
|
||||
mapArea.style.height = (mapContainer.clientHeight) + 'px';
|
||||
mapArea.style.width = (mapContainer.clientWidth) + 'px';
|
||||
});
|
||||
|
||||
window.addEventListener("resize", function (event) {
|
||||
var mapContainer = document.querySelector('.map');
|
||||
var mapArea = document.getElementById('map');
|
||||
|
||||
mapArea.style.height = (mapContainer.clientHeight) + 'px';
|
||||
mapArea.style.width = (mapContainer.clientWidth) + 'px';
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- <script src="../scripts/table-reports.js"></script> -->
|
||||
@ -361,6 +375,8 @@ const selectedDevices = Array.from(checkboxes)
|
||||
console.log(data.devicesData);
|
||||
data.devicesData.forEach(device => {
|
||||
const { longitude, latitude, direction, speed } = device;
|
||||
var newDirection = direction + 90
|
||||
console.log(newDirection);
|
||||
|
||||
// Создание HTML-элемента для маркера
|
||||
const el = document.createElement('div');
|
||||
@ -393,6 +409,8 @@ function updateMapMarkers(devicesData) {
|
||||
// Создание новых маркеров на карте на основе полученных данных
|
||||
devicesData.forEach(device => {
|
||||
const { longitude, latitude, direction, speed } = device;
|
||||
var newDirection = direction + 90
|
||||
console.log(newDirection);
|
||||
|
||||
// Создание HTML-элемента для маркера
|
||||
const el = document.createElement('div');
|
||||
@ -429,73 +447,10 @@ setInterval(() => {
|
||||
.catch(error => {
|
||||
console.error('Ошибка при отправке запроса:', error);
|
||||
});
|
||||
}, 20000);
|
||||
}, 12000);
|
||||
{{/if}}
|
||||
// mapboxgl.accessToken = 'pk.eyJ1IjoicHBlY2hlbmtvbyIsImEiOiJjbGs3Y3dkc3AwNmN1M2dudzRtd3gwNjl4In0.oEFhSBTsaiyBx1uOqHdrZQ';
|
||||
// const map = new mapboxgl.Map({
|
||||
// container: 'map',
|
||||
// // Choose from Mapbox's core styles, or make your own style with Mapbox Studio
|
||||
// style: 'mapbox://styles/mapbox/streets-v12',
|
||||
// center: [12.550343, 55.665957],
|
||||
// zoom: 8
|
||||
// });
|
||||
|
||||
// // Create a default Marker and add it to the map.
|
||||
// const marker1 = new mapboxgl.Marker()
|
||||
// .setLngLat([12.554729, 55.70651])
|
||||
// .addTo(map);
|
||||
|
||||
// // Create a default Marker, colored black, rotated 45 degrees.
|
||||
// const marker2 = new mapboxgl.Marker({ color: 'black', rotation: 45 })
|
||||
// .setLngLat([12.65147, 55.608166])
|
||||
// .addTo(map);
|
||||
</script>
|
||||
|
||||
<!-- <style>
|
||||
#map {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: inline-block;
|
||||
float: right;
|
||||
}
|
||||
</style> -->
|
||||
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/leaflet/dist/leaflet.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/leaflet-routing-machine/dist/leaflet-routing-machine.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet/dist/leaflet.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet-routing-machine/dist/leaflet-routing-machine.css" /> -->
|
||||
|
||||
<!-- <script>
|
||||
function initMap() {
|
||||
// Координаты начальной точки
|
||||
var startPoint = L.latLng(55.769042, 37.647840);
|
||||
// Координаты конечной точки
|
||||
var endPoint = L.latLng(55.769723, 37.659341);
|
||||
|
||||
// Создание объекта карты
|
||||
var map = L.map('map').setView(startPoint, 12);
|
||||
|
||||
// Добавление слоя OpenStreetMap
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
}).addTo(map);
|
||||
|
||||
// Прокладка маршрута
|
||||
var control = L.Routing.control({
|
||||
waypoints: [
|
||||
startPoint,
|
||||
endPoint
|
||||
],
|
||||
routeWhileDragging: true,
|
||||
show: false,
|
||||
}).addTo(map);
|
||||
|
||||
// Удаление кнопки виджета маршрута
|
||||
document.querySelector('.leaflet-routing-container').style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
<script>initMap();</script> -->
|
||||
|
||||
<script>
|
||||
const panel = document.getElementById('signals-list');
|
||||
const slider = document.getElementById('left-slider');
|
||||
@ -612,6 +567,7 @@ for (var i = 0; i < tableCheckboxes.length; i++) {
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
@ -49,6 +49,16 @@
|
||||
</section>
|
||||
|
||||
<section class="main">
|
||||
{{#if ifDBError}}
|
||||
<section class="dberror">
|
||||
<div class="erorr-container">
|
||||
<img src="../img/warning.svg"> <br>
|
||||
<h1>Ошибка </h1> <br>
|
||||
<span>Не удалось получить данные из БД</span>
|
||||
<button type="button" onclick="location.reload();">Повторить попытку</button>
|
||||
</div>
|
||||
</section>
|
||||
{{/if}}
|
||||
<div class="name">
|
||||
<span>Отчёты</span>
|
||||
</div>
|
||||
@ -64,7 +74,7 @@
|
||||
<h1>Организация</h1>
|
||||
|
||||
<ul class="area">
|
||||
<li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="name-1" class="checkbox-input" hidden checked><label for="name-1" class="checkbox-label">Группа 1</label>
|
||||
<!-- <li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="name-1" class="checkbox-input" hidden checked><label for="name-1" class="checkbox-label">Группа 1</label>
|
||||
<ul class="area-devices" id="devices-1">
|
||||
<li class="device"><img><input type="checkbox" id="0001" class="checkbox-input device-filter" value="0001" hidden checked><label for="0001" class="checkbox-label"><div class="checkmark"></div>0001</label></li>
|
||||
<li class="device"><img><input type="checkbox" id="0002" class="checkbox-input device-filter" value="0002" hidden checked><label for="0002" class="checkbox-label"><div class="checkmark"></div>0002</label></li>
|
||||
@ -82,7 +92,7 @@
|
||||
<ul class="area-devices" id="devices-3">
|
||||
<li class="device"><img><input type="checkbox" id="0007" class="checkbox-input device-filter" value="0007" hidden checked><label for="0007" class="checkbox-label"><div class="checkmark"></div>0007</label></li>
|
||||
</ul>
|
||||
</li>
|
||||
</li> -->
|
||||
</ul>
|
||||
|
||||
<div class="area-time-range">
|
||||
@ -126,6 +136,9 @@
|
||||
<div id="pagination">
|
||||
<!-- Сюда будут добавляться ссылки для переключения между страницами -->
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<span style="opacity:50%">Временное ограничение: 100 последних предупреждений</span>
|
||||
|
||||
|
||||
|
||||
@ -135,7 +148,7 @@
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<!-- <script>
|
||||
<script>
|
||||
const devices = [
|
||||
{{#each Alarms}}
|
||||
{
|
||||
@ -144,10 +157,12 @@
|
||||
time: "{{this.time}}",
|
||||
serial: "{{this.serial}}",
|
||||
type: "{{this.type}}",
|
||||
geo: "{{this.geo}}",
|
||||
plate: "{{this.plate}}",
|
||||
},
|
||||
{{/each}}
|
||||
];
|
||||
</script> -->
|
||||
</script>
|
||||
|
||||
<script src="../scripts/table-reports.js"></script>
|
||||
<script src="../scripts/jquery.min.js"></script>
|
||||
|
Reference in New Issue
Block a user