mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-04-05 00:44:18 -04:00
Implemented missing unifiSsid check for PDF exports
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user