mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:00 -04:00
Updated dependencies. Fixed #28, unable to use the single-use voucher type
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Define OS
|
||||
#
|
||||
FROM alpine:3.16
|
||||
FROM alpine:3.19
|
||||
|
||||
#
|
||||
# Basic OS management
|
||||
|
||||
@@ -11,14 +11,14 @@ A small UniFi Voucher Site for simple voucher creation
|
||||
- Tailwind
|
||||
|
||||
## Development Usage
|
||||
- Install NodeJS 16.0 or higher.
|
||||
- Install NodeJS 18.0 or higher.
|
||||
- Run `npm ci` 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/
|
||||
|
||||
## Build Usage
|
||||
- Install NodeJS 16.0 or higher.
|
||||
- Install NodeJS 18.0 or higher.
|
||||
- Run `npm ci` in the root folder
|
||||
- Run `npm run build` in the root folder
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ module.exports = (type) => {
|
||||
*/
|
||||
controller.login(config.unifi.username, config.unifi.password).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) => {
|
||||
const voucher = `${[voucher_data_complete[0].code.slice(0, 5), '-', voucher_data_complete[0].code.slice(5)].join('')}`;
|
||||
resolve(voucher);
|
||||
|
||||
1759
package-lock.json
generated
1759
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -10,20 +10,20 @@
|
||||
"build": "tailwindcss -i ./css/style.css -o ./public/dist/style.css --minify"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"author": "Glenn de Haan",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ejs": "^3.1.8",
|
||||
"ejs": "^3.1.9",
|
||||
"express": "^4.18.2",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"node-unifi": "^2.2.2",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"node-unifi": "^2.5.1",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"tailwindcss-text-fill": "^0.2.0",
|
||||
"uuid": "^9.0.0"
|
||||
"uuid": "^9.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^2.0.20"
|
||||
"nodemon": "^3.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user