All 3 checklists technically function, need final review of verbiage/design still.

This commit is contained in:
Skylar Grant 2026-03-18 15:43:55 -04:00
parent f244957c6e
commit 983724bf08
2 changed files with 49 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/* ITS Thermal Receipt Printer
* Developed by Skylar Grant for MCCS ITS
*/
const version = "1.2.9";
const version = "1.2.10 dev";
// #############################################################
// Variables
// #############################################################
@ -199,6 +199,14 @@ function imagingClistLabsHandler() {
displayPdf(bUrl);
}
function ewasteClistHandler() {
// Grab the User or Host Name value
const imagingHostname = document.getElementById('imagingClistName').value;
const lineArray = prepEwasteClist(imagingHostname);
const bUrl = generateFile(lineArray, false, false);
displayPdf(bUrl);
}
/**
*
* @param {String} password
@ -312,6 +320,27 @@ function prepImagingClistLabs(hostname) {
return lineArray;
}
function prepEwasteClist(hostname) {
const s = strings.ewasteClist;
const now = new Date();
const formattedDate = `Date: ${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}-${now.getFullYear()}`;
/** @type Array<LineItem> */
const lineArray = new Array()
lineArray.push(new LineItem(s.title.text, s.title.fontInfo, false));
lineArray.push(new LineItem(s.sol.text, s.sol.fontInfo, false));
lineArray.push(new LineItem(formattedDate, standard, false));
lineArray.push(new LineItem(`User/Hostname:`, standard, false));
lineArray.push(new LineItem(hostname, standardBold, true));
for (let i = 0; i < s.steps.length; i++) {
const text = s.steps[i];
const newText = `____ ${text}`;
lineArray.push(new LineItem(newText, standard, false));
}
return lineArray;
}
/**
*
* @param {Array<LineItem>} lineArray
@ -468,6 +497,14 @@ document.getElementById('imagingClistLabsBtn').addEventListener('click', () => {
alert(`An error occurred while generating the PDF: ${error.message}`);
}
});
document.getElementById('ewasteClistBtn').addEventListener('click', () => {
try {
ewasteClistHandler();
} catch (error) {
alert(`An error occurred while generating the PDF: ${error.message}`);
}
});
// #############################################################
// Function Calls

View File

@ -157,7 +157,7 @@
<!-- Imaging Checklists -->
<div class="bg-white dark:bg-gray-800 p-5 rounded-lg shadow-lg">
<!-- Title -->
<h1 class="dark:text-gray-300 text-2xl font-bold text-center mb-4">Imaging Checklists</h1>
<h1 class="dark:text-gray-300 text-2xl font-bold text-center mb-4">Asset Management</h1>
<!-- Hostname or Username Field -->
<div class="mb-4">
<label for="imagingClistName" class="dark:text-gray-300 block text-md font-medium text-gray-700">Hostname or Username:</label>
@ -182,6 +182,16 @@
Labs Imaging Checklist
</button>
</div>
<!-- eWaste Checklist Button -->
<div class="text-center">
<button type="submit"
id="ewasteClistBtn"
style="background-color: #4b7839;"
class="dark:bg-indigo-600 dark:hover:bg-indigo-700 w-full text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 mt-4">
eWaste Checklist
</button>
</div>
</div>
</div>