documentation update

This commit is contained in:
Ivan 2023-11-08 01:25:16 +03:00
parent a5f203da92
commit 2163477255
Signed by untrusted user who does not match committer: ppechenkoo
GPG Key ID: 0C191B86D9582583
12 changed files with 231 additions and 324 deletions

View File

@ -4319,7 +4319,18 @@ async function settings(req, res) {
async function documentation(req, res) {
if (req.session.userId === undefined) {
return res.redirect("/signin?page=documentation");
let templateData = {
VIRTUAL_HOST: process.env.VIRTUAL_HOST,
};
const source = fs.readFileSync(
"static/templates/documentation-NA.html",
"utf8"
);
const template = handlebars.compile(source);
const resultT = template(templateData);
res.send(resultT);
return;
}
const userInfo = await getUserInfo(req.session.userId);
let templateData = {

BIN
static/docs/argus-app.zip Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1107,6 +1107,12 @@ tr:nth-child(even) {
transition: 0.1s;
}
.form a {
display: block;
margin: 15px auto;
width: fit-content;
}
.erorr-container button {
font-weight: 500;
font-size: 16px;

View File

@ -1,323 +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>
<img src="../img/argus.png">
<h1>Аргус</h1>
<h2><span>/</span> {{Organisation}}</h2>
</header>
<section class="account-info">
<div id="account-main">
<img id="person" src="../img/person.svg">
<span>{{User}}</span>
<img id="down" src="../img/down.svg">
<img id="up" src="../img/up.svg">
</div>
<a href="/logout"><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="/videos">
<div><img src="../img/play.svg">Записи</div>
</a>
<a href="https://forms.yandex.ru/cloud/6515ecda3e9d08f17262c332/" target="_blank">
<div><img src="../img/bug.svg">Собщить об ошибке</div>
</a>
{{#if isAdmin}}
<a class="admin-panel" href="/admin">
<div><img src="../img/keyboard.svg">Админка</div>
</a>
{{/if}}
<a class="settings" href="/settings">
<div><img src="../img/gear.svg">Настройки</div>
</a>
</section>
<section class="main">
<div class="name">
<span style="color: rgb(255, 69, 58);">В разработке</span>
</div>
<nav>
<a href="/devices">Список устройств</a>
{{#if EditTransport}}
<a href="/devices/groups">Группы</a>
{{/if}}
<!-- <a href="/devices/drivers">Водители</a> -->
<!-- <a href="/devices/newdevice">Добавить устройство</a> -->
<!-- <a href="/devices/newdriver">Добавить водителя</a> -->
<a class="update selected" href="/devices/update">Обновление ПО</a>
</nav>
<section class="bg">
<section class="content">
<section class="for-table">
<section class="organisation update">
<div class="update-org">
<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>
<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>
</ul>
</li>
<li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="name-2" class="checkbox-input" hidden checked><label for="name-2" class="checkbox-label">Группа 2</label>
<ul class="area-devices" id="devices-2">
<li class="device"><img><input type="checkbox" id="0003" class="checkbox-input device-filter" value="0003" hidden checked><label for="0003" class="checkbox-label"><div class="checkmark"></div>0003</label></li>
<li class="device"><img><input type="checkbox" id="0004" class="checkbox-input device-filter" value="0004" hidden checked><label for="0004" class="checkbox-label"><div class="checkmark"></div>0004</label></li>
<li class="device"><img><input type="checkbox" id="0005" class="checkbox-input device-filter" value="0005" hidden checked><label for="0005" class="checkbox-label"><div class="checkmark"></div>0005</label></li>
<li class="device"><img><input type="checkbox" id="0006" class="checkbox-input device-filter" value="0006" hidden checked><label for="0006" class="checkbox-label"><div class="checkmark"></div>0006</label></li>
</ul>
</li>
<li class="area-name"><img src="../img/ul.svg"><input type="checkbox" id="name-3" class="checkbox-input" hidden checked><label for="name-3" class="checkbox-label">Другое</label>
<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>
</ul>
</div>
<section class="update-info">
<h1>Новое обновление</h1>
<div class="update-info-area">
<div id="upload-file" class="upload-input">
<img src="../img/upload.svg">
<span class="upload-text">Загрузить файл обновления</span>
<span class="upload-description">ZIP, RAR, TAR (макс 100 мб)</span>
</div>
<input id="input-upload-file" type="file" name="updateFile" style="display: none;">
<label for="update-name">Название<span style="color: rgba(255, 69, 58, 1);">*</span></label>
<input name="updateName" type="text" id="update-name" placeholder="Название обновления" required>
<span class="input-name">Время обновления</span>
<ul id="time-picker">
<li><input type="radio" name="updateTimeRadio" id="update-time-now" value="now" checked><label class="input-radio" for="update-time-now">Сейчас</label></li>
<li><input type="radio" name="updateTimeRadio" id="update-time-later" value="later"><label class="input-radio" for="update-time-later">Ко времени</label></li>
</ul>
<input name="updateTime" type="datetime-local" id="update-time">
<button>Отправить</button>
</div>
</section>
</section>
<section id="table-area" class="table update">
<h1>Список водителей</h1>
<input id="table-search" class="search" type="text" placeholder="Поиск">
<table id="deviceTable">
<thead>
<tr>
<th><input id="device-all" type="checkbox"><label for="device-all"><div class="checkmark"></div></label></th>
<th>Группа</th>
<th>Номер ТС</th>
<th>Статус</th>
<th>Время</th>
<th>Файл</th>
<th></th>
</tr>
</thead>
<tbody>
<!-- Сюда будут добавляться строки таблицы -->
</tbody>
</table>
</section>
<div id="count">
<!-- Сюда добавится итоговое количество результатов -->
</div>
<div id="pagination">
<!-- Сюда будут добавляться ссылки для переключения между страницами -->
</div>
</section>
</section>
</section>
</section>
<script src="../scripts/table-updates.js"></script>
<script src="../scripts/jquery.min.js"></script>
<script>
const fileSelect = document.getElementById("upload-file");
const fileElem = document.getElementById("input-upload-file");
fileSelect.addEventListener(
"click",
(e) => {
if (fileElem) {
fileElem.click();
}
},
false
);
</script>
<script>
$("#update-time").hide();
$("#time-picker").click(function () {
if ($("#update-time-later").is(":checked")) {
$("#update-time").show(50);
} else {
$("#update-time").hide(50);
}
});
</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>
const checkboxes = document.querySelectorAll('.organisation .checkbox-input');
checkboxes.forEach((checkbox) => {
applyFilterAndSearch();
checkbox.addEventListener('change', function() {
applyFilterAndSearch();
const devices = this.parentNode.querySelector('.area-devices');
if (this.checked) {
devices.style.display = 'block';
// Активируем дочерние чекбоксы
const childCheckboxes = devices.querySelectorAll('.device-filter');
childCheckboxes.forEach((childCheckbox) => {
childCheckbox.checked = true;
applyFilterAndSearch();
});
} else {
devices.style.display = 'none';
applyFilterAndSearch();
// Деактивируем дочерние чекбоксы
const childCheckboxes = devices.querySelectorAll('.device-filter');
childCheckboxes.forEach((childCheckbox) => {
childCheckbox.checked = false;
applyFilterAndSearch();
});
}
// Деактивируем дочерние чекбоксы, если родительский чекбокс не выбран
if (!this.checked) {
const childCheckboxes = devices.querySelectorAll('.device-filter');
childCheckboxes.forEach((childCheckbox) => {
childCheckbox.checked = false;
applyFilterAndSearch();
});
devices.style.display = 'none';
}
});
});
</script>
<script>
var table = document.querySelector('#deviceTable');
var tableCheckboxAll = table.querySelector('#device-all');
var tableCheckboxes = table.querySelectorAll('tbody input[type="checkbox"]');
tableCheckboxAll.addEventListener('click', function(event) {
table = document.querySelector('#deviceTable');
tableCheckboxes = table.querySelectorAll('tbody input[type="checkbox"]');
if (tableCheckboxAll.checked) {
tableCheckboxes.forEach((tableCheckbox) => {
tableCheckbox.checked = true;
});
} else {
tableCheckboxes.forEach((tableCheckbox) => {
tableCheckbox.checked = false;
});
}
});
$('#deviceTable').click( function(event) {
table = document.querySelector('#deviceTable');
tableCheckboxes = table.querySelectorAll('tbody input[type="checkbox"]');
for (var i = 0; i < tableCheckboxes.length; i++) {
tableCheckboxes[i].addEventListener('click', function(event) {
for (var j = 0; j < tableCheckboxes.length; j++) {
if (!tableCheckboxes[j].checked || tableCheckboxes[j].disabled) {
tableCheckboxAll.checked = false;
return;
}
}
tableCheckboxAll.checked = true;
});
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,190 @@
<!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" />
<style>
.main,
.main .bg {
margin: 0;
border: 0;
min-height: 100vh;
}
</style>
</head>
<body>
<section class="main">
<section class="bg">
<section class="content">
<section class="for-table">
<section class="whole-width" style="padding-bottom: 33px;">
<nav style="margin-top: 35px;">
<a href="/">Вернуться</a>
</nav>
<h1 style="padding-bottom: 10px;">Скачать документацию</h1>
<div class="download-file" onclick="window.open(`https://transportsoft.ru/docs/argus/user_manual.pdf`, '_blank');">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_49_1939)">
<path d="M12 23.9883C18.5647 23.9883 24 18.5439 24 11.9941C24 5.43264 18.5529 0 11.9882 0C5.43529 0 0 5.43264 0 11.9941C0 18.5439 5.44705 23.9883 12 23.9883ZM12 21.9892C6.44705 21.9892 2.01176 17.5444 2.01176 11.9941C2.01176 6.44391 6.43529 1.99903 11.9882 1.99903C17.5411 1.99903 22 6.44391 22 11.9941C22 17.5444 17.5529 21.9892 12 21.9892ZM9.19999 18.3204H15.3412C16.6471 18.3204 17.2941 17.6502 17.2941 16.3333V11.2768H12.6353C11.8235 11.2768 11.4353 10.9006 11.4353 10.0892V5.35033H9.19999C7.90587 5.35033 7.24704 6.02059 7.24704 7.33759V16.3333C7.24704 17.662 7.90587 18.3204 9.19999 18.3204ZM12.7294 10.3244H17.2235C17.1882 10.0657 16.9999 9.80698 16.6941 9.50124L13.2118 5.95004C12.9177 5.6443 12.647 5.45616 12.3882 5.42088V9.98337C12.3882 10.2068 12.5059 10.3244 12.7294 10.3244Z" fill="#8086F9"/>
</g>
<defs>
<clipPath id="clip0_49_1939">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
Скачать Руководство по эксплуатации
</div>
<div class="download-file" onclick="window.open(`https://transportsoft.ru/docs/argus/life_cycle.pdf`, '_blank');">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_49_1939)">
<path d="M12 23.9883C18.5647 23.9883 24 18.5439 24 11.9941C24 5.43264 18.5529 0 11.9882 0C5.43529 0 0 5.43264 0 11.9941C0 18.5439 5.44705 23.9883 12 23.9883ZM12 21.9892C6.44705 21.9892 2.01176 17.5444 2.01176 11.9941C2.01176 6.44391 6.43529 1.99903 11.9882 1.99903C17.5411 1.99903 22 6.44391 22 11.9941C22 17.5444 17.5529 21.9892 12 21.9892ZM9.19999 18.3204H15.3412C16.6471 18.3204 17.2941 17.6502 17.2941 16.3333V11.2768H12.6353C11.8235 11.2768 11.4353 10.9006 11.4353 10.0892V5.35033H9.19999C7.90587 5.35033 7.24704 6.02059 7.24704 7.33759V16.3333C7.24704 17.662 7.90587 18.3204 9.19999 18.3204ZM12.7294 10.3244H17.2235C17.1882 10.0657 16.9999 9.80698 16.6941 9.50124L13.2118 5.95004C12.9177 5.6443 12.647 5.45616 12.3882 5.42088V9.98337C12.3882 10.2068 12.5059 10.3244 12.7294 10.3244Z" fill="#8086F9"/>
</g>
<defs>
<clipPath id="clip0_49_1939">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
Скачать Жизненный цикл
</div>
<div class="download-file" onclick="window.open(`https://transportsoft.ru/docs/argus/installation.pdf`, '_blank');">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_49_1939)">
<path d="M12 23.9883C18.5647 23.9883 24 18.5439 24 11.9941C24 5.43264 18.5529 0 11.9882 0C5.43529 0 0 5.43264 0 11.9941C0 18.5439 5.44705 23.9883 12 23.9883ZM12 21.9892C6.44705 21.9892 2.01176 17.5444 2.01176 11.9941C2.01176 6.44391 6.43529 1.99903 11.9882 1.99903C17.5411 1.99903 22 6.44391 22 11.9941C22 17.5444 17.5529 21.9892 12 21.9892ZM9.19999 18.3204H15.3412C16.6471 18.3204 17.2941 17.6502 17.2941 16.3333V11.2768H12.6353C11.8235 11.2768 11.4353 10.9006 11.4353 10.0892V5.35033H9.19999C7.90587 5.35033 7.24704 6.02059 7.24704 7.33759V16.3333C7.24704 17.662 7.90587 18.3204 9.19999 18.3204ZM12.7294 10.3244H17.2235C17.1882 10.0657 16.9999 9.80698 16.6941 9.50124L13.2118 5.95004C12.9177 5.6443 12.647 5.45616 12.3882 5.42088V9.98337C12.3882 10.2068 12.5059 10.3244 12.7294 10.3244Z" fill="#8086F9"/>
</g>
<defs>
<clipPath id="clip0_49_1939">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
Скачать Инструкцию по установке экземпляра ПО
</div>
<div class="download-file" onclick="window.open(`https://transportsoft.ru/docs/argus/functional.pdf`, '_blank');">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_49_1939)">
<path d="M12 23.9883C18.5647 23.9883 24 18.5439 24 11.9941C24 5.43264 18.5529 0 11.9882 0C5.43529 0 0 5.43264 0 11.9941C0 18.5439 5.44705 23.9883 12 23.9883ZM12 21.9892C6.44705 21.9892 2.01176 17.5444 2.01176 11.9941C2.01176 6.44391 6.43529 1.99903 11.9882 1.99903C17.5411 1.99903 22 6.44391 22 11.9941C22 17.5444 17.5529 21.9892 12 21.9892ZM9.19999 18.3204H15.3412C16.6471 18.3204 17.2941 17.6502 17.2941 16.3333V11.2768H12.6353C11.8235 11.2768 11.4353 10.9006 11.4353 10.0892V5.35033H9.19999C7.90587 5.35033 7.24704 6.02059 7.24704 7.33759V16.3333C7.24704 17.662 7.90587 18.3204 9.19999 18.3204ZM12.7294 10.3244H17.2235C17.1882 10.0657 16.9999 9.80698 16.6941 9.50124L13.2118 5.95004C12.9177 5.6443 12.647 5.45616 12.3882 5.42088V9.98337C12.3882 10.2068 12.5059 10.3244 12.7294 10.3244Z" fill="#8086F9"/>
</g>
<defs>
<clipPath id="clip0_49_1939">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
Скачать Функциональные характеристики
</div>
<h1 style="padding-bottom: 10px;">Аргус</h1>
<h3>Версия 1.0.2 от 8 ноября 2023г.</h3>
<h3>© 2023 ООО “Современные Технологии”</h3>
</section>
</section>
</section>
</section>
</section>
<script src="../scripts/jquery.min.js"></script>
<script>
function performRestart() {
const deleteConfirmation = document.getElementById("deleteConfirmation");
const loader = document.getElementById("loader");
const status = document.getElementById("status");
const closeButton = document.getElementById("closeButton");
const mark = document.getElementById("success-mark");
loader.style.display = "block";
closeButton.style.display = "none";
deleteConfirmation.style.display = "flex";
mark.style.display = "none";
const xhr = new XMLHttpRequest();
xhr.open("POST", "/videos/restart", true);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
showMessage("Перезагрузка успешна", true);
} else if (xhr.status === 500) {
showMessage("При перезагрузке произошла ошибка", false);
} else {
showMessage("Не удалось выполнить перезагрузку", false);
}
}
};
xhr.send();
}
function hideMessage() {
const deleteConfirmation = document.getElementById("deleteConfirmation");
deleteConfirmation.style.display = "none";
}
function showMessage(messageText, isSuccess) {
const loader = document.getElementById("loader");
const status = document.getElementById("status");
const closeButton = document.getElementById("closeButton");
const mark = document.getElementById("success-mark");
loader.style.display = "none";
status.textContent = messageText;
if (isSuccess) {
mark.style.display = "block";
status.style.color = "green";
} else {
status.style.color = "red";
}
closeButton.style.display = "block";
}
</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>
</body>
</html>

View File

@ -164,6 +164,27 @@
Скачать Функциональные характеристики
</div>
<h1 style="padding-bottom: 10px;">ПО для просмотра записей</h1>
<div class="download-file" onclick="window.open(`http://{{VIRTUAL_HOST}}/docs/argus-app.zip`, '_blank');">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<g clip-path="url(#clip0_49_1939)">
<path d="M12 23.9883C18.5647 23.9883 24 18.5439 24 11.9941C24 5.43264 18.5529 0 11.9882 0C5.43529 0 0 5.43264 0 11.9941C0 18.5439 5.44705 23.9883 12 23.9883ZM12 21.9892C6.44705 21.9892 2.01176 17.5444 2.01176 11.9941C2.01176 6.44391 6.43529 1.99903 11.9882 1.99903C17.5411 1.99903 22 6.44391 22 11.9941C22 17.5444 17.5529 21.9892 12 21.9892ZM9.19999 18.3204H15.3412C16.6471 18.3204 17.2941 17.6502 17.2941 16.3333V11.2768H12.6353C11.8235 11.2768 11.4353 10.9006 11.4353 10.0892V5.35033H9.19999C7.90587 5.35033 7.24704 6.02059 7.24704 7.33759V16.3333C7.24704 17.662 7.90587 18.3204 9.19999 18.3204ZM12.7294 10.3244H17.2235C17.1882 10.0657 16.9999 9.80698 16.6941 9.50124L13.2118 5.95004C12.9177 5.6443 12.647 5.45616 12.3882 5.42088V9.98337C12.3882 10.2068 12.5059 10.3244 12.7294 10.3244Z" fill="#8086F9"/>
</g>
<defs>
<clipPath id="clip0_49_1939">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>
Скачать
</div>
<h1 style="padding-bottom: 10px;">Аргус</h1>
<h3>Версия 1.0.2 от 8 ноября 2023г.</h3>
<h3>© 2023 ООО “Современные Технологии”</h3>
</section>
</section>

View File

@ -27,6 +27,7 @@
<input title="Повторите пароль" placeholder="Повторите пароль" name="repassword" type="password" required>
<button type="submit">Установить</button>
<a href="/documentation">Информация о ПО</a>
</form>
</section>

View File

@ -20,6 +20,7 @@
<input placeholder="Введите пароль" name="password" type="password" required>
<button type="submit">Войти</button>
<a href="/documentation">Информация о ПО</a>
</form>
</section>