diff --git a/README.md b/README.md index c1ed90a..6220964 100644 --- a/README.md +++ b/README.md @@ -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 ``` \ No newline at end of file diff --git a/package.json b/package.json index 8fff1b8..60e907d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/public/index.html b/public/index.html deleted file mode 100644 index f72aa34..0000000 --- a/public/index.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - Загрузчик файлов - - - - - - - - - - - - - - - - -

- Загрузчик инженерных файлов -
- - Загружаемый файл Excel инженера из папка "Перевод в платные" должен содержать заголовок
( Модель, Сер.номер, Заявленная неисправность, Произведенная работа )
-

- -
-

Перетащите файлы сюда или нажмите, чтобы выбрать

-
- - -
- - - -
- - - - -
- - - -
- -
-
-
- - - - - - - - - - - - - \ No newline at end of file diff --git a/public/js.js b/public/js.js deleted file mode 100644 index 83c4621..0000000 --- a/public/js.js +++ /dev/null @@ -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(); -}); \ No newline at end of file diff --git a/public/style.css b/public/style.css deleted file mode 100644 index d83dd6d..0000000 --- a/public/style.css +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/static/.gitignore b/static/.gitignore new file mode 100644 index 0000000..661aa19 --- /dev/null +++ b/static/.gitignore @@ -0,0 +1,3 @@ +.vscode/settings.json +js/auth.js +manifest.json diff --git a/static/check-serials.html b/static/check-serials.html new file mode 100644 index 0000000..decf344 --- /dev/null +++ b/static/check-serials.html @@ -0,0 +1,102 @@ + + + + + + + Check Serials + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+
+ +

Поиск повторяющихся аппаратов

+ +
+ + +
+ +
+ + + +
+
+ +
+ +

+
+
+    
+ +
+ + +
+ +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/static/login-style.css b/static/css/login-style.css similarity index 100% rename from static/login-style.css rename to static/css/login-style.css diff --git a/static/styles.css b/static/css/login.css similarity index 100% rename from static/styles.css rename to static/css/login.css diff --git a/static/css/nav.css b/static/css/nav.css new file mode 100644 index 0000000..d8ea7d5 --- /dev/null +++ b/static/css/nav.css @@ -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; + } + \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..489029c --- /dev/null +++ b/static/css/style.css @@ -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; +} \ No newline at end of file diff --git a/static/images/PAX-S90-v0.2.png b/static/images/PAX-S90-v0.2.png new file mode 100644 index 0000000..a3af8b1 Binary files /dev/null and b/static/images/PAX-S90-v0.2.png differ diff --git a/static/images/PAX-S90-v0.7.png b/static/images/PAX-S90-v0.7.png new file mode 100644 index 0000000..0da287a Binary files /dev/null and b/static/images/PAX-S90-v0.7.png differ diff --git a/static/images/SV.svg b/static/images/SV.svg new file mode 100644 index 0000000..d8586e9 --- /dev/null +++ b/static/images/SV.svg @@ -0,0 +1,17 @@ + + + + + + + + \ No newline at end of file diff --git a/static/images/dance.gif b/static/images/dance.gif new file mode 100644 index 0000000..8a2b4ab Binary files /dev/null and b/static/images/dance.gif differ diff --git a/static/images/favicon/android-chrome-144x144.png b/static/images/favicon/android-chrome-144x144.png new file mode 100644 index 0000000..7cea34e Binary files /dev/null and b/static/images/favicon/android-chrome-144x144.png differ diff --git a/static/images/favicon/android-chrome-192x192.png b/static/images/favicon/android-chrome-192x192.png new file mode 100644 index 0000000..a85433b Binary files /dev/null and b/static/images/favicon/android-chrome-192x192.png differ diff --git a/static/images/favicon/android-chrome-256x256.png b/static/images/favicon/android-chrome-256x256.png new file mode 100644 index 0000000..2c0e825 Binary files /dev/null and b/static/images/favicon/android-chrome-256x256.png differ diff --git a/static/images/favicon/android-chrome-36x36.png b/static/images/favicon/android-chrome-36x36.png new file mode 100644 index 0000000..1f3c427 Binary files /dev/null and b/static/images/favicon/android-chrome-36x36.png differ diff --git a/static/images/favicon/android-chrome-384x384.png b/static/images/favicon/android-chrome-384x384.png new file mode 100644 index 0000000..d6642dc Binary files /dev/null and b/static/images/favicon/android-chrome-384x384.png differ diff --git a/static/images/favicon/android-chrome-48x48.png b/static/images/favicon/android-chrome-48x48.png new file mode 100644 index 0000000..89a6df1 Binary files /dev/null and b/static/images/favicon/android-chrome-48x48.png differ diff --git a/static/images/favicon/android-chrome-72x72.png b/static/images/favicon/android-chrome-72x72.png new file mode 100644 index 0000000..5dace4a Binary files /dev/null and b/static/images/favicon/android-chrome-72x72.png differ diff --git a/static/images/favicon/android-chrome-96x96.png b/static/images/favicon/android-chrome-96x96.png new file mode 100644 index 0000000..bcb9b4d Binary files /dev/null and b/static/images/favicon/android-chrome-96x96.png differ diff --git a/static/images/favicon/apple-touch-icon-120x120-precomposed.png b/static/images/favicon/apple-touch-icon-120x120-precomposed.png new file mode 100644 index 0000000..b1e7959 Binary files /dev/null and b/static/images/favicon/apple-touch-icon-120x120-precomposed.png differ diff --git a/static/images/favicon/apple-touch-icon-120x120.png b/static/images/favicon/apple-touch-icon-120x120.png new file mode 100644 index 0000000..9bc76e5 Binary files /dev/null and b/static/images/favicon/apple-touch-icon-120x120.png differ diff --git a/static/images/favicon/apple-touch-icon-152x152-precomposed.png b/static/images/favicon/apple-touch-icon-152x152-precomposed.png new file mode 100644 index 0000000..b0078e0 Binary files /dev/null and b/static/images/favicon/apple-touch-icon-152x152-precomposed.png differ diff --git a/static/images/favicon/apple-touch-icon-152x152.png b/static/images/favicon/apple-touch-icon-152x152.png new file mode 100644 index 0000000..19c2f61 Binary files /dev/null and b/static/images/favicon/apple-touch-icon-152x152.png differ diff --git a/static/images/favicon/apple-touch-icon-180x180-precomposed.png b/static/images/favicon/apple-touch-icon-180x180-precomposed.png new file mode 100644 index 0000000..2cce21d Binary files /dev/null and b/static/images/favicon/apple-touch-icon-180x180-precomposed.png differ diff --git a/static/images/favicon/apple-touch-icon-180x180.png b/static/images/favicon/apple-touch-icon-180x180.png new file mode 100644 index 0000000..b4308db Binary files /dev/null and b/static/images/favicon/apple-touch-icon-180x180.png differ diff --git a/static/images/favicon/apple-touch-icon-60x60-precomposed.png b/static/images/favicon/apple-touch-icon-60x60-precomposed.png new file mode 100644 index 0000000..b6bd854 Binary files /dev/null and b/static/images/favicon/apple-touch-icon-60x60-precomposed.png differ diff --git a/static/images/favicon/apple-touch-icon-60x60.png b/static/images/favicon/apple-touch-icon-60x60.png new file mode 100644 index 0000000..69cdbe3 Binary files /dev/null and b/static/images/favicon/apple-touch-icon-60x60.png differ diff --git a/static/images/favicon/apple-touch-icon-76x76-precomposed.png b/static/images/favicon/apple-touch-icon-76x76-precomposed.png new file mode 100644 index 0000000..7af173f Binary files /dev/null and b/static/images/favicon/apple-touch-icon-76x76-precomposed.png differ diff --git a/static/images/favicon/apple-touch-icon-76x76.png b/static/images/favicon/apple-touch-icon-76x76.png new file mode 100644 index 0000000..34459dd Binary files /dev/null and b/static/images/favicon/apple-touch-icon-76x76.png differ diff --git a/static/images/favicon/apple-touch-icon-precomposed.png b/static/images/favicon/apple-touch-icon-precomposed.png new file mode 100644 index 0000000..2cce21d Binary files /dev/null and b/static/images/favicon/apple-touch-icon-precomposed.png differ diff --git a/static/images/favicon/apple-touch-icon.png b/static/images/favicon/apple-touch-icon.png new file mode 100644 index 0000000..b4308db Binary files /dev/null and b/static/images/favicon/apple-touch-icon.png differ diff --git a/static/images/favicon/browserconfig.xml b/static/images/favicon/browserconfig.xml new file mode 100644 index 0000000..46850d9 --- /dev/null +++ b/static/images/favicon/browserconfig.xml @@ -0,0 +1,10 @@ + + + + + + + #00aba9 + + + diff --git a/static/images/favicon/favicon-16x16.png b/static/images/favicon/favicon-16x16.png new file mode 100644 index 0000000..b40aa6e Binary files /dev/null and b/static/images/favicon/favicon-16x16.png differ diff --git a/static/images/favicon/favicon-32x32.png b/static/images/favicon/favicon-32x32.png new file mode 100644 index 0000000..9a76c73 Binary files /dev/null and b/static/images/favicon/favicon-32x32.png differ diff --git a/static/images/favicon/favicon.ico b/static/images/favicon/favicon.ico new file mode 100644 index 0000000..ddd0903 Binary files /dev/null and b/static/images/favicon/favicon.ico differ diff --git a/static/images/favicon/mstile-144x144.png b/static/images/favicon/mstile-144x144.png new file mode 100644 index 0000000..7cea34e Binary files /dev/null and b/static/images/favicon/mstile-144x144.png differ diff --git a/static/images/favicon/mstile-150x150.png b/static/images/favicon/mstile-150x150.png new file mode 100644 index 0000000..9b89aee Binary files /dev/null and b/static/images/favicon/mstile-150x150.png differ diff --git a/static/images/favicon/mstile-310x310.png b/static/images/favicon/mstile-310x310.png new file mode 100644 index 0000000..17d8386 Binary files /dev/null and b/static/images/favicon/mstile-310x310.png differ diff --git a/static/images/favicon/safari-pinned-tab.svg b/static/images/favicon/safari-pinned-tab.svg new file mode 100644 index 0000000..8b98668 --- /dev/null +++ b/static/images/favicon/safari-pinned-tab.svg @@ -0,0 +1,43 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + + + + diff --git a/static/images/favicon/site.webmanifest b/static/images/favicon/site.webmanifest new file mode 100644 index 0000000..cc9ab84 --- /dev/null +++ b/static/images/favicon/site.webmanifest @@ -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" +} diff --git a/static/logo.png b/static/images/logo.png similarity index 100% rename from static/logo.png rename to static/images/logo.png diff --git a/static/images/sv-org-logo.png b/static/images/sv-org-logo.png new file mode 100644 index 0000000..085d471 Binary files /dev/null and b/static/images/sv-org-logo.png differ diff --git a/static/images/tarkan.png b/static/images/tarkan.png new file mode 100644 index 0000000..2e86a9a Binary files /dev/null and b/static/images/tarkan.png differ diff --git a/static/index2.html b/static/index2.html new file mode 100644 index 0000000..079512a --- /dev/null +++ b/static/index2.html @@ -0,0 +1,468 @@ + + + + + + + + + + + + + + + + + + + + + Pax S90 + + + + + + + + + + + + + + +
+ +
+
+ +
+ + +
+ Success + Your changes has been saved +
+
+ + + +
+
+ + + + + +
+ +
+
+
+
+ + +
+ + +
+
+ + + +
+
+
+ + + +
+
+ +
+ +
+ +
+ +
+
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + right + left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Options

+ + + + +
+
+ + +
+ + + + +
+ +
+ + +
+ + +
+ +
+
+ +
+ + +
+ + + +
+ + + +
+ +
+
+ + +
+ + +
+
+
+ + + + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/static/js/auth_example.js b/static/js/auth_example.js new file mode 100644 index 0000000..e5f202a --- /dev/null +++ b/static/js/auth_example.js @@ -0,0 +1,4 @@ + const serverEnv = { + "ip" : "192.168.1.100:80", + "version" : "v0.1.1" +} \ No newline at end of file diff --git a/static/js/axios.min.js b/static/js/axios.min.js new file mode 100644 index 0000000..8554d48 --- /dev/null +++ b/static/js/axios.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,(function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:{},a=i.allOwnKeys,s=void 0!==a&&a;if(null!=t)if("object"!==e(t)&&(t=[t]),p(t))for(r=0,o=t.length;r0;)if(t===(n=r[o]).toLowerCase())return n;return null}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=function(e){return!h(e)&&e!==N};var x,P=(x="undefined"!=typeof Uint8Array&&c(Uint8Array),function(e){return x&&e instanceof x}),k=l("HTMLFormElement"),U=function(e){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),_=l("RegExp"),F=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};T(n,(function(n,o){!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},B="abcdefghijklmnopqrstuvwxyz",L="0123456789",D={DIGIT:L,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+L};var I=l("AsyncFunction"),q={isArray:p,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t;return e&&("function"==typeof FormData&&e instanceof FormData||v(e.append)&&("formdata"===(t=f(e))||"object"===t&&v(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer)},isString:y,isNumber:b,isBoolean:function(e){return!0===e||!1===e},isObject:g,isPlainObject:w,isUndefined:h,isDate:E,isFile:O,isBlob:S,isRegExp:_,isFunction:v,isStream:function(e){return g(e)&&v(e.pipe)},isURLSearchParams:A,isTypedArray:P,isFileList:R,forEach:T,merge:function e(){for(var t=C(this)&&this||{},n=t.caseless,r={},o=function(t,o){var i=n&&j(r,o)||o;w(r[i])&&w(t)?r[i]=e(r[i],t):w(t)?r[i]=e({},t):p(t)?r[i]=t.slice():r[i]=t},i=0,a=arguments.length;i3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return T(t,(function(t,r){n&&v(t)?e[r]=a(t,n):e[r]=t}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:l,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(p(e))return e;var t=e.length;if(!b(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:k,hasOwnProperty:U,hasOwnProp:U,reduceDescriptors:F,freezeMethods:function(e){F(e,(function(t,n){if(v(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=e[n];v(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:j,global:N,isContextDefined:C,ALPHABET:D,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.ALPHA_DIGIT,n="",r=t.length;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(n,r){if(g(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;var o=p(n)?[]:{};return T(n,(function(t,n){var i=e(t,r+1);!h(i)&&(o[n]=i)})),t[r]=void 0,o}}return n}(e,0)},isAsyncFn:I,isThenable:function(e){return e&&(g(e)||v(e))&&v(e.then)&&v(e.catch)}};function M(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}q.inherits(M,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var z=M.prototype,H={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){H[e]={value:e}})),Object.defineProperties(M,H),Object.defineProperty(z,"isAxiosError",{value:!0}),M.from=function(e,t,n,r,o,i){var a=Object.create(z);return q.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),M.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function J(e){return q.isPlainObject(e)||q.isArray(e)}function W(e){return q.endsWith(e,"[]")?e.slice(0,-2):e}function K(e,t,n){return e?e.concat(t).map((function(e,t){return e=W(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var V=q.toFlatObject(q,{},null,(function(e){return/^is[A-Z]/.test(e)}));function G(t,n,r){if(!q.isObject(t))throw new TypeError("target must be an object");n=n||new FormData;var o=(r=q.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!q.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,s=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&q.isSpecCompliantForm(n);if(!q.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(q.isDate(e))return e.toISOString();if(!u&&q.isBlob(e))throw new M("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(e)||q.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(t,r,i){var u=t;if(t&&!i&&"object"===e(t))if(q.endsWith(r,"{}"))r=o?r:r.slice(0,-2),t=JSON.stringify(t);else if(q.isArray(t)&&function(e){return q.isArray(e)&&!e.some(J)}(t)||(q.isFileList(t)||q.endsWith(r,"[]"))&&(u=q.toArray(t)))return r=W(r),u.forEach((function(e,t){!q.isUndefined(e)&&null!==e&&n.append(!0===s?K([r],t,a):null===s?r:r+"[]",c(e))})),!1;return!!J(t)||(n.append(K(i,r,a),c(t)),!1)}var l=[],d=Object.assign(V,{defaultVisitor:f,convertValue:c,isVisitable:J});if(!q.isObject(t))throw new TypeError("data must be an object");return function e(t,r){if(!q.isUndefined(t)){if(-1!==l.indexOf(t))throw Error("Circular reference detected in "+r.join("."));l.push(t),q.forEach(t,(function(t,o){!0===(!(q.isUndefined(t)||null===t)&&i.call(n,t,q.isString(o)?o.trim():o,r,d))&&e(t,r?r.concat(o):[o])})),l.pop()}}(t),n}function $(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&G(e,this,t)}var Q=X.prototype;function Z(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,n){if(!t)return e;var r,o=n&&n.encode||Z,i=n&&n.serialize;if(r=i?i(t,n):q.isURLSearchParams(t)?t.toString():new X(t,n).toString(o)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}Q.append=function(e,t){this._pairs.push([e,t])},Q.toString=function(e){var t=e?function(t){return e.call(this,t,$)}:$;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ee,te=function(){function e(){t(this,e),this.handlers=[]}return r(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){q.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:("undefined"==typeof navigator||"ReactNative"!==(ee=navigator.product)&&"NativeScript"!==ee&&"NS"!==ee)&&"undefined"!=typeof window&&"undefined"!=typeof document,isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function oe(e){function t(e,n,r,o){var i=e[o++],a=Number.isFinite(+i),s=o>=e.length;return i=!i&&q.isArray(r)?r.length:i,s?(q.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&q.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&q.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t-1,i=q.isObject(e);if(i&&q.isHTMLForm(e)&&(e=new FormData(e)),q.isFormData(e))return o&&o?JSON.stringify(oe(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new re.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return re.isNode&&q.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=q.isFileList(e))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return G(n?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(q.isString(e))try{return(t||JSON.parse)(e),q.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ae.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&q.isString(e)&&(n&&!this.responseType||r)){var o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw M.from(e,M.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:re.classes.FormData,Blob:re.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};q.forEach(["delete","get","head"],(function(e){ae.headers[e]={}})),q.forEach(["post","put","patch"],(function(e){ae.headers[e]=q.merge(ie)}));var se=ae,ue=q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ce=Symbol("internals");function fe(e){return e&&String(e).trim().toLowerCase()}function le(e){return!1===e||null==e?e:q.isArray(e)?e.map(le):String(e)}function de(e,t,n,r,o){return q.isFunction(r)?r.call(this,t,n):(o&&(t=n),q.isString(t)?q.isString(r)?-1!==t.indexOf(r):q.isRegExp(r)?r.test(t):void 0:void 0)}var pe=function(e,n){function i(e){t(this,i),e&&this.set(e)}return r(i,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=fe(t);if(!o)throw new Error("header name must be a non-empty string");var i=q.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=le(e))}var i,a,s,u,c,f=function(e,t){return q.forEach(e,(function(e,n){return o(e,n,t)}))};return q.isPlainObject(e)||e instanceof this.constructor?f(e,t):q.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?f((c={},(i=e)&&i.split("\n").forEach((function(e){u=e.indexOf(":"),a=e.substring(0,u).trim().toLowerCase(),s=e.substring(u+1).trim(),!a||c[a]&&ue[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&o(t,e,n),this}},{key:"get",value:function(e,t){if(e=fe(e)){var n=q.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(q.isFunction(t))return t.call(this,r,n);if(q.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=fe(e)){var n=q.findKey(this,e);return!(!n||void 0===this[n]||t&&!de(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=fe(e)){var o=q.findKey(n,e);!o||t&&!de(0,n[o],o,t)||(delete n[o],r=!0)}}return q.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!de(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return q.forEach(this,(function(r,o){var i=q.findKey(n,o);if(i)return t[i]=le(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=le(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r1?n-1:0),o=1;o0;){var a=o[i],s=n[a];if(s){var u=t[a],c=void 0===u||s(u,a,t);if(!0!==c)throw new M("option "+a+" must be "+c,M.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new M("Unknown option "+a,M.ERR_BAD_OPTION)}},validators:Ce},ke=Pe.validators,Ue=function(){function e(n){t(this,e),this.defaults=n,this.interceptors={request:new te,response:new te}}return r(e,[{key:"request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n,r=t=je(this.defaults,t),o=r.transitional,i=r.paramsSerializer,a=r.headers;void 0!==o&&Pe.assertOptions(o,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=i&&(q.isFunction(i)?t.paramsSerializer={serialize:i}:Pe.assertOptions(i,{encode:ke.function,serialize:ke.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),(n=a&&q.merge(a.common,a[t.method]))&&q.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete a[e]})),t.headers=he.concat(n,a);var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,f=[];this.interceptors.response.forEach((function(e){f.push(e.fulfilled,e.rejected)}));var l,d=0;if(!u){var p=[Ae.bind(this),void 0];for(p.unshift.apply(p,s),p.push.apply(p,f),l=p.length,c=Promise.resolve(t);d0;)o._listeners[t](e);o._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){o.subscribe(e),t=e})).then(e);return n.cancel=function(){o.unsubscribe(t)},n},n((function(e,t,n){o.reason||(o.reason=new ve(e,t,n),r(o.reason))}))}return r(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var Be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Be).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];Be[r]=n}));var Le=Be;var De=function e(t){var n=new _e(t),r=a(_e.prototype.request,n);return q.extend(r,_e.prototype,n,{allOwnKeys:!0}),q.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(je(t,n))},r}(se);return De.Axios=_e,De.CanceledError=ve,De.CancelToken=Fe,De.isCancel=ye,De.VERSION=Ne,De.toFormData=G,De.AxiosError=M,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return q.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=je,De.AxiosHeaders=he,De.formToJSON=function(e){return oe(q.isHTMLForm(e)?new FormData(e):e)},De.HttpStatusCode=Le,De.default=De,De})); +//# sourceMappingURL=axios.min.js.map diff --git a/static/js/check.js b/static/js/check.js new file mode 100644 index 0000000..bdf4a7c --- /dev/null +++ b/static/js/check.js @@ -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('МодельСер.номерЗаявленная неисправностьПроизведенная работаФайлСервер') + + 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('error ! No answer from server , try again or ask Ahmed ! '+error.code+' ') + + $('#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(''+data.Model+''+data.SerialNumber+' '+data.Problem+' '+ data.Details +' '+data.filename+''+statusText+' ') + + 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(' ОК '+sn+'Серийный номер не найден в БД '+statusText+' ') + + + } + +} + + + + +$(document).ready(function(){ + // your code + $('#version').text(serverEnv.version) + }); diff --git a/static/js/diag.js b/static/js/diag.js new file mode 100644 index 0000000..48c93fa --- /dev/null +++ b/static/js/diag.js @@ -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('Эх...', 'Уже скопировал последние записи:
' + copiedTitle, 'danger'); + $("#serial").select(); + } else { + showNotification('random', 'Пусто же!!!', 'danger') + } + return; + } + + if(!tempDetails[0]){ + showNotification('random', 'Еще не выбрал неиспра́вность !', 'danger') + return; + } + isSerialHolderEmpty = true; + + copiedTitle = $("#titleInput").val(); + // if (!polite) { + // showNotification('Заебись', '' , 'success') + // }else{ + // showNotification('Поздравляю', '' , '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('Заебись Скопирован в буфер обмена', '', 'success') + } else { + showNotification('Поздравляю Скопирован в буфер обмена', '', 'success') + } + }) + .catch((error) => { + console.error('Error:', error); + if (!polite) { + showNotification('нихуия upload не удалось', '', 'danger') + } else { + showNotification('ошибка upload не удалось', '', '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', '', 'success') +// } else { +// showNotification('Поздравляю upload', '', 'success') +// } +// }) +// .catch((error) => { +// console.error('Error:', error); +// if (!polite) { +// showNotification('нихуия upload', '', 'danger') +// } else { +// showNotification('ошибка upload', '', '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 = $('",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0';var i=t.firstChild;return i.style.behavior="url(#default#VML)",!i||"object"==typeof i.adj}(),c||l){if(c){e=function(t){return Math.max(0,Math.min(parseInt(t,16),255))},v=function(t,i){return"rgba("+e(t.substr(0,2))+","+e(t.substr(2,2))+","+e(t.substr(4,2))+","+i+")"},f=function(t){var i=d('').get(0);return i.getContext("2d").clearRect(0,0,d(t).width(),d(t).height()),i};function b(t,e,a,o,r){if(o=o||0,r=r||0,t.beginPath(),"rect"==e)t.rect(a[0]+o,a[1]+r,a[2]-a[0],a[3]-a[1]);else if("poly"==e)for(t.moveTo(a[0]+o,a[1]+r),i=2;i').get(0)},p=function(t,i,e,a,o){var r,s,n,h;for(var l in e)e[l]=parseInt(e[l],10);r='',s=a.stroke?'strokeweight="'+a.strokeWidth+'" stroked="t" strokecolor="#'+a.strokeColor+'"':'stroked="f"',n='',"rect"==i?h=d(''):"poly"==i?h=d(''):"circ"==i&&(h=d('')),h.get(0).innerHTML=r+n,d(t).append(h)},u=function(t){var i=d("
"+t.innerHTML+"
");i.children("[name=highlighted]").remove(),d(t).html(i.html())};g=function(t){var i,e,a=(t.getAttribute("shape")||"rect").toLowerCase().substr(0,4);if("defa"!==a){for(e=(t.getAttribute("coords")||"").split(","),i=0;i").css({display:"block",background:'url("'+this.src+'")',"background-size":"contain","background-repeat":"no-repeat",position:"relative",padding:0,width:this.width,height:this.height}),r.wrapClass&&(!0===r.wrapClass?t.addClass(d(this).attr("class")):t.addClass(r.wrapClass)),e.before(t).css("opacity",1e-10).css(m).remove(),l&&e.css("filter","Alpha(opacity=0)"),t.append(e),n=f(this),d(n).css(m),n.height=this.height,n.width=this.width,d(s).bind("alwaysOn.maphilight",function(){a&&u(a),c||d(n).empty(),d(s).find("area[coords]").each(function(){var t,i;if((i=y(this,r)).alwaysOn){if(!a&&c&&(a=f(e[0]),d(a).css(m),a.width=e[0].width,a.height=e[0].height,e.before(a)),i.fade=i.alwaysOnFade,!(t=g(this)))return;p(c?a:n,t[0],t[1],i,"")}})}).trigger("alwaysOn.maphilight").bind("mouseover.maphilight focusin.maphilight",function(t){var i,e,a=t.target;if(!(e=y(a,r)).neverOn&&!e.alwaysOn){if(!(i=g(a)))return;if(p(n,i[0],i[1],e,"highlighted"),e.groupBy){"string"==typeof e.groupBy&&(e.groupBy=[e.groupBy]);var o=d(this);d.each(e.groupBy,function(t,i){var e;e=/^[a-zA-Z][\-a-zA-Z]+$/.test(i)?s.find("area["+i+'="'+o.attr(i)+'"]'):s.find(i);var a=this;e.each(function(){if(this!=a){var t=y(this,r);if(!t.neverOn&&!t.alwaysOn){var i=g(this);p(n,i[0],i[1],t,"highlighted")}}})})}c||d(n).append("")}}).bind("mouseout.maphilight focusout.maphilight",function(t){u(n)}),e.before(n),e.addClass("maphilighted")}})},d.fn.maphilight.defaults={fill:!0,fillColor:"000000",fillOpacity:.2,stroke:!0,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:!0,alwaysOn:!1,neverOn:!1,groupBy:!1,wrapClass:!0,shadow:!1,shadowX:0,shadowY:0,shadowRadius:6,shadowColor:"000000",shadowOpacity:.8,shadowPosition:"outside",shadowFrom:!1}}else d.fn.maphilight=function(){return this}}); \ No newline at end of file diff --git a/static/js/options.js b/static/js/options.js new file mode 100644 index 0000000..6428f17 --- /dev/null +++ b/static/js/options.js @@ -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"); +} + + diff --git a/static/js/russiankeys.js b/static/js/russiankeys.js new file mode 100644 index 0000000..e9df4c6 --- /dev/null +++ b/static/js/russiankeys.js @@ -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; +} diff --git a/views/home.ejs b/views/home.ejs index 0d27c0d..baea860 100644 --- a/views/home.ejs +++ b/views/home.ejs @@ -3,19 +3,470 @@ - Home - + + + + + + + + + + + + + + + Pax S90 + + + + + + + + + + + - -

Welcome to the Home Page!

+ + + +
+ + + + + + +
+ +
+
+
+
+ + +
+ + +
+
+ + + +
+
+
+ + + +
+
+ +
+ +
+ +
+ +
+
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + right + left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

Options

+ + + + +
+
+ + +
+ + + + +
+ +
+ + +
+ + +
+ +
+
+ +
+ + +
+ + + +
+ + + +
+ +
+
+ + +
+ + +
+
+
+ + + + + +
+ + + + + + + + diff --git a/views/login.ejs b/views/login.ejs index 88846e9..1fe23ca 100644 --- a/views/login.ejs +++ b/views/login.ejs @@ -4,7 +4,7 @@ Login - + @@ -14,7 +14,7 @@
@@ -43,7 +43,7 @@