add print and export pdf function close #22

This commit is contained in:
Adrian Zürcher
2026-02-12 17:25:17 +01:00
parent 1fe2bd24b0
commit 2143ff1683
7 changed files with 445 additions and 82 deletions

235
package-lock.json generated
View File

@@ -1,17 +1,18 @@
{ {
"name": "lightcontrol", "name": "lightcontrol",
"version": "1.2.1", "version": "1.3.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "lightcontrol", "name": "lightcontrol",
"version": "1.2.1", "version": "1.3.0",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@capacitor-community/sqlite": "^7.0.1", "@capacitor-community/sqlite": "^7.0.1",
"@quasar/extras": "^1.17.0", "@quasar/extras": "^1.17.0",
"axios": "^1.10.0", "axios": "^1.10.0",
"html2pdf.js": "^0.14.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"pinia": "^3.0.3", "pinia": "^3.0.3",
@@ -93,6 +94,15 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/@babel/runtime": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
"integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.29.0", "version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
@@ -1849,6 +1859,12 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/pako": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/@types/pako/-/pako-2.0.4.tgz",
"integrity": "sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==",
"license": "MIT"
},
"node_modules/@types/qs": { "node_modules/@types/qs": {
"version": "6.9.18", "version": "6.9.18",
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz",
@@ -1856,6 +1872,13 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/raf": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz",
"integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==",
"license": "MIT",
"optional": true
},
"node_modules/@types/range-parser": { "node_modules/@types/range-parser": {
"version": "1.2.7", "version": "1.2.7",
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
@@ -1886,6 +1909,13 @@
"@types/send": "*" "@types/send": "*"
} }
}, },
"node_modules/@types/trusted-types": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
"license": "MIT",
"optional": true
},
"node_modules/@types/zxcvbn": { "node_modules/@types/zxcvbn": {
"version": "4.4.5", "version": "4.4.5",
"resolved": "https://registry.npmjs.org/@types/zxcvbn/-/zxcvbn-4.4.5.tgz", "resolved": "https://registry.npmjs.org/@types/zxcvbn/-/zxcvbn-4.4.5.tgz",
@@ -2636,6 +2666,15 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true "optional": true
}, },
"node_modules/base64-arraybuffer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"license": "MIT",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/base64-js": { "node_modules/base64-js": {
"version": "1.5.1", "version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -2964,6 +3003,26 @@
], ],
"license": "CC-BY-4.0" "license": "CC-BY-4.0"
}, },
"node_modules/canvg": {
"version": "3.0.11",
"resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz",
"integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==",
"license": "MIT",
"optional": true,
"dependencies": {
"@babel/runtime": "^7.12.5",
"@types/raf": "^3.4.0",
"core-js": "^3.8.3",
"raf": "^3.4.1",
"regenerator-runtime": "^0.13.7",
"rgbcolor": "^1.0.1",
"stackblur-canvas": "^2.0.0",
"svg-pathdata": "^6.0.3"
},
"engines": {
"node": ">=10.0.0"
}
},
"node_modules/chalk": { "node_modules/chalk": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
@@ -3320,6 +3379,18 @@
"url": "https://github.com/sponsors/mesqueeb" "url": "https://github.com/sponsors/mesqueeb"
} }
}, },
"node_modules/core-js": {
"version": "3.48.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.48.0.tgz",
"integrity": "sha512-zpEHTy1fjTMZCKLHUZoVeylt9XrzaIN2rbPXEt0k+q7JE5CkCZdo6bNq55bn24a69CH7ErAVLKijxJja4fw+UQ==",
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/core-js"
}
},
"node_modules/core-util-is": { "node_modules/core-util-is": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
@@ -3368,6 +3439,15 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/css-line-break": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"license": "MIT",
"dependencies": {
"utrie": "^1.0.2"
}
},
"node_modules/cssesc": { "node_modules/cssesc": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
@@ -3505,6 +3585,15 @@
"npm": "1.2.8000 || >= 1.4.16" "npm": "1.2.8000 || >= 1.4.16"
} }
}, },
"node_modules/dompurify": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz",
"integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==",
"license": "(MPL-2.0 OR Apache-2.0)",
"optionalDependencies": {
"@types/trusted-types": "^2.0.7"
}
},
"node_modules/dot-case": { "node_modules/dot-case": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz",
@@ -4281,6 +4370,23 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/fast-png": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/fast-png/-/fast-png-6.4.0.tgz",
"integrity": "sha512-kAqZq1TlgBjZcLr5mcN6NP5Rv4V2f22z00c3g8vRrwkcqjerx7BEhPbOnWCPqaHUl2XWQBJQvOT/FQhdMT7X/Q==",
"license": "MIT",
"dependencies": {
"@types/pako": "^2.0.3",
"iobuffer": "^5.3.2",
"pako": "^2.1.0"
}
},
"node_modules/fast-png/node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
"license": "(MIT AND Zlib)"
},
"node_modules/fastq": { "node_modules/fastq": {
"version": "1.19.1", "version": "1.19.1",
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
@@ -4291,6 +4397,12 @@
"reusify": "^1.0.4" "reusify": "^1.0.4"
} }
}, },
"node_modules/fflate": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz",
"integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==",
"license": "MIT"
},
"node_modules/file-entry-cache": { "node_modules/file-entry-cache": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
@@ -4734,6 +4846,30 @@
"node": "^14.13.1 || >=16.0.0" "node": "^14.13.1 || >=16.0.0"
} }
}, },
"node_modules/html2canvas": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"license": "MIT",
"dependencies": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/html2pdf.js": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/html2pdf.js/-/html2pdf.js-0.14.0.tgz",
"integrity": "sha512-yvNJgE/8yru2UeGflkPdjW8YEY+nDH5X7/2WG4uiuSCwYiCp8PZ8EKNiTAa6HxJ1NjC51fZSIEq6xld5CADKBQ==",
"license": "MIT",
"dependencies": {
"dompurify": "^3.3.1",
"html2canvas": "^1.0.0",
"jspdf": "^4.0.0"
}
},
"node_modules/http-errors": { "node_modules/http-errors": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
@@ -4865,6 +5001,12 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/iobuffer": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/iobuffer/-/iobuffer-5.4.0.tgz",
"integrity": "sha512-DRebOWuqDvxunfkNJAlc3IzWIPD5xVxwUNbHr7xKB8E6aLJxIPfNX3CoMJghcFjpv6RWQsrcJbghtEwSPoJqMA==",
"license": "MIT"
},
"node_modules/ipaddr.js": { "node_modules/ipaddr.js": {
"version": "1.9.1", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -5161,6 +5303,23 @@
"graceful-fs": "^4.1.6" "graceful-fs": "^4.1.6"
} }
}, },
"node_modules/jspdf": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/jspdf/-/jspdf-4.1.0.tgz",
"integrity": "sha512-xd1d/XRkwqnsq6FP3zH1Q+Ejqn2ULIJeDZ+FTKpaabVpZREjsJKRJwuokTNgdqOU+fl55KgbvgZ1pRTSWCP2kQ==",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.28.4",
"fast-png": "^6.2.0",
"fflate": "^0.8.1"
},
"optionalDependencies": {
"canvg": "^3.0.11",
"core-js": "^3.6.0",
"dompurify": "^3.3.1",
"html2canvas": "^1.0.0-rc.5"
}
},
"node_modules/jszip": { "node_modules/jszip": {
"version": "3.10.1", "version": "3.10.1",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz",
@@ -5988,6 +6147,13 @@
"integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
"license": "MIT",
"optional": true
},
"node_modules/picocolors": { "node_modules/picocolors": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
@@ -6235,6 +6401,16 @@
], ],
"license": "MIT" "license": "MIT"
}, },
"node_modules/raf": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
"license": "MIT",
"optional": true,
"dependencies": {
"performance-now": "^2.1.0"
}
},
"node_modules/randombytes": { "node_modules/randombytes": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
@@ -6349,6 +6525,13 @@
"node": ">=8.10.0" "node": ">=8.10.0"
} }
}, },
"node_modules/regenerator-runtime": {
"version": "0.13.11",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==",
"license": "MIT",
"optional": true
},
"node_modules/relateurl": { "node_modules/relateurl": {
"version": "0.2.7", "version": "0.2.7",
"resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz",
@@ -6417,6 +6600,16 @@
"integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/rgbcolor": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz",
"integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==",
"license": "MIT OR SEE LICENSE IN FEEL-FREE.md",
"optional": true,
"engines": {
"node": ">= 0.8.15"
}
},
"node_modules/rollup": { "node_modules/rollup": {
"version": "4.40.1", "version": "4.40.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.1.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.1.tgz",
@@ -7365,6 +7558,16 @@
"node": ">=16" "node": ">=16"
} }
}, },
"node_modules/stackblur-canvas": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz",
"integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==",
"license": "MIT",
"optional": true,
"engines": {
"node": ">=0.1.14"
}
},
"node_modules/statuses": { "node_modules/statuses": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@@ -7495,6 +7698,16 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/svg-pathdata": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz",
"integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==",
"license": "MIT",
"optional": true,
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/sync-child-process": { "node_modules/sync-child-process": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/sync-child-process/-/sync-child-process-1.0.2.tgz", "resolved": "https://registry.npmjs.org/sync-child-process/-/sync-child-process-1.0.2.tgz",
@@ -7583,6 +7796,15 @@
"b4a": "^1.6.4" "b4a": "^1.6.4"
} }
}, },
"node_modules/text-segmentation": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"license": "MIT",
"dependencies": {
"utrie": "^1.0.2"
}
},
"node_modules/tiny-invariant": { "node_modules/tiny-invariant": {
"version": "1.3.3", "version": "1.3.3",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
@@ -7873,6 +8095,15 @@
"node": ">= 0.4.0" "node": ">= 0.4.0"
} }
}, },
"node_modules/utrie": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"license": "MIT",
"dependencies": {
"base64-arraybuffer": "^1.0.2"
}
},
"node_modules/varint": { "node_modules/varint": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz", "resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz",

View File

@@ -18,6 +18,7 @@
"@capacitor-community/sqlite": "^7.0.1", "@capacitor-community/sqlite": "^7.0.1",
"@quasar/extras": "^1.17.0", "@quasar/extras": "^1.17.0",
"axios": "^1.10.0", "axios": "^1.10.0",
"html2pdf.js": "^0.14.0",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"pinia": "^3.0.3", "pinia": "^3.0.3",

View File

@@ -163,3 +163,5 @@ average: Durchschnitt
filterEventName: Verastautig filtere filterEventName: Verastautig filtere
hintFilterEventName: "*'IIgabe'* * oder % als filler vorher oder nächer" hintFilterEventName: "*'IIgabe'* * oder % als filler vorher oder nächer"
total: Gesamt total: Gesamt
exportPdf: PDF exportiere
print: Drucke

View File

@@ -163,3 +163,5 @@ average: Durchschnitt
filterEventName: Veranstaltung filtern filterEventName: Veranstaltung filtern
hintFilterEventName: "*'Eingabe'* * oder % als Filler vorher oder nachher" hintFilterEventName: "*'Eingabe'* * oder % als Filler vorher oder nachher"
total: Gesamt total: Gesamt
exportPdf: PDF exportieren
print: Drucken

View File

@@ -163,3 +163,5 @@ average: Average
filterEventName: filter Events filterEventName: filter Events
hintFilterEventName: "*'Input'* * or % as filler before oder after" hintFilterEventName: "*'Input'* * or % as filler before oder after"
total: Total total: Total
exportPdf: export PDF
print: Print

View File

@@ -163,3 +163,5 @@ average: Promedio
filterEventName: filtrar eventos filterEventName: filtrar eventos
hintFilterEventName: "*''Entrada'* * o % como relleno antes o después" hintFilterEventName: "*''Entrada'* * o % como relleno antes o después"
total: Total total: Total
exportPdf: exportar PDF
print: Imprimir

View File

@@ -7,93 +7,119 @@
/> />
<div class="colums"> <div class="colums">
<div class="row justify-end"> <div class="row justify-end">
<q-btn-dropdown <div class="column">
ref="dropdownRef" <q-btn-dropdown
class="q-ma-sm" no-caps
color="primary" ref="dropdownRef"
:label="$t('selectDates')" class="q-ma-sm"
@show="loadSettings" color="primary"
> :label="$t('selectDates')"
<DateDaySelect @update:dates="updateReport" /> @show="loadSettings"
<div class="column justify-end q-pa-md"> >
<div class="row q-ma-md"> <DateDaySelect @update:dates="updateReport" />
<q-input <div class="column justify-end q-pa-md">
class="col-7" <div class="row q-ma-md">
label-color="primary" <q-input
:label="$t('filterEventName')" class="col-7"
:hint="$t('hintFilterEventName')" label-color="primary"
type="text" :label="$t('filterEventName')"
v-model:model-value="filter" :hint="$t('hintFilterEventName')"
></q-input> type="text"
</div> v-model:model-value="filter"
<div class="row q-ma-md"> ></q-input>
<q-select </div>
class="col-7" <div class="row q-ma-md">
:label="$t('filterByColumnValue')" <q-select
dense class="col-7"
v-model="group" :label="$t('filterByColumnValue')"
:options="groups" dense
option-label="name" v-model="group"
option-value="id" :options="groups"
multiple option-label="name"
clearable option-value="id"
/> multiple
</div> clearable
/>
</div>
<div class="row justify-end"> <div class="row justify-end">
<q-btn dense class="q-ma-md" color="primary" no-caps @click="applyDateChoice">{{ <q-btn dense class="q-ma-md" color="primary" no-caps @click="applyDateChoice">{{
$t('apply') $t('apply')
}}</q-btn> }}</q-btn>
</div>
</div> </div>
</q-btn-dropdown>
<div class="column q-ma-sm" v-if="amounts.length">
<q-btn
dense
no-caps
class="q-ma-sm"
color="grey-9"
icon="print"
:label="$t('print')"
@click="printReport"
/>
<q-btn
dense
no-caps
color="secondary"
icon="picture_as_pdf"
:label="$t('exportPdf')"
@click="downloadPDF"
/>
</div> </div>
</q-btn-dropdown> </div>
</div> </div>
</div> </div>
<div class="row justify-center q-ma-xs"> <div id="report-content" ref="reportExportRef">
<h3 class="col-12 text-center text-primary text-bold">{{ $t('report') }}</h3> <div class="row justify-center q-ma-xs">
<ReportStat :amounts="amounts" /> <h3 class="col-12 text-center text-primary text-bold">{{ $t('report') }}</h3>
</div> <ReportStat :amounts="amounts" />
</div>
<div class="row justify-center"> <div class="row justify-center">
<div <div
v-if="attendees !== undefined" v-if="attendees !== undefined"
:class=" :class="
nonAttendees !== undefined ? 'col-12 col-sm-5 col-md-5 q-pa-md' : 'col-12 col-md-8 col-lg-5' nonAttendees !== undefined
" ? 'col-12 col-sm-5 col-md-5 q-pa-md'
> : 'col-12 col-md-8 col-lg-5'
<q-table "
flat
dense
:no-data-label="$t('noDataAvailable')"
:loading-label="$t('loading')"
:rows-per-page-label="$t('recordsPerPage')"
:rows-per-page-options="[0]"
:title="$t('attendees')"
title-class="text-bold text-primary"
:rows="attendees"
:columns="columns"
> >
</q-table> <q-table
</div> flat
<div dense
v-if="nonAttendees !== undefined" :no-data-label="$t('noDataAvailable')"
:class=" :loading-label="$t('loading')"
attendees !== undefined ? 'col-12 col-sm-5 col-md-5 q-pa-md' : 'col-12 col-md-8 col-lg-5' :rows-per-page-label="$t('recordsPerPage')"
" :rows-per-page-options="[0]"
> :title="$t('attendees')"
<q-table title-class="text-bold text-primary"
flat :rows="attendees"
dense :columns="columns"
:title="$t('noneAttendees')" >
:no-data-label="$t('noDataAvailable')" </q-table>
:loading-label="$t('loading')" </div>
:rows-per-page-label="$t('recordsPerPage')" <div
:rows-per-page-options="[0]" v-if="nonAttendees !== undefined"
title-class="text-bold text-primary" :class="
:rows="nonAttendees" attendees !== undefined ? 'col-12 col-sm-5 col-md-5 q-pa-md' : 'col-12 col-md-8 col-lg-5'
:columns="columns" "
> >
</q-table> <q-table
flat
dense
:title="$t('noneAttendees')"
:no-data-label="$t('noDataAvailable')"
:loading-label="$t('loading')"
:rows-per-page-label="$t('recordsPerPage')"
:rows-per-page-options="[0]"
title-class="text-bold text-primary"
:rows="nonAttendees"
:columns="columns"
>
</q-table>
</div>
</div> </div>
</div> </div>
</template> </template>
@@ -104,11 +130,12 @@ import DateDaySelect from 'src/components/DateDaySelect.vue';
import { computed, onMounted, ref } from 'vue'; import { computed, onMounted, ref } from 'vue';
import { useNotify } from 'src/vueLib/general/useNotify'; import { useNotify } from 'src/vueLib/general/useNotify';
import { i18n } from 'src/boot/lang'; import { i18n } from 'src/boot/lang';
import { databaseName } from 'src/vueLib/models/settings'; import { appName, databaseName } from 'src/vueLib/models/settings';
import type { Amount } from 'src/vueLib/models/report'; import type { Amount } from 'src/vueLib/models/report';
import ReportStat from 'src/components/ReportStat.vue'; import ReportStat from 'src/components/ReportStat.vue';
import type { Group, Groups } from 'src/vueLib/models/group'; import type { Group, Groups } from 'src/vueLib/models/group';
import { getLocalPageDefaults, setLocalPageDefaults } from 'src/localstorage/localStorage'; import { getLocalPageDefaults, setLocalPageDefaults } from 'src/localstorage/localStorage';
import html2pdf from 'html2pdf.js';
const filter = ref<string>(''); const filter = ref<string>('');
const group = ref<Group[]>([]); const group = ref<Group[]>([]);
@@ -120,6 +147,7 @@ const { NotifyResponse } = useNotify();
const dropdownRef = ref(); const dropdownRef = ref();
const loading = ref(false); const loading = ref(false);
const amounts = ref<Amount[]>([]); const amounts = ref<Amount[]>([]);
const reportExportRef = ref<HTMLElement | null>(null);
const columns = computed(() => [ const columns = computed(() => [
{ {
@@ -233,4 +261,99 @@ function applyDateChoice() {
function updateReport(dates: string[]) { function updateReport(dates: string[]) {
allDates.value = dates; allDates.value = dates;
} }
function printReport() {
window.print();
}
async function downloadPDF() {
const element = reportExportRef.value;
if (!element) return;
// Generate date string (YYYY-MM-DD)
const today = new Date().toISOString().split('T')[0];
// Optionally, add time for more precision (HH-mm)
const time = new Date()
.toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' })
.replace(':', '-');
const options = {
margin: [10, 10, 10, 10] as [number, number, number, number],
filename: appName.value + `${today}_${time}.pdf`,
image: {
type: 'jpeg' as const,
quality: 1.0, // Set quality to 100%
},
html2canvas: {
scale: 4, // Increase this (2 is standard, 4 is crisp/retina)
useCORS: true,
letterRendering: true, // Improves text spacing
dpi: 300, // Standard print resolution
},
jsPDF: {
unit: 'mm' as const,
format: 'a4' as const,
orientation: 'portrait' as const,
compress: true, // Keeps file size manageable despite high scale
},
};
await html2pdf()
.set(options)
.from(element)
.save()
.catch((error) => {
console.error('PDF Generation failed:', error);
});
}
</script> </script>
<style>
@media print {
/* 1. Hide the URL, Date, and Page Title */
@page {
margin: 0; /* This is what removes the URL and headers/footers */
}
body {
padding: 1.5cm; /* Add padding here so the content isn't at the very edge */
}
/* 2. Hide UI elements */
.q-btn,
.q-btn-dropdown,
.q-header,
.q-drawer,
.q-footer,
.q-notifications {
display: none !important;
}
/* 3. Ensure the layout uses full width */
.q-page-container {
padding: 0 !important;
}
/* Remove shadows for cleaner printing */
.q-card,
.q-table__card {
box-shadow: none !important;
border: 1px solid #ddd !important;
}
}
/* This ensures the PDF version has a white background and visible text */
#report-content {
background: white;
color: black;
padding: 20px;
}
/* Force tables to expand to full width in the PDF */
#report-content .q-table__container {
width: 100% !important;
}
/* If you want to force a page break before the tables */
.pdf-page-break {
page-break-before: always;
}
</style>