Snapshot of the working tree exactly as it stood, no edits. This is the predecessor
PRICEGOD was rewritten from ("kept intact, untouched" per pricegod/README.md), and it
is still the only place the DYMO scale is actually implemented —
rfid-daemon/index.js:1068-1265: HID discovery, parseScaleReport, one-shot read, and a
streaming /weight + /scale/start|stop session whose JSON shape PRICEGOD's daemon.js
already speaks.
Preserved verbatim on purpose (hence -og), including the known bug: DYMO_PIDS at
index.js:1082 is [0x8003, 0x8004], so it cannot see the bench M25 (0x8009). Fix that
in whatever daemon inherits the scale, not here.
node_modules stays ignored (22M of the 24M tree). No credentials in the import: the
two PEM markers in utils.js/sheets.js only strip headers off a key read from settings,
and mrpadmin / johnking are an SSH and a Postgres username, both key/trust auth.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
709 B
JavaScript
21 lines
709 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const barcodeField = document.querySelector('.print-barcode');
|
|
if (barcodeField && window.releaseData) {
|
|
generateQRCode(window.releaseData.id, barcodeField);
|
|
}
|
|
});
|
|
|
|
function generateQRCode(releaseId, element) {
|
|
if (!element || !releaseId) return;
|
|
|
|
const qrUrl = `https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=${releaseId}`;
|
|
element.innerHTML = `<img src="${qrUrl}" alt="${releaseId}">`;
|
|
}
|
|
|
|
// Export function for use in other modules
|
|
window.generateQRCode = generateQRCode;
|
|
|
|
function generateBarcode(data) {
|
|
// Logic to generate barcode using Code128 font
|
|
return `*${data}*`; // Example format
|
|
} |