add terminal diag helper v 0.8.5

This commit is contained in:
Alomairi 2024-08-29 14:50:12 +00:00
parent 45da69700c
commit 1ebbdbef48
58 changed files with 3087 additions and 738 deletions

View File

@ -1,8 +1,8 @@
# Terminal Diagnostic Helper
# POS-Diagnostic-Assist
## Overview
**Terminal Diagnostic Helper** is an application designed to assist engineers in diagnosing and resolving issues with POS terminals. Users can view terminal images, select problems, record fixes, and generate reports in Excel format, while also sending data to a server for storage.
**POS-Diagnostic-Assist** is an application designed to assist engineers in diagnosing and resolving issues with POS terminals. Users can view terminal images, select problems, record fixes, and generate reports in Excel format, while also sending data to a server for storage.
## Features
@ -16,5 +16,5 @@
1. **Clone the Repository:**
```bash
git clone https://github.com/yourusername/your-repository.git
git clone https://github.com/Ahmedhkad/POS-Diagnostic-Assist
```

View File

@ -1,7 +1,7 @@
{
"name": "Terminal Diagnostic Helper",
"name": "POS-Diagnostic-Assist",
"version": "1.0.0",
"description": "POS Terminal Diagnostic Helper by Ahmed Alomairi",
"description": "POS-Diagnostic-Assist by Ahmed Alomairi",
"main": "index.js",
"scripts": {
"test": "node main.js test",
@ -13,6 +13,7 @@
"author": "Ahmed Alomairi",
"license": "ISC",
"dependencies": {
"ejs": "^3.1.10",
"express": "^4.18.3",
"express-session": "^1.18.0",

View File

@ -1,111 +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="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png">
<link rel="manifest" href="/images/favicon/site.webmanifest">
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/images/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="/images/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="nav-bar flex">
<div class="first-holder flex">
<!-- <h1 class="logo">EasyCode</h1> -->
<a class="logo"> <img src="/images/favicon/android-chrome-192x192.png" height="40"> СЕРВИС-ВОЛГА </a>
<a href="#" id="m-bar"><i class="fas fa-bars hm"></i></a>
</div>
<div id="menu-links" class="hidden">
<ul>
<li><a onClick="window.location.reload();" class=" "><i class="fa-solid fa-arrows-rotate"></i> Обновить страницу </a>
</li>
<!-- <li><a href="check-serials.html"> <i class="fa-solid fa-list-check"></i> Check Serials</a></li> -->
<!-- <li><a href="#"> <i class="fa-solid fa-upload"></i> Test</a></li> -->
<!-- <li><a id="showStorage" class=" show"><div id="history-lable"><i class="fa-solid fa-floppy-disk"></i> Show History</div></a></li> -->
</ul>
</div>
<!-- <a href="#" id="nav-btn" class="hidden">Signup</a> -->
<a id="showStorage" class="nav-btn hidden show">
<div id="history-lable"><i class="fa-solid fa-floppy-disk"></i>Последние файлы </div>
</a>
</div>
<h2 class="title">
Загрузчик инженерных файлов
<div class="tooltip">
<span> <img src="/images/info.svg" height="20" style="filter: invert(85%) sepia(89%) saturate(5847%) hue-rotate(343deg) brightness(103%) contrast(101%);" alt="" srcset=""></span> <!-- Insert symbol here (question mark) -->
<span class="tooltiptext">Загружаемый файл Excel инженера из папка "Перевод в платные" должен содержать заголовок <br> ( Модель, Сер.номер, Заявленная неисправность, Произведенная работа ) </span>
</div></h2>
<div id="dropZone" class="drop-zone">
<p>Перетащите файлы сюда или нажмите, чтобы выбрать</p>
</div>
<div class="upload-section">
<!-- <label for="fileInput" class="btn">
Select files
</label> -->
<form action="/upload" method="post" enctype="multipart/form-data">
<!-- <input type="file" name="uploaded" multiple id="fileInput"> -->
<input type="file" name="uploaded" multiple id="fileInput" style="display: none;">
<input type="submit" value="Загружать" class="btn" id="fileUpload">
</form>
<button id="getFileStateBtn" class="btn" disabled>Получить состояние файлов</button>
</div>
<div class="container">
<div id="selectedFiles"></div>
</div>
<!-- <div class="filesList">
<div class="selected">
<p>Selected files</p>
</div>
<div class="uploaded">
<p>Uploaded files</p>
<div id="result"></div>
</div>
<div class="state">
<p>Files state</p>
<div id="state"></div>
</div> -->
</div>
<script src="js.js"></script>
<footer>
<a> Upload XLSX v0.9 © 2024 Ал Омаири Ахмед </a>
</footer>
</body>
</html>

View File

@ -1,288 +0,0 @@
const fileInput = document.getElementById('fileInput');
const selectedFilesDiv = document.getElementById('selectedFiles');
let repeatedList = []
fileInput.addEventListener('change', function () {
populateFileTable(Array.from(fileInput.files));
console.log('fileInput.files on change', fileInput.files); getFileListFromServer(fileInput.files);
});
async function getFileListFromServer(fileInput) {
const fileUpload = document.getElementById('fileUpload');
fileUpload.style.color = 'white';
await fetch('/getfilenames')
.then(response => response.json())
.then(data => {
// Call populateFileTable() with the retrieved file list
compareFilelist(fileInput , data);
})
.catch(error => console.error('Error getting file list from server:', error));
}
function compareFilelist(fileInput , data) {
// console.log("resultes :");
console.log(fileInput);
// console.log(data); //array
Array.from(fileInput).forEach(selectedfile => {
console.log(selectedfile.name);
data.forEach(filename => {
if (filename === selectedfile.name){
const repeatedFileName = selectedfile.name
console.log( repeatedFileName, 'is repeated ');
repeatedList.push(repeatedFileName);
Array.from(selectedFilesDiv.children[0].rows).forEach((row, index) => {
const fileNameCell = row.cells[0];
const fileStateCell = row.cells[2];
const fileName = fileNameCell.textContent;
if (fileName == repeatedFileName) {
row.style.backgroundColor = 'rgb(254 255 82)';
fileStateCell.innerText = 'Repeated file!';
}
});
} // repeat function
});
});
}
async function handleFormSubmit(event) {
event.preventDefault();
const getFileStateBtn = document.getElementById('getFileStateBtn');
getFileStateBtn.disabled = false;
const fileUpload = document.getElementById('fileUpload');
fileUpload.style.color = 'grey';
const formData = new FormData(this);
// Get the file input element
const fileInput = document.getElementById('fileInput');
const fileList = fileInput.files;
// Filter out files based on repeatedList before upload
const filteredFiles = Array.from(fileList).filter(file => {
return !repeatedList.includes(file.name);
});
if (filteredFiles.length > 0) {
// Replace the original files with the modified file list
formData.delete('uploaded'); // Delete the existing files
filteredFiles.forEach(file => formData.append('uploaded', file)); // Add modified files
try {
const response = await fetch('/upload', {
method: 'POST',
body: formData
});
// Handle response as needed
const data = await response.json();
console.log(data);
const fileStates = data.states;
const filelist = data.files;
const fileErrors = data.errors;
const resultDiv = document.getElementById('result');
// createTable(resultDiv, data.files);
Array.from(selectedFilesDiv.children[0].rows).forEach((row, index) => {
const fileNameCell = row.cells[0];
const fileSizeCell = row.cells[1];
const fileStateCell = row.cells[2];
const fileName = fileNameCell.textContent;
const fileSize = fileSizeCell.textContent;
filelist.forEach(element => {
if (element.originalFilename === fileName) {
console.log('found file name similar');
console.log('element.size', element.size);
console.log('fileName', fileSize);
if (element.size == fileSize) {
row.style.fontWeight = 'bold';
row.style.backgroundImage = 'radial-gradient(farthest-corner at 50% 50%, skyblue, transparent)';
fileStateCell.innerText = 'uploaded';
} else {
row.style.backgroundColor = 'pink';
fileStateCell.innerText = 'error upload';
}
}
});
// const fileState = filelist.find(file => file.originalFilename === fileName);
// if (fileState) {
// fileSizeCell.textContent = fileState.size;
// if (fileState.size === 'Bad') {
// row.style.backgroundColor = 'red';
// } else {
// row.style.backgroundColor = 'transparent';
// }
// }
});
} catch (error) {
console.error('Error uploading files:', error);
// Handle errors during upload
alert('Error uploading files:', error);
}
} else {
console.log("No valid files selected for upload.");
alert('Допустимые файлы не выбраны или уже загружены.');
}
}
// Function to populate the file table with selected files
function populateFileTable(fileList) {
const table = document.createElement('table');
const headerRow = table.insertRow();
// headerRow.style.background = '#121212';
headerRow.style.background = ' linear-gradient(90deg, rgba(28,28,28,0.8379726890756303) 0%, rgba(24,23,23,0.9556197478991597) 51%, rgba(29,29,29,0.8715861344537815) 100%)';
headerRow.style.color = 'white';
const filenameHeader = headerRow.insertCell();
filenameHeader.textContent = 'Filename';
const sizeHeader = headerRow.insertCell();
sizeHeader.textContent = 'Size';
const stateHeader = headerRow.insertCell();
stateHeader.textContent = 'State';
fileList.forEach(fileData => {
const row = table.insertRow();
const filenameCell = row.insertCell();
if (fileData.originalFilename) {
filenameCell.textContent = fileData.originalFilename;
} else if (fileData.name) {
filenameCell.textContent = fileData.name;
}
const sizeCell = row.insertCell();
sizeCell.textContent = fileData.size;
const stateCell = row.insertCell();
stateCell.textContent = '---';
});
// Replace the existing content with the new table
selectedFilesDiv.innerHTML = '';
selectedFilesDiv.appendChild(table);
}
document.querySelector('form').addEventListener('submit', handleFormSubmit);
document.getElementById("getFileStateBtn").addEventListener("click", async function () {
const getFileStateBtn = document.getElementById('getFileStateBtn');
getFileStateBtn.disabled = true; // Disable the button
const fileUpload = document.getElementById('fileUpload');
fileUpload.style.color = 'white';
const response = await fetch('/getState');
const data = await response.json();
console.log(data);
// const stateDiv = document.getElementById('state');
// createTable(stateDiv, data.states);
const fileStates = data.states;
const fileErrors = data.errors;
// const resultDiv = document.getElementById('result');
// createTable(resultDiv, data.files);
Array.from(selectedFilesDiv.children[0].rows).forEach((row, index) => {
const fileNameCell = row.cells[0];
const fileSizeCell = row.cells[1];
const fileStateCell = row.cells[2];
const fileName = fileNameCell.textContent;
const fileState = fileStates.find(file => file.name === fileName);
if (fileState) {
fileStateCell.innerText = fileState.size;
if (fileState.size === 'Bad') {
row.style.backgroundImage = 'radial-gradient(farthest-corner at 50% 50%, orangered, transparent)';
} else {
row.style.backgroundImage = 'radial-gradient(farthest-corner at 50% 50%, lightgreen, transparent)';
}
}
});
});
const dropZone = document.getElementById('dropZone');
// Prevent default behavior for drag events
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
dropZone.addEventListener(eventName, preventDefault, false);
});
function preventDefault(event) {
event.preventDefault();
event.stopPropagation();
}
// Handle file drop event
dropZone.addEventListener('drop', handleDrop, false);
function handleDrop(event) {
event.preventDefault();
event.stopPropagation();
const fileList = event.dataTransfer.files;
// const repeatedList = ['avoid_uploading_this_file.txt', 'another_filename_to_avoid.txt']; // Example repeatedList
// Filter out files based on repeatedList before upload
const filteredFiles = Array.from(fileList).filter(file => {
return !repeatedList.includes(file.name);
});
// Replace the original files with the modified file list
const formData = new FormData();
filteredFiles.forEach(file => formData.append('uploaded', file)); // Add modified files
// Update the file input field with dropped files
const fileInput = document.getElementById('fileInput');
fileInput.files = fileList;
// Submit the form or call handleFormSubmit function here with formData
populateFileTable(Array.from(fileInput.files));
console.log('dragdrop', fileInput.files);
getFileListFromServer(fileInput.files);
}
// Allow users to trigger file selection by clicking the drop zone
dropZone.addEventListener('click', () => {
const fileInput = document.getElementById('fileInput');
fileInput.click();
});

View File

@ -1,320 +0,0 @@
body {
background-color: #262626;
}
/* .title {
color: #6dabf1;
text-align: center;
} */
.filesList {
display: flex;
gap: 10px;
justify-content: center;
}
table {
display: table;
width: 68vw;
max-width: 1140px;
border-collapse: separate;
box-sizing: border-box;
text-indent: initial;
/* border-spacing: 2px; */
border-spacing: initial;
/* border-color: gray; */
}
td {
padding: 10px;
border-bottom: solid;
/* border-style: solid; */
}
td:first-child{
border-top: solid;
border-top-style: none !important;
border-top-left-radius: 15px;
}
td:last-child{
border-top: solid;
border-top-style: none !important;
border-top-right-radius: 15px;
}
tr:last-child td {
border: none;
}
.container {
display: flex;
margin: 10px;
justify-content: center;
}
#selectedFiles {
text-align: -webkit-center;
max-width: 1140px;
background-color: lavender;
border-radius: 20px;
/* padding-bottom: 10px; */
border-style: outset;
}
body {
/* color: #fff; */
font-family: 'Rubik', sans-serif;
/* margin:0; */
max-width: 1140px;
margin: 0 auto;
}
.logo {
display: flex;
align-items: center;
}
.flex {
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-bar {
padding: 3px 10px 3px 20px;
background-color: rgb(0, 0, 0);
}
.nav-bar a {
color: #fff;
cursor: pointer;
}
.nav-bar .hm {
font-size: 20px;
}
#m-bar {
display: none;
font-size: 20px;
}
#menu-links ul {
margin: 0;
padding: 0;
}
#menu-links ul li {
display: inline-block;
margin: 0 35px;
list-style-type: none;
}
#menu-links a {
text-decoration: none;
font-weight: 500;
font-size: 15px;
text-transform: uppercase;
}
.nav-btn {
padding: 3px 15px;
background-color: #868686;
text-decoration: none;
color: black;
border-radius: 35px;
}
.nav-btn:hover {
background-color: #6791e0 !important;
}
.active {
color: #2d6cdf !important;
}
#menu-links a:hover {
color: #6dabf1 !important;
}
@media only screen and (max-width: 900px) {
#btn {
display: none;
}
}
@media only screen and (max-width: 880px) {
.nav-bar {
display: block;
text-align: center;
background-color: rgba(0, 0, 0, .4);
}
#menu-links ul li {
display: block;
margin: 25px 0;
}
#btn {
display: block;
}
#m-bar {
display: block;
}
.hidden {
display: none !important;
}
.not-hidden {
display: block !important;
}
}
.bg-tarakan {
display: none;
position: absolute;
max-width: 1140px;
width: -webkit-fill-available;
}
.show-tarakan {
display: block;
}
.control {
display: flex;
gap: 20px;
margin: auto;
text-align-last: center;
justify-content: center;
}
/* #getFileStateBtn {
padding: 10px;
} */
.btn {
padding: 12px;
border-radius: 10px;
color: #f5f5f5;
/* background-color: #2d6cdf; */
background: linear-gradient(40deg, #000000, #698ed1);
font-size: 16px;
cursor: pointer;
align-self: center;
box-shadow: 0 4px 7px rgb(99 139 255 / 40%);
border-style: hidden;
}
.upload-section {
display: flex;
gap: 30px;
align-content: center;
justify-content: center;
}
#fileInput {
opacity: 0;
width: 0.1px;
height: 0.1px;
position: absolute;
}
.upload-section input[type=submit] {
/* padding: 12px 30px; */
border: none;
/* background-color: #333333; */
/* color: #ffffff; */
font-size: 16px;
}
.btn:hover ,
.btn:focus {
transform: scale(1.09);
}
form {
/* width: 50%; */
/* margin: auto; */
/* background-color: #f5f5f5; */
/* padding: 30px; */
/* font-size: 20px; */
/* padding: 10px; */
/* border-radius: 10px; */
/* color: #f5f5f5; */
/* background-color: #2d6cdf; */
}
#dropZone {
background: repeating-linear-gradient(45deg, black, transparent 100px);
padding: 30px;
text-align: center;
margin-bottom: 10px;
color: white;
}
/* Add a style for the disabled button */
#getFileStateBtn[disabled] {
color: #ccc; /* Grey text color */
cursor: not-allowed; /* Change cursor to 'not-allowed' */
}
.title {
color: #6dabf1;
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
}
.tooltip {
position: relative;
display: inline-block;
cursor: help; /* Change cursor to pointer on hover */
}
.tooltip .tooltiptext {
visibility: hidden;
width: 327px;
background-color: #333;
color: #fff;
text-align: center;
border-radius: 9px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: -87px;
/* left: 50%; */
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
font-size: 16px;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
padding-top: 5px;
padding-bottom: 5px;
display: flex;
justify-content: center;
background-color: #000000;
color: lightgray;
font-family: sans-serif;
text-decoration: none !important;
}

