Updated dependencies. Fixed #28, unable to use the single-use voucher type

This commit is contained in:
Glenn de Haan
2024-01-15 18:26:59 +01:00
parent 93c9ccaccb
commit bf9478ebad
5 changed files with 1348 additions and 431 deletions

View File

@@ -1,7 +1,7 @@
# #
# Define OS # Define OS
# #
FROM alpine:3.16 FROM alpine:3.19
# #
# Basic OS management # Basic OS management

View File

@@ -11,14 +11,14 @@ A small UniFi Voucher Site for simple voucher creation
- Tailwind - Tailwind
## Development Usage ## Development Usage
- Install NodeJS 16.0 or higher. - Install NodeJS 18.0 or higher.
- Run `npm ci` in the root folder - Run `npm ci` in the root folder
- Run `npm start` & `npm run tailwind` in the root folder - Run `npm start` & `npm run tailwind` in the root folder
Then open up your favorite browser and go to http://localhost:3000/ Then open up your favorite browser and go to http://localhost:3000/
## Build Usage ## Build Usage
- Install NodeJS 16.0 or higher. - Install NodeJS 18.0 or higher.
- Run `npm ci` in the root folder - Run `npm ci` in the root folder
- Run `npm run build` in the root folder - Run `npm run build` in the root folder

View File

@@ -36,7 +36,7 @@ module.exports = (type) => {
*/ */
controller.login(config.unifi.username, config.unifi.password).then(() => { controller.login(config.unifi.username, config.unifi.password).then(() => {
controller.getSitesStats().then(() => { controller.getSitesStats().then(() => {
controller.createVouchers(type.expiration, 1, type.usage === 1 ? 1 : 0, null, typeof type.upload !== "undefined" ? type.upload : null, typeof type.download !== "undefined" ? type.download : null, typeof type.megabytes !== "undefined" ? type.megabytes : null).then((voucher_data) => { controller.createVouchers(type.expiration, 1, parseInt(type.usage) === 1 ? 1 : 0, null, typeof type.upload !== "undefined" ? type.upload : null, typeof type.download !== "undefined" ? type.download : null, typeof type.megabytes !== "undefined" ? type.megabytes : null).then((voucher_data) => {
controller.getVouchers(voucher_data[0].create_time).then((voucher_data_complete) => { controller.getVouchers(voucher_data[0].create_time).then((voucher_data_complete) => {
const voucher = `${[voucher_data_complete[0].code.slice(0, 5), '-', voucher_data_complete[0].code.slice(5)].join('')}`; const voucher = `${[voucher_data_complete[0].code.slice(0, 5), '-', voucher_data_complete[0].code.slice(5)].join('')}`;
resolve(voucher); resolve(voucher);

1759
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,20 +10,20 @@
"build": "tailwindcss -i ./css/style.css -o ./public/dist/style.css --minify" "build": "tailwindcss -i ./css/style.css -o ./public/dist/style.css --minify"
}, },
"engines": { "engines": {
"node": ">=16.0.0" "node": ">=18.0.0"
}, },
"author": "Glenn de Haan", "author": "Glenn de Haan",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"ejs": "^3.1.8", "ejs": "^3.1.9",
"express": "^4.18.2", "express": "^4.18.2",
"multer": "^1.4.5-lts.1", "multer": "^1.4.5-lts.1",
"node-unifi": "^2.2.2", "node-unifi": "^2.5.1",
"tailwindcss": "^3.2.4", "tailwindcss": "^3.4.1",
"tailwindcss-text-fill": "^0.2.0", "tailwindcss-text-fill": "^0.2.0",
"uuid": "^9.0.0" "uuid": "^9.0.1"
}, },
"devDependencies": { "devDependencies": {
"nodemon": "^2.0.20" "nodemon": "^3.0.2"
} }
} }