Implemented missing unifiSsid check for PDF exports

This commit is contained in:
Glenn de Haan
2024-09-21 12:28:18 +02:00
parent 9cc7fe7cb5
commit f97a61fcd2
2 changed files with 27 additions and 20 deletions

View File

@@ -65,27 +65,29 @@ module.exports = {
doc.moveDown(2);
doc.font('Helvetica')
.fontSize(10)
.text(`Connect to: `, {
continued: true
});
doc.font('Helvetica-Bold')
.fontSize(10)
.text(variables.unifiSsid, {
continued: true
});
doc.font('Helvetica')
.fontSize(10)
.text(` or,`);
doc.font('Helvetica')
.fontSize(10)
.text(`Scan to connect:`);
if(variables.unifiSsid !== '') {
doc.font('Helvetica')
.fontSize(10)
.text(`Connect to: `, {
continued: true
});
doc.font('Helvetica-Bold')
.fontSize(10)
.text(variables.unifiSsid, {
continued: true
});
doc.font('Helvetica')
.fontSize(10)
.text(` or,`);
doc.font('Helvetica')
.fontSize(10)
.text(`Scan to connect:`);
doc.image(await qr(), 75, 205, {fit: [75, 75], align: 'center', valign: 'center'});
doc.moveDown(6);
doc.image(await qr(), 75, 205, {fit: [75, 75], align: 'center', valign: 'center'});
doc.moveDown(6);
doc.moveDown(2);
doc.moveDown(2);
}
doc.font('Helvetica-Bold')
.fontSize(12)

View File

@@ -1,8 +1,13 @@
/**
* Import own modules
*/
const variables = require('../modules/variables');
/**
* Util function to calculate paper size based on voucher data
*/
module.exports = (voucher) => {
let base = 375;
let base = variables.unifiSsid !== '' ? 375 : 260;
if(voucher.qos_usage_quota) {
base += 10;