From f244957c6eebe6a8ababed7230916270a6d5e004 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 18 Mar 2026 15:03:08 -0400 Subject: [PATCH] Add imaging checklist, start adding ewaste clist --- src/assets/ITThermal.js | 125 +++++++++++++++++++++++++++++++++++++++- src/index.html | 30 ++++++++++ 2 files changed, 154 insertions(+), 1 deletion(-) diff --git a/src/assets/ITThermal.js b/src/assets/ITThermal.js index e76f6ae..81b9be3 100644 --- a/src/assets/ITThermal.js +++ b/src/assets/ITThermal.js @@ -73,6 +73,54 @@ const strings = { user: {text: 'User:', fontInfo: standard}, serviceType: {text: 'Service Type:', fontInfo: standard}, notes: {text: 'Notes:', fontInfo: standard} + }, + imagingClistStaff: { + title: { text: '(Re)Imaging Checklist', fontInfo: standardBold }, + subtitle: { text: 'Staff', fontInfo: standardBold }, + sol: { text: 'See SOL-411 for procedure details.', fontInfo: standard }, + steps: [ + 'Physically clean device', + 'Create software inventory & identify image/software needs', + 'Verify OneDrive setup & migrate user data', + 'Attach software inventory to ticket & confirm with user', + 'Remove old drive, label with hostname/date, retain; install new drive', + 'PXE boot; enter image code; name machine per SOL-279', + 'Request removal of old hostname', + 'Wait & verify post-deploy status in OS Deployer', + 'Verify post-deployment finished', + 'Verify device assignment in ME/SD Asset module', + 'Record machine SN/ST', + 'Confirm data, printers, drives, LAN login, and wireless access with user', + 'Transfer ticket to Region Manager for stock request', + ] + }, + imagingClistLabs: { + title: { text: '(Re)Imaging Checklist', fontInfo: standardBold }, + subtitle: { text: 'Labs', fontInfo: standardBold }, + sol: { text: 'See SOL-411 for procedure details.', fontInfo: standard }, + steps: [ + 'Physically clean device', + 'Verify Lab Image', + 'PXE boot; enter image code; name machine per SOL-279', + 'Request removal of old hostname', + 'Verify post-deployment finished', + 'Run EC inventory scan', + 'Verify device assignment in ME/SD Asset module', + 'Record machine SN/ST', + 'Confirm data, printers connectivity', + ] + }, + ewasteClist: { + title: { text: 'eWaste Checklist', fontInfo: standardBold }, + sol: { text: 'See SOL-??? for procedure details.', fontInfo: standard }, + steps: [ + 'Verify all peripherals are removed from the device', + 'Remove; label; and retain any storage media', + 'Remove any asset tags from the device', + 'Mark asset Disposed in ME/SD if applicable', + 'Place device in eWaste bin', + 'If bin is full, contact Region Manager to schedule pick-up' + ] } } @@ -135,6 +183,22 @@ function deviceTrackerHandler() { displayPdf(bUrl); } +function imagingClistStaffHandler() { + // Grab the User or Host Name value + const imagingHostname = document.getElementById('imagingClistName').value; + const lineArray = prepImagingClistStaff(imagingHostname); + const bUrl = generateFile(lineArray, false, false); + displayPdf(bUrl); +} + +function imagingClistLabsHandler() { + // Grab the User or Host Name value + const imagingHostname = document.getElementById('imagingClistName').value; + const lineArray = prepImagingClistLabs(imagingHostname); + const bUrl = generateFile(lineArray, false, false); + displayPdf(bUrl); +} + /** * * @param {String} password @@ -204,6 +268,50 @@ function prepDeviceTracker(dtTicketNumber, dtUser, dtService, dtNotes) { return lineArray; }; +function prepImagingClistStaff(hostname) { + const s = strings.imagingClistStaff; + const now = new Date(); + const formattedDate = `Date: ${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}-${now.getFullYear()}`; + /** @type Array */ + const lineArray = new Array(); + lineArray.push(new LineItem(s.title.text, s.title.fontInfo, false)); + lineArray.push(new LineItem(s.subtitle.text, s.subtitle.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; +} + +function prepImagingClistLabs(hostname) { + const s = strings.imagingClistLabs; + const now = new Date(); + const formattedDate = `Date: ${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}-${now.getFullYear()}`; + /** @type Array */ + const lineArray = new Array() + lineArray.push(new LineItem(s.title.text, s.title.fontInfo, false)); + lineArray.push(new LineItem(s.subtitle.text, s.subtitle.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} lineArray @@ -226,6 +334,8 @@ function generateFile(lineArray, header, footer) { if (header) { doc.addImage(headerImageUri, headerImageType, 0, 0, logoWidthMm, logoHeightMm); currentPos += logoHeightMm + ( verticalSpacing * 2); + } else { + currentPos =+ verticalSpacing; } @@ -337,7 +447,6 @@ document.getElementById('genPassword').addEventListener('click', () => { alert(`An error occurred while generating the PDF: ${error.message}`); } }); - document.getElementById('deviceTrackerBtn').addEventListener('click', () => { try { deviceTrackerHandler(); @@ -345,6 +454,20 @@ document.getElementById('deviceTrackerBtn').addEventListener('click', () => { alert(`An error occurred while generating the PDF: ${error.message}`); } }); +document.getElementById('imagingClistStaffBtn').addEventListener('click', () => { + try { + imagingClistStaffHandler(); + } catch (error) { + alert(`An error occurred while generating the PDF: ${error.message}`); + } +}); +document.getElementById('imagingClistLabsBtn').addEventListener('click', () => { + try { + imagingClistLabsHandler(); + } catch (error) { + alert(`An error occurred while generating the PDF: ${error.message}`); + } +}); // ############################################################# // Function Calls diff --git a/src/index.html b/src/index.html index d31a3c5..ab422f2 100644 --- a/src/index.html +++ b/src/index.html @@ -153,6 +153,36 @@ + + +
+ +

Imaging Checklists

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