3
static/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.vscode/settings.json
js/auth.js
manifest.json

102
static/check-serials.html Normal file
View File

@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Check Serials</title>
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png">
<link rel="manifest" href="/images/favicon/site.webmanifest">
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/images/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/images/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/nav.css">
<!-- jQuery Script -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<!-- Maphighlight Script -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/maphilight/1.4.2/jquery.maphilight.min.js"
integrity="sha512-1YiTT24MNHA6DRzyu+w9F5Egc8evYlyEnzSSTD4/M7q42xEb5fSpNgn0+1CPy3evubHs3xdlh8uXgae0DOhR7Q=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://kit.fontawesome.com/e8e55b4ad4.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<!-- <script src="./jput.js"></script> -->
</head>
<body>
<div class="nav-bar flex">
<div class="first-holder flex">
<a class="logo"> <img src="/images/sv-org-logo.png" height="20"> СЕРВИС-ВОЛГА </a>
<a href="#" id="m-bar"><i class="fas fa-bars hm"></i></a>
</div>
<div id="menu-links" class="hidden">
<ul>
<li><a href="http://192.168.1.6:2150/" target="_blank" rel="noopener noreferrer"> <i class="fa-solid fa-upload"></i> Upload</a></li>
</ul>
</div>
<a class="nav-btn hidden show" href="/">Main Page</a>
</div>
<div class="check-butons">
<div class="left-buttons">
<button id="buttonRest" class="btn clean"> <i class="fa-solid fa-delete-left"></i> Clean</button>
<button class="btn copying" id="buttonGet" type="button"><i class="fa-solid fa-list-check"></i> <span
id="searchText">Search</span></button>
</div>
<div class="pageTitle">
<h3>Поиск повторяющихся аппаратов</h3>
<span class="counter"> </span>
</div>
</div>
<div class="searchResult">
<textarea name="" id="textcopied" class="inputHolder22" cols="15" rows="40"></textarea>
<div id="tablePlace" class="repeated2">
<div class="test"></div>
</div>
<pre id="json-data"></pre>
</div>
<div class="copy-text">
<textarea name="" id="copyPlace" cols="130" rows="50"></textarea>
</div>
<br>
<br>
<br>
<br>
<footer>
<a> Terminal-Diagnostic-Helper <span id="version"></span> © 2024 Ал Омаири Ахмед </a>
<a href="https://github.com/Ahmedhkad/Terminal-Diagnostic-Helper" style="padding-left: 5px;"> <i
class="fa-brands fa-github"> </i> </a>
</footer>
</body>
<script src="js/auth.js"></script>
<script src="js/russiankeys.js"></script>
<script src="js/check.js"></script>
</html>

250
static/css/nav.css Normal file
View File

@ -0,0 +1,250 @@
/* Navbar styles */
.logo{
display: flex;
align-items: center;
}
.flex{
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-bar{
padding: 3px 10px 0px 20px;
}
.nav-bar a{
color: #fff;
cursor: pointer;
}
.nav-bar .hm{
font-size: 20px;
}
#m-bar{
display: none;
font-size: 20px;
}
#menu-links ul{
margin: 0;
padding: 0;
}
#menu-links ul li{
display: inline-block;
margin: 0 35px;
list-style-type: none;
}
#menu-links a{
text-decoration: none;
font-weight: 500;
font-size: 15px;
text-transform: uppercase;
}
.nav-btn{
padding: 3px 15px;
background-color: #868686;
text-decoration: none;
color: black;
border-radius: 35px;
}
.nav-btn:hover{
background-color: #6791e0 !important;
}
.active{
color: #2d6cdf !important;
}
#menu-links a:hover{
color: #6dabf1 !important;
}
@media only screen and (max-width: 1105px){
#btn{
display: none;
}
.hidden-title{
display: none !important;
}
.inputHolder {
width: -webkit-fill-available !important;
}
.btn-remove {
right: 15px;
}
}
@media only screen and (max-width: 750px){
.nav-bar{
display: block;
text-align: center;
background-color: rgba(0, 0, 0, .4);
}
#menu-links ul li{
display: block;
margin: 25px 0;
}
#btn{
display: block;
}
#m-bar{
display: block;
}
.hidden{
display: none !important;
}
.not-hidden{
display: block !important;
}
.hidden-title{
display: block !important;
}
}
.bg-tarakan{
display: none;
position: absolute;
max-width: 1140px;
width: -webkit-fill-available;
}
.show-tarakan{
display: block;
}
/* toast notification */
.toast {
position: absolute;
top: 25px;
right: 30px;
border-radius: 12px;
background: #fff;
padding: 20px 35px 20px 25px;
box-shadow: 0 6px 20px -5px rgba(0, 0, 0, 0.1);
overflow: hidden;
transform: translateX(calc(100% + 30px));
transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.35);
}
.toast-up{
left: 0 !important;
right: 0 !important;
margin-left: auto !important;
margin-right: auto !important;
width: fit-content !important;
transform: translateY(-180px) !important;
}
.toast.active {
transform: translateX(0%);
transform: translateY(0%) !important;
}
.toast .toast-content {
display: flex;
align-items: center;
}
.toast-content .check {
display: flex;
align-items: center;
justify-content: center;
/* height: 31px; */
/* width: 30px; */
/* min-width: 35px; */
/* background-color: red; */
color: #fff;
font-size: 20px;
border-radius: 50%;
/* border-color: red; */
border-style: solid;
border-width: thick;
}
.toast-content .message {
display: flex;
flex-direction: column;
margin: 0 20px;
}
.message .text {
font-size: 16px;
font-weight: 400;
color: #666666;
}
.message .text.text-1 {
font-weight: 600;
color: #333;
}
.toast .close {
position: absolute;
top: 10px;
right: 15px;
padding: 5px;
cursor: pointer;
opacity: 0.7;
/* color: red; */
/* border-color: red; */
}
.toast .close:hover {
opacity: 1;
}
.toast .progress {
position: absolute;
bottom: 0;
left: 0;
height: 3px;
width: 100%;
/* background-color: red; */
}
.toast .progress:before {
content: "";
position: absolute;
bottom: 0;
right: 0;
height: 100%;
width: 100%;
/* background-color: red; */
}
.bgRed{
background-color: red;
border-color: red;
}
.bgGreen{
background-color: green;
border-color: green;
}
.txtRed{
color: red;
}
.txtGreen{
color: green;
}
.progress.active:before {
animation: progress 5s linear forwards;
}
@keyframes progress {
100% {
right: 100%;
}
}
.toast.active ~ button {
pointer-events: none;
}

364
static/css/style.css Normal file
View File

@ -0,0 +1,364 @@
html{
/* background: url(https://i.ibb.co/njV5xJS/background.jpg) no-repeat center center fixed;
background-size: cover;
height: 100%; */
}
body {
font-family: 'Rubik', sans-serif;
/* margin:0; */
max-width: 1140px;
margin: 0 auto;
/* background-color: rgb(71, 71, 71); */
/* background: linear-gradient(135deg, #7d7e7d 0%, #0e0e0e 100%);
background: linear-gradient(135deg, #7d7e7d 0%, #0e0e0e 100%); */
background: linear-gradient(0deg, #7d7e7d 0%, #0e0e0e 100%);
background-repeat: no-repeat;
background-attachment: fixed;
margin: auto;
}
.maparea{
margin: auto;
}
.buttons {
display: flex;
justify-content: space-around;
flex-direction: row;
flex-wrap: wrap;
}
.inputHolder {
padding: 10px;
margin-top: 5px;
margin-right: 10px;
margin-bottom: 0px;
margin-left: 10px;
/* width: -webkit-fill-available; */
width: 91%;
border-radius: 25px;
/* font-size: x-large; */
max-height: 15px;
height: 15px;
font-family: sans-serif;
}
.inputHolder2 {
padding: 10px;
margin: 10px;
/* width: -webkit-fill-available; */
width: 82%;
border-radius: 25px;
/* font-size: x-large; */
max-height: 30px;
height: 30px;
font-family: sans-serif;
}
.serialform {
margin: 10px;
margin-left: 2px;
margin-right: 2px;
/* padding: 10px; */
/* text-align: center; */
}
.modelselect{
border-radius: 20px;
font-size: large;
padding: 10px 0px;
/* padding: 10px; */
text-align: center;
align-self: center;
}
.modelselect option{
text-align: center;
overflow: hidden;
}
.form-control {
width: 183px;
font-size: large;
padding: 10px;
/* border-radius: 23px; */
border-top-left-radius: 25px;
/* border-top-right-radius: 23px; */
/* border-bottom-right-radius: 23px; */
border-bottom-left-radius: 25px;
}
.form-btn {
padding: 10px;
text-align: center;
cursor: pointer;
font-size: large;
border-top-right-radius: 25px;
border-bottom-right-radius: 25px;
}
.btn {
padding: 10px;
/* width: -webkit-fill-available; */
border-radius: 25px;
margin: 10px;
margin-left: 2px;
margin-right: 2px;
text-align: center;
font-size: large;
cursor: pointer;
}
.btnbeta {
border-radius: 15px;
color: green;
border-color: green;
border-width: 5px;
position: absolute;
margin-top: 15px !important;
}
.btn-small {
padding: 3px;
margin: 0px;
font-size: small;
}
.btn-remove{
cursor: pointer;
/* border-radius: 15px; */
color: red;
/* border-color: red; */
/* border-width: 2px; */
position: absolute;
margin-top: 5px !important;
z-index: 5;
padding: 5px;
font-size: x-large;
background: transparent;
border-style: none;
}
.clean {
background-color: coral;
}
.copying {
background-color: lightgreen;
}
.device {
margin: auto;
}
.dancers {
display: none;
}
.repeated {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
color: red;
}
.last-records {
display: flex;
justify-content: space-around;
flex-wrap: wrap;
color: rgb(51, 51, 51);
font-size: small;
}
table,
th,
td {
border: 1px solid black;
border-collapse: collapse;
background-color: aliceblue;
padding: 4px;
}
.visible {
display: block;
position: absolute;
z-index: 1;
top: 470px;
left: 77px;
}
.visible-table{
display: none !important;
}
nav {
display: flex;
position: relative;
left: 0;
top: 0;
width: 100%;
padding-top: 5px;
padding-bottom: 5px;
display: flex;
justify-content: space-around;
background-color: #000000;
color: lightgray;
font-family: sans-serif;
text-decoration: none !important;
flex-direction: row;
flex-wrap: nowrap;
align-content: center;
font-size: larger;
}
footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
padding-top: 5px;
padding-bottom: 5px;
display: flex;
justify-content: center;
background-color: #000000;
color: lightgray;
font-family: sans-serif;
text-decoration: none !important;
}
.searchResult {}
.check-butons {
margin-left: 10px;
display: flex;
}
.left-buttons {
width: 40%;
}
.pageTitle {
font-family: sans-serif;
color: darkturquoise;
}
.repeated2 {
/* display: flex; */
justify-content: space-around;
flex-wrap: wrap;
float: right;
width: 80%;
padding-bottom: 35px;
}
.inputHolder22 {
padding: 10px;
margin-left: 10px;
/* width: -webkit-fill-available; */
width: 15%;
border-radius: 15px;
font-family: sans-serif;
}
.greenTable {
color: green;
}
.redTable {
color: red;
}
.bold{
font-weight: bold;
color: darkred;
}
.not-show{
display: none !important;
}
#history{
display: flex;
justify-content: center;
}
.copy-text{
margin: 15px;
padding: 10px;
}
.options-icon {
cursor: pointer;
}
.options-box {
width: 66%;
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding-right: 20px;
padding-bottom: 20px;
padding-left: 20px;
background-color: white;
border: 1px solid #ccc;
border-radius: 5px;
z-index: 9999;
background: rgb(229 229 229 / 94%);
}
.options-box input {
padding: 5px;
border-radius: 7px;
margin: 2px;
}
.close-btn {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
}
.additionalInfo {
background-color: yellow;
padding: 3px 12px;
border-radius: 5px;
cursor: pointer;
}
.additional2buttons {
background-color: red;
color: aliceblue;
padding: 3px 12px;
border-radius: 5px;
cursor: pointer;
}
.centered{
margin-left: 36%;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
border-radius: 20px;
padding-top: 3px;
padding-right: 20px;
padding-bottom: 3px;
padding-left: 20px;
}
.additionalButtonsContainer{
display: flex;
justify-content: center;
gap: 10px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 KiB

17
static/images/SV.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
static/images/dance.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/images/favicon/mstile-150x150.png"/>
<square310x310logo src="/images/favicon/mstile-310x310.png"/>
<TileColor>#00aba9</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,43 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="421.000000pt" height="421.000000pt" viewBox="0 0 421.000000 421.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,421.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M2630 3514 c-156 -29 -209 -42 -294 -71 -154 -53 -283 -124 -417
-229 -30 -24 -58 -44 -61 -44 -3 0 -36 18 -72 40 -85 52 -214 105 -318 131
-119 30 -351 37 -477 15 -466 -81 -830 -422 -958 -896 -34 -126 -43 -369 -20
-505 73 -417 351 -765 739 -924 129 -53 227 -72 393 -78 225 -8 381 25 572
119 l82 41 63 -58 c130 -118 301 -218 474 -278 170 -59 255 -72 464 -72 199 0
280 11 435 62 425 138 770 483 908 908 51 155 62 236 62 435 0 206 -11 280
-70 457 -134 403 -470 739 -880 880 -142 49 -240 65 -425 68 -96 2 -186 1
-200 -1z m-1112 -404 c11 0 13 -9 9 -42 -10 -78 -10 -78 194 -78 l181 0 -7
-104 c-8 -115 0 -146 39 -146 50 0 153 -40 194 -76 23 -19 42 -39 42 -43 0 -4
-32 -33 -71 -66 -71 -59 -176 -179 -217 -246 -12 -19 -30 -44 -42 -54 -19 -17
-21 -17 -91 24 -39 22 -78 41 -85 41 -24 0 -15 -30 24 -78 21 -26 62 -77 91
-114 83 -104 85 -103 155 47 49 102 162 276 230 350 l45 50 20 -25 c38 -47 72
-128 84 -194 22 -129 -27 -278 -125 -382 -66 -70 -113 -98 -208 -122 l-75 -19
-3 -242 -2 -241 -723 2 -722 3 -3 818 -2 817 185 0 185 0 0 60 0 60 313 3
c171 2 325 2 341 0 16 -2 35 -3 44 -3z"/>
<path d="M1543 2954 c-8 -4 -13 -26 -13 -59 l0 -54 -327 -3 c-181 -2 -340 -1
-356 1 -25 3 -27 6 -21 36 3 18 3 43 -1 54 -6 20 -13 21 -171 21 l-164 0 2
-777 3 -778 680 0 680 0 0 219 0 218 -84 24 c-129 38 -173 69 -264 188 l-28
36 -219 0 -220 0 0 29 c0 63 -6 61 209 61 l196 0 1 113 c0 80 5 122 16 149 9
20 14 39 10 42 -3 3 -99 6 -214 6 l-208 0 0 45 0 45 241 0 240 0 57 54 c70 66
87 75 187 101 l80 20 3 103 3 102 -109 0 c-60 0 -129 2 -153 5 -24 2 -50 2
-56 -1z m-635 -416 l-3 -123 -122 -3 -123 -3 0 126 0 125 125 0 126 0 -3 -122z
m-8 -408 l0 -130 -120 0 -120 0 0 130 0 130 120 0 120 0 0 -130z m6 -326 c-3
-26 -6 -85 -6 -131 l0 -85 -120 4 -120 3 0 128 0 127 126 0 127 0 -7 -46z
m772 -86 l3 -48 -315 0 -316 0 0 45 0 45 248 3 c136 1 276 3 312 2 l65 0 3
-47z"/>
<path d="M692 2533 l3 -88 85 0 85 0 3 88 3 87 -91 0 -91 0 3 -87z"/>
<path d="M697 2214 c-10 -10 -9 -146 2 -162 5 -9 30 -12 87 -10 l79 3 0 85 0
85 -80 3 c-45 1 -84 0 -88 -4z"/>
<path d="M692 1723 l3 -88 85 0 85 0 3 88 3 87 -91 0 -91 0 3 -87z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,50 @@
{
"name": "Pax S90",
"short_name": "Pax S90",
"icons": [
{
"src": "/images/favicon/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/images/favicon/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"start_url": "/",
"display": "standalone"
}

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
static/images/tarkan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

468
static/index2.html Normal file
View File

@ -0,0 +1,468 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/images/favicon/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png">
<link rel="manifest" href="/images/favicon/site.webmanifest">
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/images/favicon/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Pax S90">
<meta name="application-name" content="Pax S90">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="msapplication-TileImage" content="/images/favicon/mstile-144x144.png">
<meta name="msapplication-config" content="/images/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>Pax S90</title>
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/nav.css">
<script src="js/jquery-3.5.1.min.js"></script>
<script src="js/jquery.maphilight.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="https://kit.fontawesome.com/e8e55b4ad4.js" crossorigin="anonymous"></script>
<!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
</head>
<body>
<div id="toast" class="toast">
<div class="toast-content">
<div id="toastIcon" class="check">
</div>
<div class="message">
<span class="text text-1">Success</span>
<span class="text text-2">Your changes has been saved</span>
</div>
</div>
<i class="fa-solid fa-xmark close"></i>
<!-- Remove 'active' class, this is just to show in Codepen thumbnail -->
<div class="progress"></div>
</div>
<!-- <button class="buttonTest">Show Toast</button> -->
<div class="nav-bar flex">
<div class="first-holder flex">
<a class="logo"> <img src="/images/sv-org-logo.png" height="20"> СЕРВИС-ВОЛГА </a>
<a href="#" id="m-bar"><i class="fas fa-bars hm"></i></a>
</div>
<div id="menu-links" class="hidden">
<ul>
<li><a onClick="window.location.reload();" class=" "><i class="fa-solid fa-arrows-rotate"></i> <span
class="hidden-title"> Refresh</span>
</a> </li>
<li><a href="check-serials.html"> <i class="fa-solid fa-list-check"></i><span class="hidden-title">
Check Serials</span> </a></li>
<li><a href="http://192.168.1.6:2150/" target="_blank" rel="noopener noreferrer"> <i
class="fa-solid fa-upload"></i> <span class="hidden-title"> Upload</span></a></li>
<li><a class="options-icon" onclick="toggleOptionsBox()" href="#"><i class="fa-solid fa-gear"> <span
class="hidden-title"> Options</span></i></a>
</li>
<li>
</li>
</ul>
</div>
<a id="showStorage" class="nav-btn hidden show">
<div id="history-lable"><i class="fa-solid fa-floppy-disk"></i> Show History</div>
</a>
</div>
<div class="beta"><textarea id="titleInput" class="inputHolder" placeholder="" rows="" cols="" name=""
form=""> </textarea>
<button id="removeFixes" class="btn-remove"> <i class="fa-solid fa-delete-left"></i> </button>
</div>
<div id="lastThree" class="last-records">
</div>
<div id="history"></div>
<div class="buttons">
<select name="model" id="selectmodel" class="serialform modelselect" placeholder="Model">
<option value="S90">S90</option>
<option value="S80">S80</option>
<option value="SP30">SP30</option>
<option value="S200">S200</option>
<option value="S300">S300</option>
<option value="S920">S920</option>
<option value="S900">S900</option>
<option value="A920">A920</option>
<option value="A930">A930</option>
<option value="D200">D200</option>
<option value="D230">D230</option>
<option value="IM20">IM20</option>
<option value="V240m">V240m</option>
<option value="V200t">V200t</option>
<option value="V205c">V205c</option>
<option value="V520">V520</option>
<option value="VX675">VX675</option>
<option value="VX680">VX680</option>
<option value="VX805">VX805</option>
<option value="VX820">VX820</option>
<option value="VX840">VX840</option>
<option value="P400">P400</option>
<option value="PP1000se">PP1000se</option>
</select>
<div>
<form action="" id="SerialNumber" class="serialform">
<!-- <span>SerialNumber: </span> -->
<input type="text" id="serial" class="form-control" placeholder="serial number">
<button class="form-btn" type="submit"> <i class="fa-brands fa-searchengin"></i> <span
id="searchText">Search</span> </button>
</form>
</div>
<div>
<button id="copyText" class="btn copying"><i class="fa-solid fa-copy"></i> Copy & Upload</button>
<!-- <button id="uploadText" class="btn copying"><i class="fa-solid fa-upload"></i> UP</button> -->
<button id="reset" class="btn clean"> <i class="fa-solid fa-delete-left"></i> Clean</button>
</div>
</div>
<div id="tablePlace" class="repeated"> </div>
<div id="tablePlace2" class="repeatedx">
</div>
<div class="additionalButtonsContainer">
<div id="top2ButtonsContainer"></div>
<div id="topButtonsContainer"></div>
</div>
<div>
<img class="bg-tarakan" src="./images/dance.gif">
</div>
<img src="./images/PAX-S90-v0.7.png" usemap="#image-map" class="maparea">
<map name="image-map" id="map">
<!-- ImageReady Slices (PAX-S90-ready-image-ready.psd) -->
<map name="PAX_S90_ready_image_ready_Map">
<area shape="poly" gid="usb" id="usb"
coords="30,406, 31,430, 33,431, 32,463, 27,465, 25,466, 24,470, 24,477, 23,489, 24,502, 26,503, 38,504, 38,511, 15,511, 14,499, 15,495, 14,482, 13,482, 12,467, 8,464, 5,463, 4,461, 4,430, 7,429, 7,406"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="backcase" id="backcase"
coords="489,506, 491,507, 498,508, 500,510, 501,515, 502,517, 503,521, 504,529, 503,600, 501,603, 500,608, 494,611, 482,612, 459,611, 456,607, 455,599, 454,569, 455,524, 456,522, 456,519, 458,517, 459,511, 465,508, 471,507, 470,506, 472,505"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyboard" id="keyboard" coords="358,436,416,487"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printerroller" id="printerroller"
coords="59,76, 64,82, 74,81, 78,80, 213,81, 215,82, 221,83, 229,84, 227,91, 208,92, 73,92, 72,89, 61,90, 56,95, 54,94, 53,90, 53,75"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printerchange" id="printerchange"
coords="230,52, 231,58, 232,60, 233,68, 232,82, 231,84, 231,95, 231,104, 224,104, 223,94, 223,91, 229,90, 229,83, 227,82, 221,83, 216,82, 214,81, 196,80, 143,80, 144,52"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printerclean" id="printerclean" coords="129,25, 136,33, 129,37, 127,36, 125,37, 101,38, 103,39, 138,39, 139,52, 142,52, 142,79, 72,80, 67,82, 62,81, 60,76, 59,74, 57,75, 52,75, 53,97, 59,96, 60,92, 62,91, 63,93, 62,113, 43,112, 42,110, 43,92, 42,88, 43,50, 47,49, 49,48, 92,47, 94,44, 95,39,
93,34, 92,29, 91,28, 89,29,
88,26, 108,25, 122,24"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printercoverused" id="printercoverused"
coords="217,121, 228,127, 234,137, 247,193, 245,208, 143,206, 145,117, 212,120"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printercovernew" id="printercovernew"
coords="142,117, 142,208, 34,207, 35,194, 36,192, 37,186, 38,172, 39,168, 42,149, 43,147, 48,133, 58,122, 64,121, 68,120, 90,117"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"00ff00","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="Clear"
coords="157,596, 160,598, 161,602, 160,608, 155,612, 145,615, 135,614, 133,613, 127,610, 123,603, 126,597, 128,596, 142,595"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="Cancle"
coords="105,571, 107,574, 108,578, 108,585, 106,586, 104,590, 103,592, 97,597, 84,596, 77,588, 76,586, 75,582, 76,575, 80,571, 103,571"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n0"
coords="161,568, 163,573, 162,579, 155,585, 144,587, 133,586, 125,581, 123,574, 124,569, 129,567"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="Enter"
coords="199,570, 207,571, 210,575, 209,586, 206,592, 204,593, 204,594, 203,593, 200,596, 197,596, 189,595, 187,594, 182,590, 178,581, 177,577, 178,573, 182,570"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n9"
coords="208,539, 214,543, 215,547, 214,553, 209,557, 200,559, 188,558, 186,557, 180,554, 177,548, 178,540, 182,539, 196,538"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n8"
coords="160,539, 163,543, 162,550, 156,556, 143,558, 133,557, 131,556, 124,551, 123,545, 124,541, 127,539, 131,538"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n7"
coords="107,540, 108,543, 109,543, 108,551, 102,557, 92,560, 78,559, 72,554, 71,552, 72,542, 78,539"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n4"
coords="108,512, 109,516, 108,522, 102,528, 92,531, 79,530, 77,529, 72,525, 71,521, 72,514, 74,512, 76,511"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n5"
coords="160,510, 163,516, 162,522, 158,526, 150,529, 146,530, 134,529, 132,528, 125,524, 123,517, 124,512, 128,509"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n6"
coords="210,510, 211,512, 214,513, 215,519, 214,524, 210,528, 197,530, 188,529, 186,528, 181,525, 177,520, 178,512, 183,510"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n3"
coords="211,482, 214,486, 215,492, 208,499, 200,500, 188,499, 181,494, 178,490, 179,483, 181,482, 189,481"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n2"
coords="157,481, 160,481, 161,483, 163,484, 162,493, 156,498, 149,500, 145,501, 134,500, 132,499, 127,496, 123,491, 124,483, 127,481"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n1"
coords="107,482, 106,483, 108,485, 109,487, 108,492, 101,499, 92,501, 86,502, 84,501, 77,500, 71,495, 72,484, 75,482, 79,481"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="alpha"
coords="104,447, 108,450, 108,455, 105,460, 101,463, 91,466, 79,465, 72,460, 71,454, 73,449, 78,447, 86,446"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="down"
coords="159,447, 161,450, 163,451, 162,458, 157,463, 147,466, 134,465, 132,464, 125,459, 123,454, 124,449, 126,447, 128,446"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="menu"
coords="207,446, 209,447, 214,451, 215,455, 214,460, 210,464, 197,466, 184,463, 177,455, 178,449, 184,446, 200,445"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="func"
coords="210,417, 214,421, 215,425, 214,430, 210,434, 201,436, 189,435, 187,434, 182,431, 178,426, 178,420, 179,419, 178,418, 179,417, 180,418, 182,417, 188,416"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="up"
coords="153,418, 161,425, 162,428, 163,430, 162,433, 158,436, 151,437, 149,436, 147,437, 131,436, 125,435, 123,428, 128,421, 134,418, 138,417"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="power"
coords="106,417, 108,420, 107,429, 103,432, 97,435, 89,436, 75,433, 72,429, 71,425, 72,421, 75,417, 87,416"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f4" coords="219,364,239,378"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f3" coords="220,339,239,354"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f2" coords="220,315,239,331"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f1" coords="220,293,239,307"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area gid="plonka" id="plonka" href="#" coords="68,283,138,376" shape="rect"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'>
<area gid="screen" id="screen" href="#" coords="206,283,140,378" shape="rect"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'>
<area shape="poly" gid="newdc" id="newdc"
coords="420,364, 416,391, 410,397, 413,400, 400,409, 360,399, 360,374, 372,361, 372,359, 378,358, 386,354, 419,362"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"00ff00","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="Tarakan" id="Tarakan"
coords="303,521, 305,518, 305,529, 312,530, 313,528, 315,526, 320,519, 314,536, 316,543, 317,543, 322,545, 324,546, 335,551, 341,552, 325,554, 324,559, 326,563, 330,591, 334,602, 337,609, 335,609, 329,596, 326,593, 323,595, 324,605, 319,608, 309,611, 297,605, 292,605,
291,601, 287,617, 287,603,
283,590, 282,573, 282,571, 289,569, 285,559, 281,561, 279,564, 276,565, 276,567, 274,567, 270,566, 273,564, 273,563, 278,560, 278,558, 280,558, 280,557, 287,551, 287,542, 284,530, 283,526, 288,527, 291,527, 281,515, 273,506, 295,524, 299,521, 307,499, 301,523, 303,523"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="circle" gid="water" id="water" coords="395,563,43"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area gid="changesimreader" id="simreader1" target="" alt="right" title="right"
coords="480,315,449,235,378,235,381,306" shape="poly"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area gid="cleansimreader" id="simreader2" target="" alt="left" title="left"
coords="307,231,286,307,377,305,377,232" shape="poly"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="cpu" id="cpu"
coords="404,189, 423,189, 424,193, 425,197, 426,201, 427,205, 430,215, 431,222, 401,221, 357,220, 329,219, 322,219, 323,208, 324,206, 329,188"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="protection" id="protection"
coords="307,222, 319,225, 317,232, 304,234, 286,292, 282,324, 278,323, 273,314, 272,300, 285,251, 297,220"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="protection" id="protection"
coords="460,228, 469,251, 489,312, 479,325, 478,302, 457,250, 448,236, 438,230, 444,225"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="dcjack" id="dcjack"
coords="478,118, 483,128, 482,139, 481,141, 480,142, 476,143, 474,144, 469,143, 467,142, 464,141, 463,143, 463,144, 462,139, 457,140, 457,141, 456,138, 454,135, 453,129, 454,117"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="batteries" id="batteries"
coords="352,91, 354,92, 360,95, 362,98, 361,110, 349,117, 335,118, 320,117, 314,112, 312,107, 311,104, 310,103, 320,94, 326,91, 334,90"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="batteries2" id="batteries2" coords="400,119, 402,120, 407,121, 413,124, 416,125, 426,134, 428,139, 429,143, 428,155, 426,158, 425,163, 420,170, 412,175, 400,178, 388,179, 384,178, 374,177, 368,174, 359,169, 355,165, 352,161, 351,157, 350,140, 349,138, 349,131, 353,130, 367,121, 371,120,
380,118" data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="buzzer" id="buzzer"
coords="323,148, 324,150, 325,150, 327,153, 328,153, 330,160, 329,171, 321,179, 322,180, 320,182, 303,181, 301,168, 302,165, 300,163, 299,160, 306,152, 311,150, 315,149, 317,148"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="ctls" id="ctls" href="#" coords="49,249,242,470"
data-maphilight='{"strokeColor":"ee0000","strokeWidth":2,"fillColor":"ff0000","fillOpacity":0.4}'
href="#">
<area shape="poly" gid="boardio" id="boardio" href="#"
coords="430,45, 453,83, 463,85, 464,94, 456,98, 458,100, 462,102, 464,104, 475,106, 476,114, 386,117, 363,117, 362,109, 361,96, 352,91, 330,90, 314,98, 311,101, 309,108, 303,107, 292,107, 298,95, 304,89, 308,80, 316,77, 317,65, 313,62, 321,40, 426,41"
data-maphilight='{"strokeColor":"ee0000","strokeWidth":2,"fillColor":"ff0000","fillOpacity":0.4}'>
<area shape="poly" gid="lens" id="lens"
coords="675,42, 680,66, 683,67, 679,91, 682,101, 681,109, 682,117, 683,128, 683,143, 685,165, 601,168, 553,165, 556,86, 556,49, 561,47, 563,40"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="battery_new" id="battery_new"
coords="596,293, 652,294, 690,299, 689,336, 562,335, 558,302, 546,322, 545,328, 536,332, 533,335, 521,323, 528,314, 531,310, 538,310, 556,298, 567,293, 594,293"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="gprs" id="gprs"
coords="696,186, 696,262, 587,261, 546,255, 549,235, 542,232, 556,195"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="chip" id="chip"
coords="659,544, 667,559, 671,548, 712,554, 708,593, 665,587, 664,584, 639,597, 636,594, 620,562, 657,542"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="off" id="off" coords="547,533,606,612"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="charging" id="charging"
coords="653,362, 654,364, 655,372, 659,373, 661,380, 675,381, 674,382, 659,383, 658,388, 654,389, 653,399, 584,398, 583,396, 582,381, 567,381, 568,379, 583,378, 584,362, 586,361"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="bunker" id="bunker" coords="678,433, 690,513, 550,511, 564,430, 664,428"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="mag_change" id="mag_change"
coords="314,424, 310,449, 308,450, 305,470, 302,490, 298,493, 285,489, 283,450, 277,447, 277,422"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="mag_clean" id="mag_clean"
coords="304,350, 306,359, 307,389, 308,389, 309,391, 311,392, 312,398, 313,406, 314,408, 314,421, 276,420, 277,393, 280,392, 282,391, 285,388, 286,385, 285,383, 286,381, 287,351, 288,352, 293,350"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="frontcase_clean" id="frontcase_clean" coords="452,355,477,470"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="frontcase_change" id="frontcase_change" coords="478,355,504,470"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
</map>
<!-- OPTION TAG -->
<div id="options-box" class="options-box">
<div class="close-btn" onclick="closeOptionsBox()"></div>
<h2>Options</h2>
<label for="background-color">Background Color:</label>
<input type="color" id="background-color" onchange="changeBackgroundColor()">
<!-- <br>
<label for="font-size">Font Size (px):</label>
<input type="number" id="font-size" min="10" max="50" onchange="changeFontSize()"> -->
<br>
<hr>
<label for="toggleCheckbox">Последние записи ... Скрыть? </label>
<input type="checkbox" id="toggleCheckbox" onchange="toggleTableVisibility()">
<br>
<label for="font-size">Максимальное количество последних записей :</label>
<input type="number" id="last-record-setting" min="1" max="9" placeholder="2"
onchange="changeLastRecords()">
<br>
<hr>
<label for="toggleWaitingCheckbox">Скрыть кнопки (в ожидание запасных частей) ?</label>
<input type="checkbox" id="toggleWaitingCheckbox" onchange="toggleWaitingVisibility()">
<br>
<label for="newButtonInput">В ожидание :</label>
<input type="text" id="newButtonInput" placeholder="В ожидании крышки принтера">
<br>
<button onclick="addButton()" class="additionalInfo centered">Добавить новую кнопку</button>
<div id="settingButtonsContainer"> </div>
<br>
<hr>
<label for="toggleFixesCheckbox">Скрыть кнопки (доб. неисправность) ?</label>
<input type="checkbox" id="toggleFixesCheckbox" onchange="toggleFixesVisibility()">
<br>
<label for="new2ButtonInput">Заявленная неисправность :</label>
<input type="text" id="new2ButtonInput" placeholder="неисправность">
<br>
<!-- Additional input for button note -->
<label for="new2ButtonNote">Произведенная работа :</label>
<input type="text" id="new2ButtonNote" placeholder="Произведенная работа">
<br>
<button onclick="add2Button()" class="additional2buttons centered">Добавить новую кнопку</button>
<div id="setting2ButtonsContainer"> </div>
<hr>
<label for="toggleNotificationCheckbox">Уведомлени вверх ?</label>
<input type="checkbox" id="toggleNotificationCheckbox" onchange="toggleNotificationUP()">
<br>
<label for="togglePoliteCheckbox">Polite notification ?</label>
<input type="checkbox" id="togglePoliteCheckbox" onchange="toggleNotificationPolite()">
<br>
<br>
<br>
<button class="centered" onclick="saveSettings()">Save Settings</button>
<button onclick="clearSettings()">Clear Settings</button>
</div>
<footer>
<a> Terminal-Diagnostic-Helper <span id="version"></span> © 2024 Ал Омаири Ахмед </a>
<a href="https://github.com/Ahmedhkad/Terminal-Diagnostic-Helper" style="padding-left: 5px;"> <i
class="fa-brands fa-github"> </i> </a>
</footer>
</body>
<script src="js/auth.js"></script>
<script src="js/options.js"></script>
<script src="js/russiankeys.js"></script>
<script src="js/diag.js"></script>
</html>

View File

@ -0,0 +1,4 @@
const serverEnv = {
"ip" : "192.168.1.100:80",
"version" : "v0.1.1"
}

2
static/js/axios.min.js vendored Normal file

File diff suppressed because one or more lines are too long

129
static/js/check.js Normal file
View File

@ -0,0 +1,129 @@
document.getElementById("buttonGet").onclick = function () {
const data = document.getElementById("textcopied");
console.table(data.value);
const serialsList = data.value.split("\n")
console.log(serialsList);
$('#tablePlace').append('<tr><th>Модель</th><th>Сер.номер</th><th>Заявленная неисправность</th><th>Произведенная работа</th><th>Файл</th><th>Сервер</th></tr>')
serialsList.forEach(element => {
if (element) {
// console.log(element);
check(element)
}
});
};
let counter = 0
$('#buttonRest').on('click', () => {
document.getElementById("textcopied").focus();
$("#textcopied").select();
// $('#titleInput2').val('Cleaned!')
$('#tablePlace').text('')
counter = 0
$('.counter').text('')
});
function check(serialUnchecked) {
const serial = keyboardLayoutSwitch(serialUnchecked)
if (serial == "") {
// alert("Ensure you input a value in both fields!");
$('#searchText').text('Empty!')
} else {
$('#searchText').text(' Sending ... wait')
$('#buttonGet').css('background-color', 'yellow')
axios.get('http://'+serverEnv.ip+'/search2?sn=' + serial)
.then(response => {
console.log(response);
counter = counter + response.data.length
if(response.statusText == 'OK'){
$('#searchText').text('Search')
$('#buttonGet').css('background-color', 'chartreuse')
}
const data = response.data
let bold = false
if (response.data.length > 1) {
bold = true
}
console.log(data);
if( data.length == 0){
console.log('empty');
appendata(false, serial, response.statusText );
}
for (var key in data) {
console.dir(data[key]);
// console.log(data.length);
// $('.repeated').append(buildHtmlTable([data[key]]))
appendata(data[key], serial, response.statusText, bold ); // The response body
}
$('.counter').text('найден : ' + counter)
})
.catch(error => {
$('#tablePlace').append('<tr class="redTable"><td>error !</td> <td colspan="4"> No answer from server , try again or ask Ahmed !</td> <td>'+error.code+'</td> </tr>')
$('#searchText').text(error.message)
$('#buttonGet').css('background-color', 'orangered')
console.error(error);
});
} //end if else
}
const list = document.getElementById("json-data");
function appendata(data,sn,statusText, bold) {
console.log(data);
if(data){
// $('#tablePlace').append(buildHtmlTable([data]))
let addClass = ''
if(bold){addClass = 'bold'}
$('#tablePlace').append('<tr class="redTable '+ addClass +'"><td>'+data.Model+'</td><td>'+data.SerialNumber+'</td> <td>'+data.Problem+'</td> <td>'+ data.Details +'</td> <td>'+data.filename+'</td><td>'+statusText+'</td> </tr>')
const xlsxFormat = data.Model + ' ' + data.SerialNumber + ' ' + data.Problem + ' ' + data.Details + ' ' + data.filename + '\n'
console.log('thsi data texarea is: ', xlsxFormat);
$('#copyPlace').append(xlsxFormat).attr('rows', '5') // Set the number of
}
else{
$('#tablePlace').append(' <tr class="greenTable"><td>ОК</td> <td>'+sn+'</td><td colspan="3">Серийный номер не найден в БД</td> <td>'+statusText+'</td></tr> ')
}
}
$(document).ready(function(){
// your code
$('#version').text(serverEnv.version)
});

775
static/js/diag.js Normal file
View File

@ -0,0 +1,775 @@
let details = {
usb: ["Восстановление ПО", "Проблеммы с ПО"],
backcase: ["Замена заднего корпуса", "Корпус МЕХ"],
keyboard: ["Замена клавиатуры", "Залипает клавиатура"],
printerroller: ["Замена ролика принтера", "Не печатает"],
printerchange: ["Замена принтера", "Не печатает"],
printerclean: ["Очистка принтера", "Не печатает"],
printercoverused: ["Замена крышки принтера (б\y)", "Не печатает"],
printercovernew: ["Замена крышка принтера и ролик (новая)", "Не печатает"],
plonka: ["Снять пленку с экрана", "Экран"],
screen: ["Замена дисплея", "Экран"],
newdc: ["Замена разъема зарядки", "Не заряжается"],
mag_change: ["Замена магнитный ридер", "Зависает"],
Tarakan: ["Отказ. тараканы", "TAMPER"],
water: ["Отказ. попадание жидкости", "TAMPER"],
changesimreader: ["Перепайка картридера", "не читает карты"],
cleansimreader: ["Очистка картридера", "не читает карты"],
cpu: ["Отказ. системная плата", "TAMPER"],
protection: ["Перепайка тамперного модуля", ""],
dcjack: ["Перепайка разъема зарядки", "Не заряжается"],
batteries: ["Замена батарейки CR2032", "TAMPER"],
batteries2: ["Замена Батарейки CR2450", "TAMPER"],
buzzer: ["Замена пищалка", "пищалка"],
conactlessboard: ["Замена платы ктлц", "Залипает клавиатура"],
key: ["Очистка клавиатуры", "Залипает клавиатура"],
keyC: ["Очистка платы ктлц", "Залипает клавиатура"],
boardio: ["Замена нижней платы", "Не печатает"],
ctls: ["Замена платы ктлц", "Залипает CTLS"],
mag_clean: ["Очистка магнитный ридер", "Залит"],
frontcase_change: ["Замена переднего корпуса", "Корпус МЕХ"],
frontcase_clean: ["Очистка корпуса", "Залит"],
bunker: ["Замена бункер", "Кнопки"],
charging: ["Восстановление АКБ", "АКБ"],
battery_new: ["Замена АКБ", "АКБ"],
gprs: ["Замена модуль связи", "Связь"],
lens: ["Замена линза", "Линза"],
chip: ["обшая работа", "Не прошивается"],
off: ["", "Не вкл"],
}
const models = {
"S90": ["3K", "3k", "3Л", "3л", 8],
"S80": ["2N", "2n", "2Т", "2т", 8],
"S920": ["6N", "6n", "6т", "6Т", "6P", "6З", 8],
"SP30": ["3A", "3a", "3Ф", "3ф", 8],
"S200": ["5E", "5e", "5У", "5у", 8],
"S300": ["5G", "5g", "5п", "5П", "53", 8],
"S300": ["05G", "05g", "05п", "05П", 0],
"V240m": ["450-", "390-", 11],
"V520": ["331-4", "331-9", "262-", "285-", 11],
"VX675": ["331-0", "331-3", "331-0", "333-", "332-", 11],
"VX820": ["903-", 11],
"D230": ["233", 10]
}
manualSelectModel = false; // manual select model
let lastThreeRecords = [];
let tempDetails = []
let tempSerial = {}
let tempModel = {}
let isSerialHolderEmpty = true;
let copiedTitle = '';
let polite = true;
$(function () {
$('.maparea').maphilight({
// "strokeColor":"0000ff",
// "strokeWidth":3,
// "fillColor":"ff0000",
// "fillOpacity":0.6
});
});
$("#map area").click(function () {
// var data = $(this).attr("maphilight");
// const data = $(this).mouseout().data('maphilight') || {};
const data = $(this).data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
// console.log(data);
$(this).trigger('alwaysOn.maphilight');
const id = $(this).attr("id");
const gid = $(this).attr("gid");
// console.log(id +" is id");
// console.log('this issss:');
// console.log(this);
if (isSerialHolderEmpty) {
$('#searchText').text('Empty!')
// alert("Курва!!! \n Я пердолни, где серийный номер?");
showNotification('random', 'Где серийный номер?!' , 'danger')
return;
}
if (data.alwaysOn) {
tempDetails.push(details[gid])
console.log('tempDetails is: ', tempDetails);
}
else {
// tempDetails[gid] = false
console.log('else temp: ', tempDetails[gid]);
console.log('else details: ', details[gid]);
var filteredArray = tempDetails.filter(e => e !== details[gid])
console.log('filteredArray is: ', filteredArray);
tempDetails = filteredArray
}
checkDetails()
console.log('my tempDetails are: ', tempDetails);
// console.log('my chnages are: ', tempDetails);
});
$("#Tarakan").click(function () {
const dancers = document.querySelector('.bg-tarakan');
dancers.classList.toggle("show-tarakan");
checkModel(($("#serial").val()), models)
var problem = Object.keys(tempDetails)[0]
$('#titleInput').val(tempModel + ' ' + tempSerial + ' ' + tempDetails[problem][1] + ' ' + "Отказ. тараканы")
const otkaz = tempDetails[problem][1];
tempDetails = []
tempDetails[0] = ['Отказ. тараканы', otkaz]
});
$("#water").click(function () {
var problem = Object.keys(tempDetails)[0]
checkModel(($("#serial").val()), models)
$('#titleInput').val(tempModel + ' ' + tempSerial + ' ' + tempDetails[problem][1] + ' ' + "Отказ. попадание жидкости")
const otkaz = tempDetails[problem][1];
tempDetails = []
tempDetails[0] = ['Отказ. попадание жидкости', otkaz]
// console.log('my chnages are: ', tempDetails);
});
$("#removeFixes").click(function () {
var problem = Object.keys(tempDetails)[0]
checkModel(($("#serial").val()), models)
$('#titleInput').val(tempModel + ' ' + tempSerial + ' ' + tempDetails[problem][1] + ' ' + "")
const otkaz = tempDetails[problem][1];
tempDetails = []
tempDetails[0] = ['', otkaz]
});
$("#cpu").click(function () {
var problem = Object.keys(tempDetails)[0]
checkModel(($("#serial").val()), models)
$('#titleInput').val(tempModel + ' ' + tempSerial + ' ' + tempDetails[problem][1] + ' ' + "Отказ. системная плата")
const otkaz = tempDetails[problem][1];
tempDetails = []
tempDetails[0] = ['Отказ. системная плата', otkaz]
});
$("#conactlessboard").click(function () {
tempDetails.conactlessboard = ["Замена платы ктлц", "Залипает клавиатура"]
checkDetails()
});
checkDetails = () => {
checkModel(($("#serial").val()), models)
console.log('tempDetails is', tempDetails);
for (var prop in tempDetails) {
// object[prop]
if (tempDetails[prop]) {
var firstProblem = (tempDetails[prop][1])
break;
}
}
if (!firstProblem) {
firstProblem = ' '
}
console.log(tempSerial);
if (!tempSerial[0]) {
tempSerial = $("#serial").val();
}
checkModel();
let serial = document.getElementById("serial");
tempSerial = keyboardLayoutSwitch(serial.value)
$("#serial").val(tempSerial);
checkModel(tempSerial, models)
if (!tempModel[0]) {
tempModel = 'Error';
}
$('#titleInput').val(tempModel + ' ' + tempSerial + ' ' + firstProblem + ' ' + makePlusList(tempDetails))
}
$('#copyText').click(function () {
if (isSerialHolderEmpty) {
if (copiedTitle) {
showNotification('Эх...', 'Уже скопировал последние записи: <br>' + copiedTitle, 'danger');
$("#serial").select();
} else {
showNotification('random', 'Пусто же!!!', 'danger')
}
return;
}
if(!tempDetails[0]){
showNotification('random', 'Еще не выбрал неиспра́вность !', 'danger')
return;
}
isSerialHolderEmpty = true;
copiedTitle = $("#titleInput").val();
// if (!polite) {
// showNotification('Заебись', '<i class="fa-solid fa-thumbs-up"></i>' , 'success')
// }else{
// showNotification('Поздравляю', '<i class="fa-solid fa-thumbs-up"></i>' , 'success')
// }
$("#titleInput").select();
document.execCommand('copy');
var problem = Object.keys(tempDetails)[0]
checkModel(($("#serial").val()), models)
const newData = {
model: tempModel,
serialNumber: tempSerial,
problemList: tempDetails[problem][1],
fixList: makePlusList(tempDetails),
date: new Date().toLocaleTimeString()
};
storeLastThreeResultsInVariable(newData);
$('#lastThree').html(createTableFromLastThreeRecords())
saveToLocalStorage();
// var problem = Object.keys(tempDetails)[0]
// checkModel(($("#serial").val()), models)
const newDataUpload = {
'Модель': tempModel,
'Сер.номер': tempSerial,
'Заявленная неисправность': tempDetails[problem][1],
'Произведенная работа': makePlusList(tempDetails).toString(),
'filename': new Date().toLocaleTimeString()
};
console.log(newDataUpload);
// JavaScript code to send a POST request
const url = 'http://' + serverEnv.ip + '/uploadText';
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(newDataUpload)
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
if (!polite) {
showNotification('Заебись Скопирован в буфер обмена', '<i class="fa-solid fa-thumbs-up"></i>', 'success')
} else {
showNotification('Поздравляю Скопирован в буфер обмена', '<i class="fa-solid fa-thumbs-up"></i>', 'success')
}
})
.catch((error) => {
console.error('Error:', error);
if (!polite) {
showNotification('нихуия upload не удалось', '<i class="fa-solid fa-thumbs-dowm"></i>', 'danger')
} else {
showNotification('ошибка upload не удалось', '<i class="fa-solid fa-thumbs-down"></i>', 'danger')
}
});
cleanAll();
// checkDetails();
$("#serial").val('');
$("#serial").select();
});
//testing upload button
// $('#uploadText').click(function () {
// var problem = Object.keys(tempDetails)[0]
// checkModel(($("#serial").val()), models)
// const newData = {
// 'Модель': tempModel,
// 'Сер.номер': tempSerial,
// 'Заявленная неисправность': tempDetails[problem][1],
// 'Произведенная работа': makePlusList(tempDetails).toString(),
// 'filename': new Date().toLocaleTimeString()
// };
// console.log(newData);
// // JavaScript code to send a POST request
// const url = 'http://' + serverEnv.ip + '/uploadText';
// fetch(url, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify(newData)
// })
// .then(response => response.json())
// .then(data => {
// console.log('Success:', data);
// if (!polite) {
// showNotification('Заебись upload', '<i class="fa-solid fa-thumbs-up"></i>', 'success')
// } else {
// showNotification('Поздравляю upload', '<i class="fa-solid fa-thumbs-up"></i>', 'success')
// }
// })
// .catch((error) => {
// console.error('Error:', error);
// if (!polite) {
// showNotification('нихуия upload', '<i class="fa-solid fa-thumbs-dowm"></i>', 'danger')
// } else {
// showNotification('ошибка upload', '<i class="fa-solid fa-thumbs-down"></i>', 'danger')
// }
// });
// });
const makePlusList = (tempDetails) => {
let list = []
for (const key in tempDetails) {
if (Object.hasOwnProperty.call(tempDetails, key)) {
const element = tempDetails[key];
if (element[0]) {
// console.log(key + ' - ' + element[0]);
list.push(element[0])
}
}
}
// console.log("list: ", list);
let newList = ' '
newList = list.join(',').replace(/,/g, ' + ').split();
// console.log("newList: ", newList);
return newList
}
function storeLastThreeResultsInVariable(data) {
// Add the new record to the beginning of the array
lastThreeRecords.unshift(data);
// If the array length exceeds 3, remove the oldest record(s)
if (lastThreeRecords.length > lastThreeRecordslength) {
lastThreeRecords.pop();
}
}
function createTableFromLastThreeRecords() {
const table = document.createElement('table');
// const headerRow = table.insertRow(0);
// const headers = ['Model', 'Serial Number', 'Problem List', 'Fix List', 'Date'];
// Create header cells
// headers.forEach((headerText, index) => {
// const headerCell = document.createElement('th');
// headerCell.textContent = headerText;
// headerRow.appendChild(headerCell);
// });
// Populate the table with the last 3 records
lastThreeRecords.forEach((record) => {
const row = table.insertRow(-1);
// row.className = 'clickable'
Object.values(record).forEach(value => {
const cell = row.insertCell(-1);
cell.textContent = value;
// cell.className = 'clickable';
});
});
return table;
}
function saveToLocalStorage() {
const currentDate = new Date();
currentDate.setUTCHours(currentDate.getUTCHours() + 3);
var problem = Object.keys(tempDetails)[0]
checkModel(($("#serial").val()), models)
const data = {
model: tempModel,
serialNumber: tempSerial,
problemList: tempDetails[problem][1],
fixList: makePlusList(tempDetails),
date: currentDate.toISOString()
};
const key = 'resultsData_' + tempSerial; // Use tempSerialNumber in the key
localStorage.setItem(key, JSON.stringify(data));
console.log('Data saved with key:', key);
}
$('#reset').on('click', () => {
cleanAll();
// checkDetails();
});
const cleanAll = () => {
manualSelectModel = false;
document.getElementById("serial").focus();
$("#serial").select();
tempSerial = {}
var highlightedItems = document.querySelectorAll("#map area");
// console.log(highlightedItems);
highlightedItems.forEach(function (item) {
const dataX = $(item).data('maphilight') || {};
dataX.alwaysOn = false;
// dataX.alwaysOn = !dataX.alwaysOn;
// console.log(data);
$(item).trigger('alwaysOn.maphilight');
});
tempDetails = [];
$('#titleInput').val('Cleaned!')
$('#tablePlace').text('')
$('#tablePlace2').text('')
const dancers = document.querySelector('.bg-tarakan');
dancers.classList.remove("show-tarakan");
}
$('#showStorage').on('click', () => {
var textarea = $('<textarea>'); // Create a new textarea element
$('#history').html(textarea); // Append the textarea to the div
const dataEntries = Object.entries(localStorage).map(([key, value]) => ({ key, value: JSON.parse(value) }));
// Sort the data entries by date in descending order
dataEntries.sort((a, b) => new Date(b.value.date) - new Date(a.value.date));
// Populate the table with the sorted data
dataEntries.forEach(entry => {
if (entry.value.date) {
const xlsxFormat = entry.value.model + ' ' + entry.value.serialNumber + ' ' + entry.value.problemList + ' ' + entry.value.fixList + '\n'
textarea.append(xlsxFormat).attr('rows', '5') // Set the number of rows to 5
.attr('cols', '100'); // Set the number of columns to 50
}
console.log('sorted', entry.value);
});
});
let SerialNumber = document.getElementById("SerialNumber");
SerialNumber.addEventListener("submit", (e) => {
e.preventDefault();
let serial = document.getElementById("serial");
if (serial.value == "") {
// alert("Ensure you input a value in both fields!");
$('#searchText').text('Empty!')
} else {
isSerialHolderEmpty = false;
$('#searchText').text(' Sending ... wait')
$('.form-btn').css('background-color', 'yellow')
console.log(serial.value)
tempSerial = keyboardLayoutSwitch(serial.value)
$("#serial").val(tempSerial);
checkModel(tempSerial, models)
fetchData(keyboardLayoutSwitch(serial.value), 'search2').then(data => {
console.log(data); // The response body
for (var key in data) {
if (data.hasOwnProperty(key)) {
console.dir(data[key]);
$('.repeated').append(buildHtmlTable([data[key]]))
}
}
})
.catch(error => {
console.error(error);
$('#searchText').text(error.message)
$('.form-btn').css('background-color', 'orangered')
});
fetchData(keyboardLayoutSwitch(serial.value), 'searchlive').then(data => {
console.log(data); // The response body
for (var key in data) {
if (data.hasOwnProperty(key)) {
console.dir(data[key]);
$('.repeatedx').append(buildHtmlTable([data[key]]))
}
}
})
.catch(error => {
console.error(error);
$('#searchText').text(error.message)
$('.form-btn').css('background-color', 'orangered')
});
}
});
async function fetchData(serial, location) {
try {
const response = await axios.get(`http://${serverEnv.ip}/${location}?sn=${serial}`);
if (response.statusText === 'OK') {
$('#searchText').text('Search')
$('.form-btn').css('background-color', 'chartreuse')
return response.data;
} else {
throw new Error('Failed to fetch data');
}
} catch (error) {
console.error('Fetch Error:', error);
$('#searchText').text(error.message)
$('.form-btn').css('background-color', 'orangered')
throw error; // Re-throw the error to be caught in the main function
}
}
function buildHtmlTable(arr) {
const table = document.createElement('table');
// const columns = addAllColumnHeaders(arr, table);
const columns = addRowWithoutHeaders(arr, table);
arr.forEach(item => {
const tr = document.createElement('tr');
columns.forEach(column => {
const td = document.createElement('td');
td.appendChild(document.createTextNode(item[column] || ''));
tr.appendChild(td);
});
table.appendChild(tr);
});
return table;
}
function addAllColumnHeaders(arr, table) {
const columnSet = [];
const tr = document.createElement('tr');
arr.forEach(item => {
Object.keys(item).forEach(key => {
if (!columnSet.includes(key)) {
columnSet.push(key);
const th = document.createElement('th');
th.appendChild(document.createTextNode(key));
tr.appendChild(th);
}
});
});
table.appendChild(tr);
return columnSet;
}
function addRowWithoutHeaders(arr, table) {
const columnSet = [];
arr.forEach(item => {
const tr = document.createElement('tr');
Object.values(item).forEach(value => {
const td = document.createElement('td');
td.appendChild(document.createTextNode(value || ''));
tr.appendChild(td);
});
table.appendChild(tr);
});
return columnSet;
}
$("#selectmodel").change(function () {
manualSelectModel = true;
tempModel = document.getElementById("selectmodel").value;
// checkModel(tempSerial, tempModel);
checkDetails()
// console.log(tempSerial, tempModel);
});
const checkModel = (serial, models) => {
// serial.includes("3K"); // true
if (manualSelectModel) {
tempModel = document.getElementById("selectmodel").value;
return;
}
for (const key in models) {
if (Object.hasOwnProperty.call(models, key)) {
const element = models[key];
// console.log(key , element);
length = element.length - 1;
listSerialLength = element[length]
while (length--) {
// if (serial.indexOf(element[length])!=-1) { // search in any part of string
if (serial.startsWith(element[length])) {
console.log('found serial match: ' + key);
// tempModel = key
// console.log('list length is ', listSerialLength);
// console.log('Serial length is ', serial.length);
if (listSerialLength == serial.length) {
tempModel = key
}else if (listSerialLength == '0'){
tempModel = key
} else {
tempModel = 'ERROR'
showNotification('random', 'Не удалось определить модель', 'danger')
}
}
}
}
}
}
$(document).ready(function () {
// your code
$('#version').text(serverEnv.version)
});
let toggle = document.getElementById('m-bar')
let holder = document.getElementById('menu-links')
let btn = document.getElementById('btn')
toggle.addEventListener('click', () => {
if (holder.className === "hidden") {
holder.className = "not-hidden"
btn.className = "not-hidden"
} else {
holder.className = "hidden"
btn.className = "hidden"
}
})
let history = document.getElementById('showStorage')
const historyLable = document.getElementById('history')
const historybtn = document.getElementById('history-lable')
const iconSave = '<i class="fa-solid fa-floppy-disk"></i>'
history.addEventListener('click', () => {
if (historyLable.className === "show") {
historyLable.className = "not-show"
historybtn.innerHTML = iconSave + " Show History"
// btn.className = "not-hidden"
} else {
historyLable.className = "show"
historybtn.innerHTML = iconSave + " Hide History"
}
})
$(".clickable").click(function () {
$(this).toggle();
});
// notification section
let timer1, timer2;
toast = document.querySelector(".toast");
toastIcon = document.getElementById('toastIcon');
(closeIcon = document.querySelector(".close")),
(progress = document.querySelector(".progress"));
msgText1 = document.querySelector(".text-1")
msgText2 = document.querySelector(".text-2")
toastClose = document.querySelector(".toast .close")
toastCheck = document.querySelector(".toast-content .check")
const buttonTest = document.querySelector("buttonTest")
// buttonTest.addEventListener("click", () => { //testing button
// showNotification('Test title', ' Containe messsage here <br>Lorem ipsum, dolor.')
// });
closeIcon.addEventListener("click", () => {
toast.classList.remove("active");
setTimeout(() => {
progress.classList.remove("active");
}, 300);
clearTimeout(timer1);
clearTimeout(timer2);
});
function showNotification(msgTextTitle, msgTextContent, icon) {
clearTimeout(timer1);
clearTimeout(timer2);
if (msgTextTitle === 'random') {
// Array of random messages
if (!polite) {
var randomMessages = ['Ебучий хуекрыл', 'Имбицил блять', 'Хуикрылый пиздоклюв', 'Ебанько', 'Блядокон', 'Сосунище', 'Пидруха', 'Ебаклак', 'Пиздаебище', 'Еблодуй', 'Шлюхочмырь', 'Ты ахуел?', 'Запиздун', 'Гавнодрёп', 'Пиздушенко', 'Пройдоха', 'Пиздаглаз', 'Пиздося', 'Ебучка тухлая', 'Ебалдуй'];
}else{
var randomMessages = ['Уважаемый человек', 'Прошу прошение', 'Извините' , 'Напомним' ,'Хочу напомнить вам' ,'Будьте добры' ,'Пожалуйста' , 'Позвольте извиниться за возможные неудобства', 'Уважаемый собеседник',
'Прошу прощения за мои ошибки',
'Извините за любые неудобства',
'Напоминаю вам об этом важном моменте',
'Хочу напомнить вам о важной информации',
'Будьте добры, предоставить дополнительные пояснения',
'Пожалуйста, примите мои извинения за возможные неудобства'];
}
// Select a random message from the array
var randomIndex = Math.floor(Math.random() * randomMessages.length);
var selectedMessage = randomMessages[randomIndex];
// Set innerHTML of element with id "msg" to the selected message
msgText1.innerHTML = selectedMessage;
}else{
msgText1.innerHTML = msgTextTitle
}
msgText2.innerHTML = msgTextContent
if (icon == 'danger') {
toastIcon.innerHTML = '<i class="fa-solid fa-circle-xmark"></i>'
toastCheck.classList.add("bgRed");
toastClose.classList.add("txtRed");
toastCheck.classList.remove("bgGreen");
toastClose.classList.remove("bgGreen");
} else if (icon == 'success') {
toastIcon.innerHTML = '<i class="fa-solid fa-circle-check"></i>'
toastCheck.classList.add("bgGreen");
toastClose.classList.add("txtGreen");
toastCheck.classList.remove("bgRed");
toastClose.classList.remove("bgRed");
} else {
toastIcon.innerHTML = '<i class="fa-solid fa-circle-info"></i>'
toastCheck.classList.add("bgGreen");
toastClose.classList.add("txtGreen");
toastCheck.classList.remove("bgRed");
toastClose.classList.remove("bgRed");
}
toast.classList.add("active");
progress.classList.add("active");
timer1 = setTimeout(() => {
toast.classList.remove("active");
}, 5000); //1s = 1000 milliseconds
timer2 = setTimeout(() => {
progress.classList.remove("active");
}, 5300);
}

2
static/js/jquery-3.5.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3
static/js/jquery.maphilight.min.js vendored Normal file

File diff suppressed because one or more lines are too long

314
static/js/options.js Normal file
View File

@ -0,0 +1,314 @@
document.addEventListener("DOMContentLoaded", function () {
loadSettings();
});
let lastThreeRecordslength = 2;
function toggleOptionsBox() {
var optionsBox = document.getElementById("options-box");
optionsBox.style.display = optionsBox.style.display === "block" ? "none" : "block";
}
function closeOptionsBox() {
document.getElementById("options-box").style.display = "none";
}
function changeBackgroundColor() {
var color = document.getElementById("background-color").value;
document.body.style.background = color;
}
function changeFontSize() {
var fontSize = document.getElementById("font-size").value;
document.body.style.fontSize = fontSize + "px";
}
function changeLastRecords() {
const last = document.getElementById("last-record-setting").value;
lastThreeRecordslength = last;
}
function toggleTableVisibility() {
var tableList = document.getElementById("lastThree");
var checkbox = document.getElementById("toggleCheckbox");
if (checkbox.checked) {
tableList.classList.add("visible-table");
// tableList.classList.add("hide");
} else {
tableList.classList.remove("visible-table");
// tableList.classList.add("hide");
}
}
function toggleWaitingVisibility() {
var tableList = document.getElementById("topButtonsContainer");
var checkbox = document.getElementById("toggleWaitingCheckbox");
if (checkbox.checked) {
tableList.classList.add("visible-table");
// tableList.classList.add("hide");
} else {
tableList.classList.remove("visible-table");
// tableList.classList.add("hide");
}
}
function toggleFixesVisibility() {
var tableList = document.getElementById("top2ButtonsContainer");
var checkbox = document.getElementById("toggleFixesCheckbox");
if (checkbox.checked) {
tableList.classList.add("visible-table");
// tableList.classList.add("hide");
} else {
tableList.classList.remove("visible-table");
// tableList.classList.add("hide");
}
}
function toggleNotificationUP() {
var toast = document.getElementById("toast");
var checkbox = document.getElementById("toggleNotificationCheckbox");
if (checkbox.checked) {
toast.classList.add("toast-up");
} else {
toast.classList.remove("toast-up");
}
}
function toggleNotificationPolite() {
var checkbox = document.getElementById("togglePoliteCheckbox");
if (checkbox.checked) {
polite = true
} else {
polite = false
}
}
function saveSettings() {
var backgroundColor = document.getElementById("background-color").value;
// var fontSize = document.getElementById("font-size").value;
var toggleCheckbox = document.getElementById("toggleCheckbox").checked;
var toggleWaitingCheckbox = document.getElementById("toggleWaitingCheckbox").checked;
var toggleFixesCheckbox = document.getElementById("toggleFixesCheckbox").checked;
var notificationUP = document.getElementById("toggleNotificationCheckbox").checked;
var lastRecord = document.getElementById("last-record-setting").value;
var polite = document.getElementById("togglePoliteCheckbox").checked;
var settings = {
backgroundColor: backgroundColor,
// fontSize: fontSize,
lastRecord: lastRecord,
toggleCheckbox: toggleCheckbox,
toggleWaitingCheckbox: toggleWaitingCheckbox,
toggleFixesCheckbox: toggleFixesCheckbox,
notificationUP: notificationUP,
polite: polite
};
console.log('settings is object as ', settings);
localStorage.setItem("webpageSettings", JSON.stringify(settings));
}
function clearSettings() {
var settings = {};
localStorage.setItem("webpageSettings", JSON.stringify(settings));
window.location.reload();
}
function loadSettings() {
var settings = JSON.parse(localStorage.getItem("webpageSettings"));
console.log('settings is ', settings);
if (settings) {
if (settings.backgroundColor !== '#000000') {
document.body.style.background = settings.backgroundColor;
}
if (settings.fontSize) {
document.body.style.fontSize = settings.fontSize + "px";
document.getElementById("font-size").value = settings.fontSize;
}
document.getElementById("background-color").value = settings.backgroundColor;
if (settings.lastRecord) {
lastThreeRecordslength = settings.lastRecord;
document.getElementById("last-record-setting").value = settings.lastRecord;
}
// Check if toggleCheckbox setting exists and set its state accordingly
if (settings.hasOwnProperty("toggleCheckbox")) {
document.getElementById("toggleCheckbox").checked = settings.toggleCheckbox;
toggleTableVisibility(); // Call the function to apply visibility based on checkbox state
}
if (settings.hasOwnProperty("toggleWaitingCheckbox")) {
document.getElementById("toggleWaitingCheckbox").checked = settings.toggleWaitingCheckbox;
toggleWaitingVisibility(); // Call the function to apply visibility based on checkbox state
}
if (settings.hasOwnProperty("toggleFixesCheckbox")) {
document.getElementById("toggleFixesCheckbox").checked = settings.toggleFixesCheckbox;
toggleFixesVisibility(); // Call the function to apply visibility based on checkbox state
}
if (settings.hasOwnProperty("notificationUP")) {
document.getElementById("toggleNotificationCheckbox").checked = settings.notificationUP;
toggleNotificationUP(); // Call the function to apply visibility based on checkbox state
}
if (settings.hasOwnProperty("polite")) {
document.getElementById("togglePoliteCheckbox").checked = settings.polite;
toggleNotificationPolite(); // Call the function to apply visibility based on checkbox state
}
}
}
// add buttons script
function addButton() {
var buttonName = document.getElementById("newButtonInput").value;
var optionalButtons = JSON.parse(localStorage.getItem("optionalButtons")) || [];
optionalButtons.push(buttonName);
localStorage.setItem("optionalButtons", JSON.stringify(optionalButtons));
displayButtons();
/* console.log(optionalButtons) */
}
function displayButtons() {
var optionalButtons = JSON.parse(localStorage.getItem("optionalButtons")) || [];
var settingButtonsContainer = document.getElementById("settingButtonsContainer");
var topButtonsContainer = document.getElementById("topButtonsContainer");
// var buttonValuesTextarea = document.getElementById("buttonValues");
settingButtonsContainer.innerHTML = ""; // Clear previous content
topButtonsContainer.innerHTML = ""; // Clear previous content
// buttonValuesTextarea.value = ""; // Clear previous button values
optionalButtons.forEach(function (buttonName) {
var button = document.createElement("button"); // Create button element
button.textContent = buttonName; // Set button text content
button.className = 'additionalInfo'; //style button
var topButton = document.createElement("button"); // Create button element
topButton.textContent = buttonName; // Set button text content
topButton.className = 'additionalInfo'; // style
// Create delete button
var deleteButton = document.createElement("button");
var spaceBetween = document.createElement("br");
deleteButton.textContent = "X"; // Set delete button text content
deleteButton.addEventListener("click", function () {
// Remove button from DOM
settingButtonsContainer.removeChild(button);
topButtonsContainer.removeChild(topButton);
settingButtonsContainer.removeChild(deleteButton);
// Remove button from local storage
optionalButtons.splice(optionalButtons.indexOf(buttonName), 1);
localStorage.setItem("optionalButtons", JSON.stringify(optionalButtons));
// Update button values in textarea
// buttonValuesTextarea.value = optionalButtons.join("\n");
});
// Add click event to display button value in textarea
topButton.addEventListener("click", function () {
// add 5th col on excel as waiting spare parts;
console.log('Waiting for : ', buttonName);
document.getElementById("titleInput").value += ' ' + buttonName;
});
// Append both buttons to container
settingButtonsContainer.appendChild(button);
settingButtonsContainer.appendChild(deleteButton);
settingButtonsContainer.appendChild(spaceBetween);
topButtonsContainer.appendChild(topButton);
});
// Display button values in textarea initially
// buttonValuesTextarea.value = optionalButtons.join("\n");
}
window.onload = function () {
displayButtons();
display2Buttons();
};
// add 2222222222222222222222222222 buttons script
function add2Button() {
var buttonName = document.getElementById("new2ButtonInput").value;
var buttonNote = document.getElementById("new2ButtonNote").value; // Get button note
var optionalButtons = JSON.parse(localStorage.getItem("optional2Buttons")) || [];
optionalButtons.push({ name: buttonName, note: buttonNote }); // Store as an object
localStorage.setItem("optional2Buttons", JSON.stringify(optionalButtons));
display2Buttons();
// console.log(optionalButtons)
}
function display2Buttons() {
var optionalButtons = JSON.parse(localStorage.getItem("optional2Buttons")) || [];
var settingButtonsContainer = document.getElementById("setting2ButtonsContainer");
var topButtonsContainer = document.getElementById("top2ButtonsContainer");
// var buttonValuesTextarea = document.getElementById("buttonValues");
settingButtonsContainer.innerHTML = ""; // Clear previous content
topButtonsContainer.innerHTML = ""; // Clear previous content
// buttonValuesTextarea.value = ""; // Clear previous button values
optionalButtons.forEach(function (button) {
console.log(button);
var buttonElement = document.createElement("button"); // Create button element
buttonElement.textContent = button.name; // Set button text content
// button.textContent = buttonName; // Set button text content
buttonElement.className = 'additional2buttons'; //style button
var topButton = document.createElement("button"); // Create button element
topButton.textContent = button.name; // Set button text content
topButton.className = 'additional2buttons'; // style
// Create delete button
var deleteButton = document.createElement("button");
var spaceBetween = document.createElement("br");
deleteButton.textContent = "X"; // Set delete button text content
deleteButton.addEventListener("click", function () {
// Remove button from DOM
settingButtonsContainer.removeChild(buttonElement);
topButtonsContainer.removeChild(topButton);
settingButtonsContainer.removeChild(deleteButton);
// Remove button from local storage
optionalButtons.splice(optionalButtons.indexOf(button), 1);
localStorage.setItem("optional2Buttons", JSON.stringify(optionalButtons));
// Update button values in textarea
// buttonValuesTextarea.value = optionalButtons.join("\n");
});
// Add click event to display button value in textarea
topButton.addEventListener("click", function () {
// buttonValuesTextarea.value = buttonName;
console.log(` Problem = ${button.name} ,, Fix = ${button.note}`);
tempDetails.push([button.note, button.name]);
checkDetails()
});
// Append both buttons to container
settingButtonsContainer.appendChild(buttonElement);
settingButtonsContainer.appendChild(deleteButton);
settingButtonsContainer.appendChild(spaceBetween);
topButtonsContainer.appendChild(topButton);
});
// Display button values in textarea initially
// buttonValuesTextarea.value = optionalButtons.join("\n");
}

80
static/js/russiankeys.js Normal file
View File

@ -0,0 +1,80 @@
function keyboardLayoutSwitch(stringToConvert) {
var sourceLayout = [
'й',
'ц',
'у',
'к',
'е',
'н',
'г',
'ш',
'щ',
'з',
'х',
'ъ',
'ф',
'ы',
'в',
'а',
'п',
'р',
'о',
'л',
'д',
'ж',
'э',
'я',
'ч',
'с',
'м',
'и',
'т',
'ь',
'б',
'ю'
];
var targetLayout = [
'q',
'w',
'e',
'r',
't',
'y',
'u',
'i',
'o',
'p',
'[',
']',
'a',
's',
'd',
'f',
'g',
'h',
'j',
'k',
'l',
';',
"'",
'z',
'x',
'c',
'v',
'b',
'n',
'm',
',',
'.'
];
for (var index = 0; index < sourceLayout.length; index++) {
const reg = new RegExp(sourceLayout[index], 'mig');
stringToConvert = stringToConvert.replace(reg, function(currentLetter) {
return currentLetter == currentLetter.toLowerCase() ? targetLayout[index] : targetLayout[index].toUpperCase();
});
}
return stringToConvert;
}

View File

@ -3,19 +3,470 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home</title>
<link rel="stylesheet" href="/styles.css">
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/images/favicon/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon/favicon-16x16.png">
<link rel="manifest" href="/images/favicon/site.webmanifest">
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="/images/favicon/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Pax S90">
<meta name="application-name" content="Pax S90">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="msapplication-TileImage" content="/images/favicon/mstile-144x144.png">
<meta name="msapplication-config" content="/images/favicon/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<title>Pax S90</title>
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/nav.css">
<script src="js/jquery-3.5.1.min.js"></script>
<script src="js/jquery.maphilight.min.js"></script>
<script src="js/axios.min.js"></script>
<script src="https://kit.fontawesome.com/e8e55b4ad4.js" crossorigin="anonymous"></script>
<!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
</head>
<body>
<nav>
<div id="toast" class="toast">
<div class="toast-content">
<div id="toastIcon" class="check">
</div>
<div class="message">
<span class="text text-1">Success</span>
<span class="text text-2">Your changes has been saved</span>
</div>
</div>
<i class="fa-solid fa-xmark close"></i>
<!-- Remove 'active' class, this is just to show in Codepen thumbnail -->
<div class="progress"></div>
</div>
<!-- <button class="buttonTest">Show Toast</button> -->
<div class="nav-bar flex">
<div class="first-holder flex">
<a class="logo"> <img src="/images/sv-org-logo.png" height="20"> СЕРВИС-ВОЛГА </a>
<a href="#" id="m-bar"><i class="fas fa-bars hm"></i></a>
</div>
<div id="menu-links" class="hidden">
<ul>
<li><a href="/home">Home</a></li>
<li><a onClick="window.location.reload();" class=" "><i class="fa-solid fa-arrows-rotate"></i> <span
class="hidden-title"> Refresh</span>
</a> </li>
<li><a href="check-serials.html"> <i class="fa-solid fa-list-check"></i><span class="hidden-title">
Check Serials</span> </a></li>
<li><a href="http://192.168.1.6:2150/" target="_blank" rel="noopener noreferrer"> <i
class="fa-solid fa-upload"></i> <span class="hidden-title"> Upload</span></a></li>
<li><a class="options-icon" onclick="toggleOptionsBox()" href="#"><i class="fa-solid fa-gear"> <span
class="hidden-title"> Options</span></i></a>
</li>
<li><a href="">Welcome <%= username %> </a>
</li>
<!-- <li><a href="/home">Home</a></li> -->
<li><a href="/logout">Logout</a></li>
</ul>
<div>
Welcome, <%= username %>!
</div>
</nav>
<h1>Welcome to the Home Page!</h1>
<a id="showStorage" class="nav-btn hidden show">
<div id="history-lable"><i class="fa-solid fa-floppy-disk"></i> Show History</div>
</a>
</div>
<div class="beta"><textarea id="titleInput" class="inputHolder" placeholder="" rows="" cols="" name=""
form=""> </textarea>
<button id="removeFixes" class="btn-remove"> <i class="fa-solid fa-delete-left"></i> </button>
</div>
<div id="lastThree" class="last-records">
</div>
<div id="history"></div>
<div class="buttons">
<select name="model" id="selectmodel" class="serialform modelselect" placeholder="Model">
<option value="S90">S90</option>
<option value="S80">S80</option>
<option value="SP30">SP30</option>
<option value="S200">S200</option>
<option value="S300">S300</option>
<option value="S920">S920</option>
<option value="S900">S900</option>
<option value="A920">A920</option>
<option value="A930">A930</option>
<option value="D200">D200</option>
<option value="D230">D230</option>
<option value="IM20">IM20</option>
<option value="V240m">V240m</option>
<option value="V200t">V200t</option>
<option value="V205c">V205c</option>
<option value="V520">V520</option>
<option value="VX675">VX675</option>
<option value="VX680">VX680</option>
<option value="VX805">VX805</option>
<option value="VX820">VX820</option>
<option value="VX840">VX840</option>
<option value="P400">P400</option>
<option value="PP1000se">PP1000se</option>
</select>
<div>
<form action="" id="SerialNumber" class="serialform">
<!-- <span>SerialNumber: </span> -->
<input type="text" id="serial" class="form-control" placeholder="serial number">
<button class="form-btn" type="submit"> <i class="fa-brands fa-searchengin"></i> <span
id="searchText">Search</span> </button>
</form>
</div>
<div>
<button id="copyText" class="btn copying"><i class="fa-solid fa-copy"></i> Copy & Upload</button>
<!-- <button id="uploadText" class="btn copying"><i class="fa-solid fa-upload"></i> UP</button> -->
<button id="reset" class="btn clean"> <i class="fa-solid fa-delete-left"></i> Clean</button>
</div>
</div>
<div id="tablePlace" class="repeated"> </div>
<div id="tablePlace2" class="repeatedx">
</div>
<div class="additionalButtonsContainer">
<div id="top2ButtonsContainer"></div>
<div id="topButtonsContainer"></div>
</div>
<div>
<img class="bg-tarakan" src="./images/dance.gif">
</div>
<img src="./images/PAX-S90-v0.7.png" usemap="#image-map" class="maparea">
<map name="image-map" id="map">
<!-- ImageReady Slices (PAX-S90-ready-image-ready.psd) -->
<map name="PAX_S90_ready_image_ready_Map">
<area shape="poly" gid="usb" id="usb"
coords="30,406, 31,430, 33,431, 32,463, 27,465, 25,466, 24,470, 24,477, 23,489, 24,502, 26,503, 38,504, 38,511, 15,511, 14,499, 15,495, 14,482, 13,482, 12,467, 8,464, 5,463, 4,461, 4,430, 7,429, 7,406"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="backcase" id="backcase"
coords="489,506, 491,507, 498,508, 500,510, 501,515, 502,517, 503,521, 504,529, 503,600, 501,603, 500,608, 494,611, 482,612, 459,611, 456,607, 455,599, 454,569, 455,524, 456,522, 456,519, 458,517, 459,511, 465,508, 471,507, 470,506, 472,505"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyboard" id="keyboard" coords="358,436,416,487"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printerroller" id="printerroller"
coords="59,76, 64,82, 74,81, 78,80, 213,81, 215,82, 221,83, 229,84, 227,91, 208,92, 73,92, 72,89, 61,90, 56,95, 54,94, 53,90, 53,75"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printerchange" id="printerchange"
coords="230,52, 231,58, 232,60, 233,68, 232,82, 231,84, 231,95, 231,104, 224,104, 223,94, 223,91, 229,90, 229,83, 227,82, 221,83, 216,82, 214,81, 196,80, 143,80, 144,52"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printerclean" id="printerclean" coords="129,25, 136,33, 129,37, 127,36, 125,37, 101,38, 103,39, 138,39, 139,52, 142,52, 142,79, 72,80, 67,82, 62,81, 60,76, 59,74, 57,75, 52,75, 53,97, 59,96, 60,92, 62,91, 63,93, 62,113, 43,112, 42,110, 43,92, 42,88, 43,50, 47,49, 49,48, 92,47, 94,44, 95,39,
93,34, 92,29, 91,28, 89,29,
88,26, 108,25, 122,24"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printercoverused" id="printercoverused"
coords="217,121, 228,127, 234,137, 247,193, 245,208, 143,206, 145,117, 212,120"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="printercovernew" id="printercovernew"
coords="142,117, 142,208, 34,207, 35,194, 36,192, 37,186, 38,172, 39,168, 42,149, 43,147, 48,133, 58,122, 64,121, 68,120, 90,117"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"00ff00","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="Clear"
coords="157,596, 160,598, 161,602, 160,608, 155,612, 145,615, 135,614, 133,613, 127,610, 123,603, 126,597, 128,596, 142,595"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="Cancle"
coords="105,571, 107,574, 108,578, 108,585, 106,586, 104,590, 103,592, 97,597, 84,596, 77,588, 76,586, 75,582, 76,575, 80,571, 103,571"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n0"
coords="161,568, 163,573, 162,579, 155,585, 144,587, 133,586, 125,581, 123,574, 124,569, 129,567"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="Enter"
coords="199,570, 207,571, 210,575, 209,586, 206,592, 204,593, 204,594, 203,593, 200,596, 197,596, 189,595, 187,594, 182,590, 178,581, 177,577, 178,573, 182,570"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n9"
coords="208,539, 214,543, 215,547, 214,553, 209,557, 200,559, 188,558, 186,557, 180,554, 177,548, 178,540, 182,539, 196,538"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n8"
coords="160,539, 163,543, 162,550, 156,556, 143,558, 133,557, 131,556, 124,551, 123,545, 124,541, 127,539, 131,538"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n7"
coords="107,540, 108,543, 109,543, 108,551, 102,557, 92,560, 78,559, 72,554, 71,552, 72,542, 78,539"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n4"
coords="108,512, 109,516, 108,522, 102,528, 92,531, 79,530, 77,529, 72,525, 71,521, 72,514, 74,512, 76,511"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n5"
coords="160,510, 163,516, 162,522, 158,526, 150,529, 146,530, 134,529, 132,528, 125,524, 123,517, 124,512, 128,509"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n6"
coords="210,510, 211,512, 214,513, 215,519, 214,524, 210,528, 197,530, 188,529, 186,528, 181,525, 177,520, 178,512, 183,510"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n3"
coords="211,482, 214,486, 215,492, 208,499, 200,500, 188,499, 181,494, 178,490, 179,483, 181,482, 189,481"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n2"
coords="157,481, 160,481, 161,483, 163,484, 162,493, 156,498, 149,500, 145,501, 134,500, 132,499, 127,496, 123,491, 124,483, 127,481"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="key" id="n1"
coords="107,482, 106,483, 108,485, 109,487, 108,492, 101,499, 92,501, 86,502, 84,501, 77,500, 71,495, 72,484, 75,482, 79,481"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="alpha"
coords="104,447, 108,450, 108,455, 105,460, 101,463, 91,466, 79,465, 72,460, 71,454, 73,449, 78,447, 86,446"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="down"
coords="159,447, 161,450, 163,451, 162,458, 157,463, 147,466, 134,465, 132,464, 125,459, 123,454, 124,449, 126,447, 128,446"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="menu"
coords="207,446, 209,447, 214,451, 215,455, 214,460, 210,464, 197,466, 184,463, 177,455, 178,449, 184,446, 200,445"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="func"
coords="210,417, 214,421, 215,425, 214,430, 210,434, 201,436, 189,435, 187,434, 182,431, 178,426, 178,420, 179,419, 178,418, 179,417, 180,418, 182,417, 188,416"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="up"
coords="153,418, 161,425, 162,428, 163,430, 162,433, 158,436, 151,437, 149,436, 147,437, 131,436, 125,435, 123,428, 128,421, 134,418, 138,417"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="keyC" id="power"
coords="106,417, 108,420, 107,429, 103,432, 97,435, 89,436, 75,433, 72,429, 71,425, 72,421, 75,417, 87,416"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f4" coords="219,364,239,378"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f3" coords="220,339,239,354"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f2" coords="220,315,239,331"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="keyC" id="f1" coords="220,293,239,307"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area gid="plonka" id="plonka" href="#" coords="68,283,138,376" shape="rect"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'>
<area gid="screen" id="screen" href="#" coords="206,283,140,378" shape="rect"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'>
<area shape="poly" gid="newdc" id="newdc"
coords="420,364, 416,391, 410,397, 413,400, 400,409, 360,399, 360,374, 372,361, 372,359, 378,358, 386,354, 419,362"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"00ff00","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="Tarakan" id="Tarakan"
coords="303,521, 305,518, 305,529, 312,530, 313,528, 315,526, 320,519, 314,536, 316,543, 317,543, 322,545, 324,546, 335,551, 341,552, 325,554, 324,559, 326,563, 330,591, 334,602, 337,609, 335,609, 329,596, 326,593, 323,595, 324,605, 319,608, 309,611, 297,605, 292,605,
291,601, 287,617, 287,603,
283,590, 282,573, 282,571, 289,569, 285,559, 281,561, 279,564, 276,565, 276,567, 274,567, 270,566, 273,564, 273,563, 278,560, 278,558, 280,558, 280,557, 287,551, 287,542, 284,530, 283,526, 288,527, 291,527, 281,515, 273,506, 295,524, 299,521, 307,499, 301,523, 303,523"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="circle" gid="water" id="water" coords="395,563,43"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area gid="changesimreader" id="simreader1" target="" alt="right" title="right"
coords="480,315,449,235,378,235,381,306" shape="poly"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area gid="cleansimreader" id="simreader2" target="" alt="left" title="left"
coords="307,231,286,307,377,305,377,232" shape="poly"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"0000ff","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="cpu" id="cpu"
coords="404,189, 423,189, 424,193, 425,197, 426,201, 427,205, 430,215, 431,222, 401,221, 357,220, 329,219, 322,219, 323,208, 324,206, 329,188"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="protection" id="protection"
coords="307,222, 319,225, 317,232, 304,234, 286,292, 282,324, 278,323, 273,314, 272,300, 285,251, 297,220"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="protection" id="protection"
coords="460,228, 469,251, 489,312, 479,325, 478,302, 457,250, 448,236, 438,230, 444,225"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="dcjack" id="dcjack"
coords="478,118, 483,128, 482,139, 481,141, 480,142, 476,143, 474,144, 469,143, 467,142, 464,141, 463,143, 463,144, 462,139, 457,140, 457,141, 456,138, 454,135, 453,129, 454,117"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="batteries" id="batteries"
coords="352,91, 354,92, 360,95, 362,98, 361,110, 349,117, 335,118, 320,117, 314,112, 312,107, 311,104, 310,103, 320,94, 326,91, 334,90"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="batteries2" id="batteries2" coords="400,119, 402,120, 407,121, 413,124, 416,125, 426,134, 428,139, 429,143, 428,155, 426,158, 425,163, 420,170, 412,175, 400,178, 388,179, 384,178, 374,177, 368,174, 359,169, 355,165, 352,161, 351,157, 350,140, 349,138, 349,131, 353,130, 367,121, 371,120,
380,118" data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="buzzer" id="buzzer"
coords="323,148, 324,150, 325,150, 327,153, 328,153, 330,160, 329,171, 321,179, 322,180, 320,182, 303,181, 301,168, 302,165, 300,163, 299,160, 306,152, 311,150, 315,149, 317,148"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="ctls" id="ctls" href="#" coords="49,249,242,470"
data-maphilight='{"strokeColor":"ee0000","strokeWidth":2,"fillColor":"ff0000","fillOpacity":0.4}'
href="#">
<area shape="poly" gid="boardio" id="boardio" href="#"
coords="430,45, 453,83, 463,85, 464,94, 456,98, 458,100, 462,102, 464,104, 475,106, 476,114, 386,117, 363,117, 362,109, 361,96, 352,91, 330,90, 314,98, 311,101, 309,108, 303,107, 292,107, 298,95, 304,89, 308,80, 316,77, 317,65, 313,62, 321,40, 426,41"
data-maphilight='{"strokeColor":"ee0000","strokeWidth":2,"fillColor":"ff0000","fillOpacity":0.4}'>
<area shape="poly" gid="lens" id="lens"
coords="675,42, 680,66, 683,67, 679,91, 682,101, 681,109, 682,117, 683,128, 683,143, 685,165, 601,168, 553,165, 556,86, 556,49, 561,47, 563,40"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="battery_new" id="battery_new"
coords="596,293, 652,294, 690,299, 689,336, 562,335, 558,302, 546,322, 545,328, 536,332, 533,335, 521,323, 528,314, 531,310, 538,310, 556,298, 567,293, 594,293"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="gprs" id="gprs"
coords="696,186, 696,262, 587,261, 546,255, 549,235, 542,232, 556,195"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="chip" id="chip"
coords="659,544, 667,559, 671,548, 712,554, 708,593, 665,587, 664,584, 639,597, 636,594, 620,562, 657,542"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="off" id="off" coords="547,533,606,612"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="charging" id="charging"
coords="653,362, 654,364, 655,372, 659,373, 661,380, 675,381, 674,382, 659,383, 658,388, 654,389, 653,399, 584,398, 583,396, 582,381, 567,381, 568,379, 583,378, 584,362, 586,361"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="bunker" id="bunker" coords="678,433, 690,513, 550,511, 564,430, 664,428"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="mag_change" id="mag_change"
coords="314,424, 310,449, 308,450, 305,470, 302,490, 298,493, 285,489, 283,450, 277,447, 277,422"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="poly" gid="mag_clean" id="mag_clean"
coords="304,350, 306,359, 307,389, 308,389, 309,391, 311,392, 312,398, 313,406, 314,408, 314,421, 276,420, 277,393, 280,392, 282,391, 285,388, 286,385, 285,383, 286,381, 287,351, 288,352, 293,350"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="frontcase_clean" id="frontcase_clean" coords="452,355,477,470"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
<area shape="rect" gid="frontcase_change" id="frontcase_change" coords="478,355,504,470"
data-maphilight='{"strokeColor":"0000ff","strokeWidth":3,"fillColor":"ff0000","fillOpacity":0.6}'
href="#">
</map>
<!-- OPTION TAG -->
<div id="options-box" class="options-box">
<div class="close-btn" onclick="closeOptionsBox()">✖</div>
<h2>Options</h2>
<label for="background-color">Background Color:</label>
<input type="color" id="background-color" onchange="changeBackgroundColor()">
<!-- <br>
<label for="font-size">Font Size (px):</label>
<input type="number" id="font-size" min="10" max="50" onchange="changeFontSize()"> -->
<br>
<hr>
<label for="toggleCheckbox">Последние записи ... Скрыть? </label>
<input type="checkbox" id="toggleCheckbox" onchange="toggleTableVisibility()">
<br>
<label for="font-size">Максимальное количество последних записей :</label>
<input type="number" id="last-record-setting" min="1" max="9" placeholder="2"
onchange="changeLastRecords()">
<br>
<hr>
<label for="toggleWaitingCheckbox">Скрыть кнопки (в ожидание запасных частей) ?</label>
<input type="checkbox" id="toggleWaitingCheckbox" onchange="toggleWaitingVisibility()">
<br>
<label for="newButtonInput">В ожидание :</label>
<input type="text" id="newButtonInput" placeholder="В ожидании крышки принтера">
<br>
<button onclick="addButton()" class="additionalInfo centered">Добавить новую кнопку</button>
<div id="settingButtonsContainer"> </div>
<br>
<hr>
<label for="toggleFixesCheckbox">Скрыть кнопки (доб. неисправность) ?</label>
<input type="checkbox" id="toggleFixesCheckbox" onchange="toggleFixesVisibility()">
<br>
<label for="new2ButtonInput">Заявленная неисправность :</label>
<input type="text" id="new2ButtonInput" placeholder="неисправность">
<br>
<!-- Additional input for button note -->
<label for="new2ButtonNote">Произведенная работа :</label>
<input type="text" id="new2ButtonNote" placeholder="Произведенная работа">
<br>
<button onclick="add2Button()" class="additional2buttons centered">Добавить новую кнопку</button>
<div id="setting2ButtonsContainer"> </div>
<hr>
<label for="toggleNotificationCheckbox">Уведомлени вверх ?</label>
<input type="checkbox" id="toggleNotificationCheckbox" onchange="toggleNotificationUP()">
<br>
<label for="togglePoliteCheckbox">Polite notification ?</label>
<input type="checkbox" id="togglePoliteCheckbox" onchange="toggleNotificationPolite()">
<br>
<br>
<br>
<button class="centered" onclick="saveSettings()">Save Settings</button>
<button onclick="clearSettings()">Clear Settings</button>
</div>
<footer>
<a> Terminal-Diagnostic-Helper <span id="version"></span> © 2024 Ал Омаири Ахмед </a>
<a href="https://github.com/Ahmedhkad/Terminal-Diagnostic-Helper" style="padding-left: 5px;"> <i
class="fa-brands fa-github"> </i> </a>
</footer>
</body>
<script src="js/auth.js"></script>
<script src="js/options.js"></script>
<script src="js/russiankeys.js"></script>
<script src="js/diag.js"></script>
</html>

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="/login-style.css">
<link rel="stylesheet" href="/css/login-style.css">
</head>
<body>
@ -14,7 +14,7 @@
<div class="screen">
<div class="screen__content">
<div class="login-title">
<h3>Terminal Diagnostic Helper</h2>
<h3>Terminal Diagnostic Helper</h3>
<span>v1.0.0</span>
<!-- <p class="login-title"> <br> </p> -->
</div>
@ -43,7 +43,7 @@
<div class="social-login">
<img class="logo" src="/logo.png" alt="" sizes="20px" >
<img class="logo" src="/images/logo.png" alt="" sizes="20px" >
<h3>SERVICE VOLGA</h3>
<div class="social-icons">
<a href="#" class="social-login__icon fab fa-instagram"></a>