frontend: refactor to pure Vue3 with componentized views; add hash routing; auth gate; loader/error feedback; remove login section from users view\nbackend: add Node/Express API server; fix iconv-lite deps; add MySQL connection via DATABASE_URL and /api/db/ping; implement credential validation with ADMIN_USER/ADMIN_PASSWORD
@ -0,0 +1,970 @@
|
||||
{
|
||||
"name": "mail-backend",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mail-backend",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.20.2",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.19.2",
|
||||
"iconv-lite": "0.4.24",
|
||||
"mysql2": "^3.15.3",
|
||||
"raw-body": "^2.5.2"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "1.3.8",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
||||
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-types": "~2.1.34",
|
||||
"negotiator": "0.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/array-flatten": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/aws-ssl-profiles": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz",
|
||||
"integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "1.20.4",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz",
|
||||
"integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "~3.1.2",
|
||||
"content-type": "~1.0.5",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"destroy": "~1.2.0",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.4.24",
|
||||
"on-finished": "~2.4.1",
|
||||
"qs": "~6.14.0",
|
||||
"raw-body": "~2.5.3",
|
||||
"type-is": "~1.6.18",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8",
|
||||
"npm": "1.2.8000 || >= 1.4.16"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
|
||||
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safe-buffer": "5.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
|
||||
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/cors": {
|
||||
"version": "2.8.5",
|
||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
||||
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"object-assign": "^4",
|
||||
"vary": "^1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/denque": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz",
|
||||
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/destroy": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
|
||||
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8",
|
||||
"npm": "1.2.8000 || >= 1.4.16"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "4.22.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz",
|
||||
"integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "~1.3.8",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "~1.20.3",
|
||||
"content-disposition": "~0.5.4",
|
||||
"content-type": "~1.0.4",
|
||||
"cookie": "~0.7.1",
|
||||
"cookie-signature": "~1.0.6",
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"finalhandler": "~1.3.1",
|
||||
"fresh": "~0.5.2",
|
||||
"http-errors": "~2.0.0",
|
||||
"merge-descriptors": "1.0.3",
|
||||
"methods": "~1.1.2",
|
||||
"on-finished": "~2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"path-to-regexp": "~0.1.12",
|
||||
"proxy-addr": "~2.0.7",
|
||||
"qs": "~6.14.0",
|
||||
"range-parser": "~1.2.1",
|
||||
"safe-buffer": "5.2.1",
|
||||
"send": "~0.19.0",
|
||||
"serve-static": "~1.16.2",
|
||||
"setprototypeof": "1.2.0",
|
||||
"statuses": "~2.0.1",
|
||||
"type-is": "~1.6.18",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "~1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz",
|
||||
"integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "2.6.9",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"on-finished": "~2.4.1",
|
||||
"parseurl": "~1.3.3",
|
||||
"statuses": "~2.0.2",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
||||
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/generate-function": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
|
||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-property": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "~2.0.0",
|
||||
"inherits": "~2.0.4",
|
||||
"setprototypeof": "~1.2.0",
|
||||
"statuses": "~2.0.2",
|
||||
"toidentifier": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-property": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
|
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/long": {
|
||||
"version": "5.3.2",
|
||||
"resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
|
||||
"integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/lru.min": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.3.tgz",
|
||||
"integrity": "sha512-Lkk/vx6ak3rYkRR0Nhu4lFUT2VDnQSxBe8Hbl7f36358p6ow8Bnvr8lrLt98H8J1aGxfhbX4Fs5tYg2+FTwr5Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"bun": ">=1.0.0",
|
||||
"deno": ">=1.30.0",
|
||||
"node": ">=8.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wellwelwel"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
|
||||
"integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"mime": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mysql2": {
|
||||
"version": "3.15.3",
|
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.15.3.tgz",
|
||||
"integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"aws-ssl-profiles": "^1.1.1",
|
||||
"denque": "^2.1.0",
|
||||
"generate-function": "^2.3.1",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"long": "^5.2.1",
|
||||
"lru.min": "^1.0.0",
|
||||
"named-placeholders": "^1.1.3",
|
||||
"seq-queue": "^0.0.5",
|
||||
"sqlstring": "^2.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mysql2/node_modules/iconv-lite": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.1.tgz",
|
||||
"integrity": "sha512-2Tth85cXwGFHfvRgZWszZSvdo+0Xsqmw8k8ZwxScfcBneNUraK+dxRxRm24nszx80Y0TVio8kKLt5sLE7ZCLlw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/named-placeholders": {
|
||||
"version": "1.1.6",
|
||||
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.6.tgz",
|
||||
"integrity": "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"lru.min": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
|
||||
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz",
|
||||
"integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "~3.1.2",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.4.24",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "0.19.2",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz",
|
||||
"integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "2.6.9",
|
||||
"depd": "2.0.0",
|
||||
"destroy": "1.2.0",
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"etag": "~1.8.1",
|
||||
"fresh": "~0.5.2",
|
||||
"http-errors": "~2.0.1",
|
||||
"mime": "1.6.0",
|
||||
"ms": "2.1.3",
|
||||
"on-finished": "~2.4.1",
|
||||
"range-parser": "~1.2.1",
|
||||
"statuses": "~2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/send/node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/seq-queue": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz",
|
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q=="
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "1.16.3",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz",
|
||||
"integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"parseurl": "~1.3.3",
|
||||
"send": "~0.19.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/sqlstring": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz",
|
||||
"integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "1.6.18",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"media-typer": "0.3.0",
|
||||
"mime-types": "~2.1.24"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/utils-merge": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "mail-backend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"body-parser": "^1.20.2",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.19.2",
|
||||
"iconv-lite": "0.4.24",
|
||||
"mysql2": "^3.15.3",
|
||||
"raw-body": "^2.5.2"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
const express = require('express')
|
||||
const cors = require('cors')
|
||||
const bodyParser = require('body-parser')
|
||||
const mysql = require('mysql2/promise')
|
||||
|
||||
const app = express()
|
||||
app.use(cors({ origin: '*', methods: 'GET,HEAD,PUT,PATCH,POST,DELETE' }))
|
||||
app.use(bodyParser.json())
|
||||
app.use(bodyParser.urlencoded({ extended: true }))
|
||||
|
||||
const ok = data => ({ success: true, data })
|
||||
const now = () => new Date().toISOString()
|
||||
|
||||
let pool = null
|
||||
const initDb = async () => {
|
||||
const url = process.env.DATABASE_URL
|
||||
if (!url) return
|
||||
const u = new URL(url)
|
||||
const config = {
|
||||
host: u.hostname,
|
||||
port: Number(u.port || 3306),
|
||||
user: decodeURIComponent(u.username || ''),
|
||||
password: decodeURIComponent(u.password || ''),
|
||||
database: (u.pathname || '').replace(/^\//, '') || process.env.DB_NAME || 'smtp',
|
||||
waitForConnections: true,
|
||||
connectionLimit: Number(process.env.DB_CONN_LIMIT || 10),
|
||||
queueLimit: 0
|
||||
}
|
||||
pool = mysql.createPool(config)
|
||||
}
|
||||
const dbPing = async () => {
|
||||
if (!pool) return { connected: false, message: 'DATABASE_URL not set' }
|
||||
const [rows] = await pool.query('SELECT 1 AS ok')
|
||||
return { connected: true, rows }
|
||||
}
|
||||
|
||||
app.get('/api/db/ping', async (req, res) => {
|
||||
try {
|
||||
const r = await dbPing()
|
||||
res.json(ok(r))
|
||||
} catch (e) {
|
||||
res.status(500).json({ success: false, message: String(e) })
|
||||
}
|
||||
})
|
||||
|
||||
app.get('/api/settings.php', (req, res) => {
|
||||
res.json(ok({
|
||||
smtp: { port: 25, host: '0.0.0.0', max_connections: 100 },
|
||||
pop3: { port: 110, host: '0.0.0.0', max_connections: 100 },
|
||||
server: { domain: 'test.com', max_email_size: 10485760, max_mailbox_size: 104857600 },
|
||||
log: { path: '../logs/', level: 'info' }
|
||||
}))
|
||||
})
|
||||
app.post('/api/settings.php', (req, res) => res.json(ok({ saved: true, at: now(), payload: req.body || {} })))
|
||||
|
||||
app.get('/api/users.php', (req, res) => {
|
||||
const users = [
|
||||
{ username: 'admin', email: 'admin@test.com', is_admin: true, is_enabled: true, created_at: now(), updated_at: now() },
|
||||
{ username: 'user', email: 'user@test.com', is_admin: false, is_enabled: true, created_at: now(), updated_at: now() }
|
||||
]
|
||||
const page = Number(req.query.page || 1), perPage = Number(req.query.perPage || 10)
|
||||
res.json(ok({ users, total: users.length, page, perPage, totalPages: 1 }))
|
||||
})
|
||||
app.post('/api/users.php', (req, res) => {
|
||||
const { login, username, password } = req.body || {}
|
||||
if (login) {
|
||||
const adminUser = process.env.ADMIN_USER || 'admin'
|
||||
const adminPass = process.env.ADMIN_PASSWORD || 'admin123'
|
||||
if (username === adminUser && password === adminPass) {
|
||||
const token = Buffer.from(`${username}:${now()}`).toString('base64')
|
||||
return res.json(ok({ token, username, login_at: now() }))
|
||||
}
|
||||
return res.status(401).json({ success: false, message: 'Invalid credentials' })
|
||||
}
|
||||
res.json(ok({ created: true, user: req.body || {} }))
|
||||
})
|
||||
app.delete('/api/users.php', (req, res) => res.json(ok({ deleted: true, username: req.query.username || '' })))
|
||||
|
||||
app.get('/api/emails.php', (req, res) => {
|
||||
const { id, username, folder = 'inbox', page = 1, perPage = 10 } = req.query
|
||||
if (id) return res.json(ok({ email: null }))
|
||||
const emails = [
|
||||
{ id: '1234567890', from: 'sender@example.com', to: 'admin@test.com', subject: '测试邮件', date: now(), folder, is_read: 0, is_deleted: 0, data: '这是邮件内容', created_at: now() },
|
||||
]
|
||||
res.json(ok({ emails, total: emails.length, page: Number(page), perPage: Number(perPage), totalPages: 1 }))
|
||||
})
|
||||
app.post('/api/emails.php', (req, res) => res.json(ok({ sent: !req.body?.isDraft, draft: !!req.body?.isDraft, payload: req.body || {} })))
|
||||
app.put('/api/emails.php', (req, res) => res.json(ok({ updated: true, payload: req.body || {} })))
|
||||
app.delete('/api/emails.php', (req, res) => res.json(ok({ deleted: true, id: req.query.id || '', username: req.query.username || '' })))
|
||||
|
||||
app.get('/api/logs.php', (req, res) => {
|
||||
const logs = [{ id: 1, type: 'info', message: 'Server started', ip: '127.0.0.1', user_id: 'system', created_at: now() }]
|
||||
res.json(ok({ logs, total: logs.length, page: Number(req.query.page || 1), perPage: Number(req.query.perPage || 10), totalPages: 1 }))
|
||||
})
|
||||
app.delete('/api/logs.php', (req, res) => res.json(ok({ deleted: req.query.all ? 'all' : req.query.id || '' })))
|
||||
|
||||
app.get('/api/contacts.php', (req, res) => {
|
||||
const { id } = req.query
|
||||
const item = { id: 1, name: '张三', email: 'zhangsan@example.com', phone: '13800138000', company: '示例公司', department: '技术部', position: '工程师', create_time: now(), update_time: now() }
|
||||
if (id) return res.json(ok({ contact: item }))
|
||||
res.json(ok({ contacts: [item], total: 1, page: Number(req.query.page || 1), perPage: Number(req.query.perPage || 20), totalPages: 1 }))
|
||||
})
|
||||
app.post('/api/contacts.php', (req, res) => res.json(ok({ created: true, contact: req.body || {} })))
|
||||
app.put('/api/contacts.php', (req, res) => res.json(ok({ updated: true, contact: req.body || {} })))
|
||||
app.delete('/api/contacts.php', (req, res) => res.json(ok({ deleted: true, id: Number(req.query.id || 0) })))
|
||||
|
||||
app.get('/api/stats.php', (req, res) => {
|
||||
res.json(ok({ typeStats: { inbox: 0, sent: 0, draft: 0, trash: 0, total: 0 }, readStats: { read: 0, unread: 0 } }))
|
||||
})
|
||||
|
||||
app.get('/api/mailbox.php', (req, res) => {
|
||||
const { action } = req.query
|
||||
if (action === 'quota') return res.json(ok({ quota: 1073741824, used: 0, remaining: 1073741824, percentage: 0 }))
|
||||
res.json(ok({ email: 'admin@test.com', stats: { inbox: 0, sent: 0, draft: 0, trash: 0, unread: 0 }, customFolders: [] }))
|
||||
})
|
||||
|
||||
const port = process.env.PORT || 8000
|
||||
initDb()
|
||||
.catch(e => console.error('DB init error', e))
|
||||
.finally(() => {
|
||||
app.listen(port, () => {
|
||||
console.log(`API server on http://localhost:${port}/`)
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,101 @@
|
||||
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
|
||||
|
||||
# Built application files
|
||||
*.apk
|
||||
*.aar
|
||||
*.ap_
|
||||
*.aab
|
||||
|
||||
# Files for the ART/Dalvik VM
|
||||
*.dex
|
||||
|
||||
# Java class files
|
||||
*.class
|
||||
|
||||
# Generated files
|
||||
bin/
|
||||
gen/
|
||||
out/
|
||||
# Uncomment the following line in case you need and you don't have the release build type files in your app
|
||||
# release/
|
||||
|
||||
# Gradle files
|
||||
.gradle/
|
||||
build/
|
||||
|
||||
# Local configuration file (sdk path, etc)
|
||||
local.properties
|
||||
|
||||
# Proguard folder generated by Eclipse
|
||||
proguard/
|
||||
|
||||
# Log Files
|
||||
*.log
|
||||
|
||||
# Android Studio Navigation editor temp files
|
||||
.navigation/
|
||||
|
||||
# Android Studio captures folder
|
||||
captures/
|
||||
|
||||
# IntelliJ
|
||||
*.iml
|
||||
.idea/workspace.xml
|
||||
.idea/tasks.xml
|
||||
.idea/gradle.xml
|
||||
.idea/assetWizardSettings.xml
|
||||
.idea/dictionaries
|
||||
.idea/libraries
|
||||
# Android Studio 3 in .gitignore file.
|
||||
.idea/caches
|
||||
.idea/modules.xml
|
||||
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
|
||||
.idea/navEditor.xml
|
||||
|
||||
# Keystore files
|
||||
# Uncomment the following lines if you do not want to check your keystore files in.
|
||||
#*.jks
|
||||
#*.keystore
|
||||
|
||||
# External native build folder generated in Android Studio 2.2 and later
|
||||
.externalNativeBuild
|
||||
.cxx/
|
||||
|
||||
# Google Services (e.g. APIs or Firebase)
|
||||
# google-services.json
|
||||
|
||||
# Freeline
|
||||
freeline.py
|
||||
freeline/
|
||||
freeline_project_description.json
|
||||
|
||||
# fastlane
|
||||
fastlane/report.xml
|
||||
fastlane/Preview.html
|
||||
fastlane/screenshots
|
||||
fastlane/test_output
|
||||
fastlane/readme.md
|
||||
|
||||
# Version control
|
||||
vcs.xml
|
||||
|
||||
# lint
|
||||
lint/intermediates/
|
||||
lint/generated/
|
||||
lint/outputs/
|
||||
lint/tmp/
|
||||
# lint/reports/
|
||||
|
||||
# Android Profiling
|
||||
*.hprof
|
||||
|
||||
# Cordova plugins for Capacitor
|
||||
capacitor-cordova-android-plugins
|
||||
|
||||
# Copied web assets
|
||||
app/src/main/assets/public
|
||||
|
||||
# Generated Config files
|
||||
app/src/main/assets/capacitor.config.json
|
||||
app/src/main/assets/capacitor.plugins.json
|
||||
app/src/main/res/xml/config.xml
|
||||
@ -0,0 +1,2 @@
|
||||
/build/*
|
||||
!/build/.npmkeep
|
||||
@ -0,0 +1,54 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
namespace "net.educoder.mailbox"
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
defaultConfig {
|
||||
applicationId "net.educoder.mailbox"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
|
||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir{
|
||||
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
||||
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
|
||||
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
|
||||
implementation project(':capacitor-android')
|
||||
testImplementation "junit:junit:$junitVersion"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
||||
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
||||
implementation project(':capacitor-cordova-android-plugins')
|
||||
}
|
||||
|
||||
apply from: 'capacitor.build.gradle'
|
||||
|
||||
try {
|
||||
def servicesJSON = file('google-services.json')
|
||||
if (servicesJSON.text) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
}
|
||||
} catch(Exception e) {
|
||||
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||
|
||||
android {
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
|
||||
dependencies {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (hasProperty('postBuildExtras')) {
|
||||
postBuildExtras()
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@ -0,0 +1,26 @@
|
||||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals("com.getcapacitor.app", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<activity
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/title_activity_main"
|
||||
android:theme="@style/AppTheme.NoActionBarLaunch"
|
||||
android:launchMode="singleTask"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.fileprovider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/file_paths"></meta-data>
|
||||
</provider>
|
||||
</application>
|
||||
|
||||
<!-- Permissions -->
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
@ -0,0 +1,5 @@
|
||||
package net.educoder.mailbox;
|
||||
|
||||
import com.getcapacitor.BridgeActivity;
|
||||
|
||||
public class MainActivity extends BridgeActivity {}
|
||||
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,34 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1" />
|
||||
</vector>
|
||||
@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF"
|
||||
android:strokeWidth="0.8" />
|
||||
</vector>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<WebView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 16 KiB |
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#FFFFFF</color>
|
||||
</resources>
|
||||
@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<string name="app_name">Mailbox</string>
|
||||
<string name="title_activity_main">Mailbox</string>
|
||||
<string name="package_name">net.educoder.mailbox</string>
|
||||
<string name="custom_url_scheme">net.educoder.mailbox</string>
|
||||
</resources>
|
||||
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:background">@null</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppTheme.NoActionBarLaunch" parent="Theme.SplashScreen">
|
||||
<item name="android:background">@drawable/splash</item>
|
||||
</style>
|
||||
</resources>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="my_images" path="." />
|
||||
<cache-path name="my_cache_images" path="." />
|
||||
</paths>
|
||||
@ -0,0 +1,18 @@
|
||||
package com.getcapacitor.myapp;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
public void addition_isCorrect() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.0.0'
|
||||
classpath 'com.google.gms:google-services:4.3.15'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "variables.gradle"
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
|
||||
include ':capacitor-android'
|
||||
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
|
||||
@ -0,0 +1,22 @@
|
||||
# Project-wide Gradle settings.
|
||||
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
@ -0,0 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
|
||||
networkTimeout=10000
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@ -0,0 +1,244 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@ -0,0 +1,5 @@
|
||||
include ':app'
|
||||
include ':capacitor-cordova-android-plugins'
|
||||
project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/')
|
||||
|
||||
apply from: 'capacitor.settings.gradle'
|
||||
@ -0,0 +1,16 @@
|
||||
ext {
|
||||
minSdkVersion = 22
|
||||
compileSdkVersion = 33
|
||||
targetSdkVersion = 33
|
||||
androidxActivityVersion = '1.7.0'
|
||||
androidxAppCompatVersion = '1.6.1'
|
||||
androidxCoordinatorLayoutVersion = '1.2.0'
|
||||
androidxCoreVersion = '1.10.0'
|
||||
androidxFragmentVersion = '1.5.6'
|
||||
coreSplashScreenVersion = '1.0.0'
|
||||
androidxWebkitVersion = '1.6.1'
|
||||
junitVersion = '4.13.2'
|
||||
androidxJunitVersion = '1.1.5'
|
||||
androidxEspressoCoreVersion = '3.5.1'
|
||||
cordovaAndroidVersion = '10.1.1'
|
||||
}
|
||||
@ -1,117 +0,0 @@
|
||||
const state={baseURL:localStorage.getItem("baseURL")||"http://localhost:8000"}
|
||||
const qs=o=>Object.entries(o).filter(([_,v])=>v!==""&&v!==undefined&&v!==null).map(([k,v])=>`${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&")
|
||||
const path=p=>p.startsWith("/")?p:`/${p}`
|
||||
const api=(p,opt={})=>{
|
||||
const url=new URL(path(p),state.baseURL)
|
||||
const m=(opt.method||"GET").toUpperCase()
|
||||
const h={"Content-Type":"application/json"}
|
||||
const o={method:m,headers:h}
|
||||
if(opt.query&&Object.keys(opt.query).length){url.search=qs(opt.query)}
|
||||
if(m==="POST"||m==="PUT"){o.body=JSON.stringify(opt.body||{})}
|
||||
return fetch(url.toString(),o).then(async r=>({ok:r.ok,status:r.status,data:await r.json().catch(()=>({}))})).catch(e=>({ok:false,status:0,data:{success:false,message:String(e)}}))
|
||||
}
|
||||
const setStatus=(el,ok)=>{el.textContent=ok?"后端可用":"后端不可访问";el.style.color=ok?"#16a34a":"#dc2626"}
|
||||
const pretty=(v)=>typeof v==="string"?v:JSON.stringify(v,null,2)
|
||||
const show=(id)=>{document.querySelectorAll(".tabs button").forEach(b=>b.classList.toggle("active",b.dataset.section===id));document.querySelectorAll(".section").forEach(s=>s.classList.toggle("hidden",s.id!==id))}
|
||||
document.addEventListener("DOMContentLoaded",()=>{
|
||||
const baseInp=document.getElementById("baseURL");baseInp.value=state.baseURL
|
||||
document.getElementById("saveBaseURL").addEventListener("click",()=>{state.baseURL=baseInp.value.trim();localStorage.setItem("baseURL",state.baseURL);ping()})
|
||||
document.querySelectorAll(".tabs button").forEach(b=>b.addEventListener("click",()=>show(b.dataset.section)))
|
||||
ping()
|
||||
document.getElementById("checkSettings").addEventListener("click",async()=>{const r=await api("/api/settings.php");document.getElementById("checkSettingsResult").textContent=pretty(r.data)})
|
||||
document.getElementById("checkUsers").addEventListener("click",async()=>{const r=await api("/api/users.php",{query:{page:1,perPage:10}});document.getElementById("checkUsersResult").textContent=pretty(r.data)})
|
||||
document.getElementById("btnLoadUsers").addEventListener("click",async()=>{
|
||||
const q={page:Number(document.getElementById("usersPage").value||1),perPage:Number(document.getElementById("usersPerPage").value||10),search:document.getElementById("usersSearch").value.trim()}
|
||||
const r=await api("/api/users.php",{query:q});renderUsers(r.data?.data?.users||[])
|
||||
})
|
||||
document.getElementById("btnLogin").addEventListener("click",async()=>{
|
||||
const body={login:true,username:document.getElementById("loginUsername").value.trim(),password:document.getElementById("loginPassword").value}
|
||||
const r=await api("/api/users.php",{method:"POST",body});document.getElementById("loginResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnAddUser").addEventListener("click",async()=>{
|
||||
const body={username:document.getElementById("addUsername").value.trim(),password:document.getElementById("addPassword").value,email:document.getElementById("addEmail").value.trim(),is_admin:document.getElementById("addIsAdmin").checked,is_enabled:document.getElementById("addIsEnabled").checked}
|
||||
const r=await api("/api/users.php",{method:"POST",body});document.getElementById("addUserResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnLoadEmails").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("emailsUsername").value.trim(),folder:document.getElementById("emailsFolder").value,page:Number(document.getElementById("emailsPage").value||1),perPage:Number(document.getElementById("emailsPerPage").value||10),search:document.getElementById("emailsSearch").value.trim()}
|
||||
const r=await api("/api/emails.php",{query:q});renderEmails(r.data?.data?.emails||[])
|
||||
})
|
||||
document.getElementById("btnEmailDetail").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("emailDetailUsername").value.trim(),id:document.getElementById("emailDetailId").value.trim()}
|
||||
const r=await api("/api/emails.php",{query:q});document.getElementById("emailDetailResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnSendMail").addEventListener("click",async()=>{
|
||||
const body={username:document.getElementById("sendUsername").value.trim(),to:document.getElementById("sendTo").value.trim(),subject:document.getElementById("sendSubject").value.trim(),content:document.getElementById("sendContent").value,isDraft:document.getElementById("sendIsDraft").checked}
|
||||
const r=await api("/api/emails.php",{method:"POST",body});document.getElementById("sendMailResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnUpdateEmail").addEventListener("click",async()=>{
|
||||
const body={id:document.getElementById("updateId").value.trim(),username:document.getElementById("updateUsername").value.trim()}
|
||||
const isRead=document.getElementById("updateIsRead").value;if(isRead!==""){body.isRead=Number(isRead)}
|
||||
const folder=document.getElementById("updateFolder").value;if(folder!==""){body.folder=folder}
|
||||
const r=await api("/api/emails.php",{method:"PUT",body});document.getElementById("updateDeleteResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnDeleteEmail").addEventListener("click",async()=>{
|
||||
const q={id:document.getElementById("updateId").value.trim(),username:document.getElementById("updateUsername").value.trim()}
|
||||
const r=await api("/api/emails.php",{method:"DELETE",query:q});document.getElementById("updateDeleteResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnGetSettings").addEventListener("click",async()=>{
|
||||
const r=await api("/api/settings.php");document.getElementById("getSettingsResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnSaveSettings").addEventListener("click",async()=>{
|
||||
let body={};try{body=JSON.parse(document.getElementById("settingsPayload").value)}catch(e){document.getElementById("saveSettingsResult").textContent="JSON格式错误";return}
|
||||
const r=await api("/api/settings.php",{method:"POST",body});document.getElementById("saveSettingsResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnLoadLogs").addEventListener("click",async()=>{
|
||||
const q={page:Number(document.getElementById("logsPage").value||1),perPage:Number(document.getElementById("logsPerPage").value||10),search:document.getElementById("logsSearch").value.trim(),type:document.getElementById("logsType").value,startDate:document.getElementById("logsStartDate").value,endDate:document.getElementById("logsEndDate").value}
|
||||
const r=await api("/api/logs.php",{query:q});renderLogs(r.data?.data?.logs||[])
|
||||
})
|
||||
document.getElementById("btnDeleteLogs").addEventListener("click",async()=>{
|
||||
const q={id:document.getElementById("deleteLogId").value.trim(),all:document.getElementById("deleteAllLogs").checked?true:undefined}
|
||||
const r=await api("/api/logs.php",{method:"DELETE",query:q});document.getElementById("deleteLogsResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnLoadContacts").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("contactsUsername").value.trim(),page:Number(document.getElementById("contactsPage").value||1),perPage:Number(document.getElementById("contactsPerPage").value||20),search:document.getElementById("contactsSearch").value.trim()}
|
||||
const r=await api("/api/contacts.php",{query:q});renderContacts(r.data?.data?.contacts||[])
|
||||
})
|
||||
document.getElementById("btnContactDetail").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("contactDetailUsername").value.trim(),id:Number(document.getElementById("contactDetailId").value)}
|
||||
const r=await api("/api/contacts.php",{query:q});document.getElementById("contactDetailResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnAddContact").addEventListener("click",async()=>{
|
||||
const body={username:document.getElementById("contactUsername").value.trim(),name:document.getElementById("contactName").value.trim(),email:document.getElementById("contactEmail").value.trim(),phone:document.getElementById("contactPhone").value.trim(),company:document.getElementById("contactCompany").value.trim(),department:document.getElementById("contactDepartment").value.trim(),position:document.getElementById("contactPosition").value.trim()}
|
||||
const r=await api("/api/contacts.php",{method:"POST",body});document.getElementById("contactMutationResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnEditContact").addEventListener("click",async()=>{
|
||||
const body={id:Number(document.getElementById("contactId").value),username:document.getElementById("contactUsername").value.trim(),name:document.getElementById("contactName").value.trim(),email:document.getElementById("contactEmail").value.trim(),phone:document.getElementById("contactPhone").value.trim(),company:document.getElementById("contactCompany").value.trim(),department:document.getElementById("contactDepartment").value.trim(),position:document.getElementById("contactPosition").value.trim()}
|
||||
const r=await api("/api/contacts.php",{method:"PUT",body});document.getElementById("contactMutationResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnDeleteContact").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("contactUsername").value.trim(),id:Number(document.getElementById("contactId").value)}
|
||||
const r=await api("/api/contacts.php",{method:"DELETE",query:q});document.getElementById("contactMutationResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnLoadStats").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("statsUsername").value.trim(),startDate:document.getElementById("statsStartDate").value,endDate:document.getElementById("statsEndDate").value,type:document.getElementById("statsType").value}
|
||||
const r=await api("/api/stats.php",{query:q});document.getElementById("statsResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnMailboxInfo").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("mailboxUsername").value.trim()}
|
||||
const r=await api("/api/mailbox.php",{query:q});document.getElementById("mailboxResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnMailboxQuota").addEventListener("click",async()=>{
|
||||
const q={username:document.getElementById("mailboxUsername").value.trim(),action:"quota"}
|
||||
const r=await api("/api/mailbox.php",{query:q});document.getElementById("mailboxResult").textContent=pretty(r.data)
|
||||
})
|
||||
document.getElementById("btnSendConsole").addEventListener("click",async()=>{
|
||||
const method=document.getElementById("consoleMethod").value
|
||||
const p=document.getElementById("consolePath").value
|
||||
let body=undefined
|
||||
if(method==="POST"||method==="PUT"){try{body=JSON.parse(document.getElementById("consoleBody").value||"{}")}catch(e){document.getElementById("consoleResult").textContent="JSON格式错误";return}}
|
||||
const r=await api(p,{method,body})
|
||||
document.getElementById("consoleResult").textContent=pretty(r.data)
|
||||
})
|
||||
})
|
||||
const ping=async()=>{const el=document.getElementById("backendStatus");const r=await api("/api/settings.php");setStatus(el,r.ok)}
|
||||
const renderUsers=(users)=>{const tbody=document.querySelector("#usersTable tbody");tbody.innerHTML="";users.forEach(u=>{const tr=document.createElement("tr");tr.innerHTML=`<td>${u.username||""}</td><td>${u.email||""}</td><td>${u.is_admin?"是":"否"}</td><td>${u.is_enabled?"是":"否"}</td><td><button data-username="${u.username}">删除</button></td>`;tbody.appendChild(tr)});tbody.querySelectorAll("button").forEach(btn=>btn.addEventListener("click",async()=>{const r=await api("/api/users.php",{method:"DELETE",query:{username:btn.dataset.username}});alert(pretty(r.data))}))}
|
||||
const renderEmails=(emails)=>{const tbody=document.querySelector("#emailsTable tbody");tbody.innerHTML="";emails.forEach(e=>{const tr=document.createElement("tr");tr.innerHTML=`<td>${e.id}</td><td>${e.subject||""}</td><td>${e.from||""}</td><td>${e.date||""}</td><td>${e.folder||""}</td><td><button data-id="${e.id}">详情</button></td>`;tbody.appendChild(tr)});tbody.querySelectorAll("button").forEach(btn=>btn.addEventListener("click",()=>{document.getElementById("emailDetailId").value=btn.dataset.id;document.getElementById("btnEmailDetail").click()}))}
|
||||
const renderLogs=(logs)=>{const tbody=document.querySelector("#logsTable tbody");tbody.innerHTML="";logs.forEach(l=>{const tr=document.createElement("tr");tr.innerHTML=`<td>${l.id}</td><td>${l.type||""}</td><td>${l.message||""}</td><td>${l.ip||""}</td><td>${l.user_id||""}</td><td>${l.created_at||""}</td><td></td>`;tbody.appendChild(tr)})}
|
||||
const renderContacts=(contacts)=>{const tbody=document.querySelector("#contactsTable tbody");tbody.innerHTML="";contacts.forEach(c=>{const tr=document.createElement("tr");tr.innerHTML=`<td>${c.id}</td><td>${c.name||""}</td><td>${c.email||""}</td><td>${c.phone||""}</td><td>${c.company||""}</td><td>${c.department||""}</td><td>${c.position||""}</td><td><button data-id="${c.id}">详情</button></td>`;tbody.appendChild(tr)});tbody.querySelectorAll("button").forEach(btn=>btn.addEventListener("click",()=>{document.getElementById("contactDetailId").value=btn.dataset.id;document.getElementById("btnContactDetail").click()}))}
|
||||
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<Topbar />
|
||||
<Tabs v-if="authed" v-model="tab" />
|
||||
<main>
|
||||
<LoginView v-if="!authed" />
|
||||
<DashboardView v-else-if="tab==='dashboard'" />
|
||||
<UsersView v-else-if="tab==='users'" />
|
||||
<EmailsView v-else-if="tab==='emails'" />
|
||||
<SettingsView v-else-if="tab==='settings'" />
|
||||
<LogsView v-else-if="tab==='logs'" />
|
||||
<ContactsView v-else-if="tab==='contacts'" />
|
||||
<StatsView v-else-if="tab==='stats'" />
|
||||
<MailboxView v-else-if="tab==='mailbox'" />
|
||||
<ConsoleView v-else-if="tab==='console'" />
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, onMounted, onBeforeUnmount } from 'vue'
|
||||
import Topbar from './components/Topbar.vue'
|
||||
import Tabs from './components/Tabs.vue'
|
||||
import DashboardView from './views/DashboardView.vue'
|
||||
import LoginView from './views/LoginView.vue'
|
||||
import UsersView from './views/UsersView.vue'
|
||||
import EmailsView from './views/EmailsView.vue'
|
||||
import SettingsView from './views/SettingsView.vue'
|
||||
import LogsView from './views/LogsView.vue'
|
||||
import ContactsView from './views/ContactsView.vue'
|
||||
import StatsView from './views/StatsView.vue'
|
||||
import MailboxView from './views/MailboxView.vue'
|
||||
import ConsoleView from './views/ConsoleView.vue'
|
||||
import { isAuthed } from './composables/auth'
|
||||
|
||||
const tab = ref('dashboard')
|
||||
const authed = isAuthed
|
||||
const allowed = ['dashboard','users','emails','settings','logs','contacts','stats','mailbox','console','login']
|
||||
const readHash = () => {
|
||||
const slug = (window.location.hash || '').replace(/^#\/?/, '') || 'dashboard'
|
||||
return allowed.includes(slug) ? slug : 'dashboard'
|
||||
}
|
||||
const writeHash = (slug) => {
|
||||
const h = `#/${slug}`
|
||||
if (window.location.hash !== h) history.replaceState(null, '', h)
|
||||
}
|
||||
watch(tab, (v) => writeHash(v))
|
||||
const onHashChange = () => { const slug = readHash(); if (tab.value !== slug) tab.value = slug }
|
||||
onMounted(() => {
|
||||
const slug = readHash()
|
||||
tab.value = authed.value ? (slug === 'login' ? 'dashboard' : slug) : 'login'
|
||||
window.addEventListener('hashchange', onHashChange)
|
||||
})
|
||||
watch(authed, (v) => {
|
||||
if (v) {
|
||||
if (readHash() === 'login') writeHash('dashboard')
|
||||
} else {
|
||||
writeHash('login')
|
||||
}
|
||||
})
|
||||
onBeforeUnmount(() => { window.removeEventListener('hashchange', onHashChange) })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<div v-if="message" class="error">{{ message }}</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({ message: { type: String, default: '' } })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.error {
|
||||
padding: 8px 12px;
|
||||
color: #dc2626;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<div v-if="show" class="loader">加载中...</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({ show: { type: Boolean, default: false } })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.loader {
|
||||
padding: 8px 12px;
|
||||
color: #2563eb;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<nav class="tabs">
|
||||
<button :class="{active: modelValue==='dashboard'}" @click="$emit('update:modelValue','dashboard')">仪表台</button>
|
||||
<button :class="{active: modelValue==='users'}" @click="$emit('update:modelValue','users')">用户</button>
|
||||
<button :class="{active: modelValue==='emails'}" @click="$emit('update:modelValue','emails')">邮件</button>
|
||||
<button :class="{active: modelValue==='settings'}" @click="$emit('update:modelValue','settings')">设置</button>
|
||||
<button :class="{active: modelValue==='logs'}" @click="$emit('update:modelValue','logs')">日志</button>
|
||||
<button :class="{active: modelValue==='contacts'}" @click="$emit('update:modelValue','contacts')">通讯录</button>
|
||||
<button :class="{active: modelValue==='stats'}" @click="$emit('update:modelValue','stats')">统计</button>
|
||||
<button :class="{active: modelValue==='mailbox'}" @click="$emit('update:modelValue','mailbox')">邮箱</button>
|
||||
<button :class="{active: modelValue==='console'}" @click="$emit('update:modelValue','console')">API调试台</button>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({ modelValue: { type: String, required: true } })
|
||||
defineEmits(['update:modelValue'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<header class="topbar">
|
||||
<div class="brand">邮件服务器管理</div>
|
||||
<div class="controls">
|
||||
<label>后端地址</label>
|
||||
<input v-model="localBase" placeholder="http://localhost:8000" />
|
||||
<button @click="save">保存</button>
|
||||
<span :style="{color: backendOk ? '#16a34a' : '#dc2626'}" class="status">{{ backendOk ? '后端可用' : '后端不可访问' }}</span>
|
||||
<button v-if="authed" @click="doLogout">退出登录</button>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { baseURL, backendOk, saveBaseURL, ping } from '../composables/api'
|
||||
import { isAuthed, logout } from '../composables/auth'
|
||||
|
||||
const localBase = ref('')
|
||||
const save = () => { saveBaseURL(localBase.value.trim()); ping() }
|
||||
onMounted(() => { localBase.value = baseURL.value; ping() })
|
||||
const authed = isAuthed
|
||||
const doLogout = () => { logout() }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,31 @@
|
||||
import { ref } from 'vue'
|
||||
import { token } from './auth'
|
||||
|
||||
export const baseURL = ref(localStorage.getItem('baseURL') || 'http://localhost:8000')
|
||||
export const backendOk = ref(false)
|
||||
|
||||
const qs = o => Object.entries(o).filter(([_, v]) => v !== '' && v !== undefined && v !== null).map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join('&')
|
||||
const path = p => p.startsWith('/') ? p : `/${p}`
|
||||
|
||||
export const api = async (p, opt = {}) => {
|
||||
const url = new URL(path(p), baseURL.value)
|
||||
const m = (opt.method || 'GET').toUpperCase()
|
||||
const h = { 'Content-Type': 'application/json' }
|
||||
if (token.value) h['Authorization'] = `Bearer ${token.value}`
|
||||
const o = { method: m, headers: h }
|
||||
if (opt.query && Object.keys(opt.query).length) url.search = qs(opt.query)
|
||||
if (m === 'POST' || m === 'PUT') o.body = JSON.stringify(opt.body || {})
|
||||
try {
|
||||
const r = await fetch(url.toString(), o)
|
||||
const data = await r.json().catch(() => ({}))
|
||||
return { ok: r.ok, status: r.status, data }
|
||||
} catch (e) {
|
||||
return { ok: false, status: 0, data: { success: false, message: String(e) } }
|
||||
}
|
||||
}
|
||||
|
||||
export const pretty = v => typeof v === 'string' ? v : JSON.stringify(v, null, 2)
|
||||
|
||||
export const saveBaseURL = v => { baseURL.value = v; localStorage.setItem('baseURL', v) }
|
||||
|
||||
export const ping = async () => { const r = await api('/api/settings.php'); backendOk.value = r.ok; return r }
|
||||
@ -0,0 +1,24 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const isAuthed = ref(localStorage.getItem('auth') === 'true')
|
||||
export const token = ref(localStorage.getItem('token') || '')
|
||||
export const username = ref(localStorage.getItem('username') || '')
|
||||
|
||||
export const setAuth = ({ token: t = '', username: u = '' } = {}) => {
|
||||
isAuthed.value = true
|
||||
token.value = t
|
||||
username.value = u
|
||||
localStorage.setItem('auth', 'true')
|
||||
localStorage.setItem('token', t)
|
||||
localStorage.setItem('username', u)
|
||||
}
|
||||
|
||||
export const logout = () => {
|
||||
isAuthed.value = false
|
||||
token.value = ''
|
||||
username.value = ''
|
||||
localStorage.removeItem('auth')
|
||||
localStorage.removeItem('token')
|
||||
localStorage.removeItem('username')
|
||||
}
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useRequest = () => {
|
||||
const loading = ref(false)
|
||||
const error = ref('')
|
||||
const run = async fn => {
|
||||
error.value = ''
|
||||
loading.value = true
|
||||
try {
|
||||
const r = await fn()
|
||||
if (!r?.ok) error.value = r?.data?.message || '请求失败'
|
||||
return r
|
||||
} catch (e) {
|
||||
error.value = String(e)
|
||||
return { ok: false, data: {} }
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
return { loading, error, run }
|
||||
}
|
||||
|
||||
@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>联系人列表</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="row">
|
||||
<input v-model="contactsQuery.username" placeholder="用户名" />
|
||||
<input v-model.number="contactsQuery.page" type="number" />
|
||||
<input v-model.number="contactsQuery.perPage" type="number" />
|
||||
<input v-model="contactsQuery.search" placeholder="关键词" />
|
||||
<button @click="loadContacts">加载</button>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>ID</th><th>姓名</th><th>邮箱</th><th>电话</th><th>公司</th><th>部门</th><th>职位</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="c in contacts" :key="c.id">
|
||||
<td>{{ c.id }}</td>
|
||||
<td>{{ c.name || '' }}</td>
|
||||
<td>{{ c.email || '' }}</td>
|
||||
<td>{{ c.phone || '' }}</td>
|
||||
<td>{{ c.company || '' }}</td>
|
||||
<td>{{ c.department || '' }}</td>
|
||||
<td>{{ c.position || '' }}</td>
|
||||
<td><button @click="contactDetailId = String(c.id); contactDetail()">详情</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>联系人详情</h2>
|
||||
<div class="row">
|
||||
<input v-model="contactDetailUsername" placeholder="用户名" />
|
||||
<input v-model="contactDetailId" placeholder="联系人ID" />
|
||||
<button @click="contactDetail">获取</button>
|
||||
</div>
|
||||
<pre>{{ pretty(contactDetailResult) }}</pre>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>新增/编辑/删除联系人</h2>
|
||||
<div class="form">
|
||||
<input v-model="contactForm.id" placeholder="ID" />
|
||||
<input v-model="contactForm.username" placeholder="用户名" />
|
||||
<input v-model="contactForm.name" placeholder="姓名" />
|
||||
<input v-model="contactForm.email" placeholder="邮箱" />
|
||||
<input v-model="contactForm.phone" placeholder="电话" />
|
||||
<input v-model="contactForm.company" placeholder="公司" />
|
||||
<input v-model="contactForm.department" placeholder="部门" />
|
||||
<input v-model="contactForm.position" placeholder="职位" />
|
||||
<div class="row">
|
||||
<button @click="addContact">添加</button>
|
||||
<button @click="editContact">编辑</button>
|
||||
<button class="danger" @click="deleteContact">删除</button>
|
||||
</div>
|
||||
</div>
|
||||
<pre>{{ pretty(contactMutationResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const contactsQuery = reactive({ username: 'admin', page: 1, perPage: 20, search: '' })
|
||||
const contacts = ref([])
|
||||
const { loading, error, run } = useRequest()
|
||||
const loadContacts = async () => { const r = await run(() => api('/api/contacts.php', { query: contactsQuery })); if (r?.ok) contacts.value = r.data?.data?.contacts || [] }
|
||||
const contactDetailUsername = ref('admin')
|
||||
const contactDetailId = ref('')
|
||||
const contactDetailResult = ref({})
|
||||
const contactDetail = async () => { const r = await run(() => api('/api/contacts.php', { query: { username: contactDetailUsername.value.trim(), id: Number(contactDetailId.value) } })); if (r?.ok) contactDetailResult.value = r.data }
|
||||
const contactForm = reactive({ id: '', username: 'admin', name: '', email: '', phone: '', company: '', department: '', position: '' })
|
||||
const contactMutationResult = ref({})
|
||||
const addContact = async () => { const r = await run(() => api('/api/contacts.php', { method: 'POST', body: contactForm })); if (r?.ok) contactMutationResult.value = r.data }
|
||||
const editContact = async () => { const r = await run(() => api('/api/contacts.php', { method: 'PUT', body: { ...contactForm, id: Number(contactForm.id || 0) } })); if (r?.ok) contactMutationResult.value = r.data }
|
||||
const deleteContact = async () => { const r = await run(() => api('/api/contacts.php', { method: 'DELETE', query: { username: contactForm.username.trim(), id: Number(contactForm.id || 0) } })); if (r?.ok) contactMutationResult.value = r.data }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>快速检查</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="grid">
|
||||
<div>
|
||||
<div class="label">设置</div>
|
||||
<button @click="checkSettings">获取设置</button>
|
||||
<pre>{{ pretty(checkSettingsResult) }}</pre>
|
||||
</div>
|
||||
<div>
|
||||
<div class="label">用户列表</div>
|
||||
<button @click="checkUsers">获取用户列表</button>
|
||||
<pre>{{ pretty(checkUsersResult) }}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const checkSettingsResult = ref({})
|
||||
const checkUsersResult = ref({})
|
||||
const { loading, error, run } = useRequest()
|
||||
const checkSettings = async () => { const r = await run(() => api('/api/settings.php')); if (r?.ok) checkSettingsResult.value = r.data }
|
||||
const checkUsers = async () => { const r = await run(() => api('/api/users.php', { query: { page: 1, perPage: 10 } })); if (r?.ok) checkUsersResult.value = r.data }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>邮件列表</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="row">
|
||||
<input v-model="emailsQuery.username" placeholder="用户名" />
|
||||
<select v-model="emailsQuery.folder">
|
||||
<option value="inbox">inbox</option>
|
||||
<option value="sent">sent</option>
|
||||
<option value="draft">draft</option>
|
||||
<option value="trash">trash</option>
|
||||
</select>
|
||||
<input v-model.number="emailsQuery.page" type="number" />
|
||||
<input v-model.number="emailsQuery.perPage" type="number" />
|
||||
<input v-model="emailsQuery.search" placeholder="搜索关键词" />
|
||||
<button @click="loadEmails">加载</button>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>ID</th><th>主题</th><th>发件人</th><th>日期</th><th>文件夹</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="e in emails" :key="e.id">
|
||||
<td>{{ e.id }}</td>
|
||||
<td>{{ e.subject || '' }}</td>
|
||||
<td>{{ e.from || '' }}</td>
|
||||
<td>{{ e.date || '' }}</td>
|
||||
<td>{{ e.folder || '' }}</td>
|
||||
<td><button @click="emailDetailId = String(e.id); emailDetail()">详情</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>邮件详情</h2>
|
||||
<div class="row">
|
||||
<input v-model="emailDetailUsername" placeholder="用户名" />
|
||||
<input v-model="emailDetailId" placeholder="邮件ID" />
|
||||
<button @click="emailDetail">获取详情</button>
|
||||
</div>
|
||||
<pre>{{ pretty(emailDetailResult) }}</pre>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>发送邮件/草稿</h2>
|
||||
<div class="form">
|
||||
<input v-model="sendMail.username" placeholder="用户名" />
|
||||
<input v-model="sendMail.to" placeholder="收件人邮箱" />
|
||||
<input v-model="sendMail.subject" placeholder="主题" />
|
||||
<textarea v-model="sendMail.content" placeholder="内容"></textarea>
|
||||
<label><input v-model="sendMail.isDraft" type="checkbox" />保存为草稿</label>
|
||||
<button @click="sendMailSubmit">提交</button>
|
||||
</div>
|
||||
<pre>{{ pretty(sendMailResult) }}</pre>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>更新与删除</h2>
|
||||
<div class="row">
|
||||
<input v-model="updateMail.id" placeholder="邮件ID" />
|
||||
<input v-model="updateMail.username" placeholder="用户名" />
|
||||
<label>已读
|
||||
<select v-model="updateMail.isRead">
|
||||
<option value="">不变</option>
|
||||
<option value="1">1</option>
|
||||
<option value="0">0</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>文件夹
|
||||
<select v-model="updateMail.folder">
|
||||
<option value="">不变</option>
|
||||
<option value="inbox">inbox</option>
|
||||
<option value="sent">sent</option>
|
||||
<option value="draft">draft</option>
|
||||
<option value="trash">trash</option>
|
||||
</select>
|
||||
</label>
|
||||
<button @click="updateEmail">更新</button>
|
||||
<button class="danger" @click="deleteEmail">删除</button>
|
||||
</div>
|
||||
<pre>{{ pretty(updateDeleteResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const emailsQuery = reactive({ username: 'admin', folder: 'inbox', page: 1, perPage: 10, search: '' })
|
||||
const emails = ref([])
|
||||
const { loading, error, run } = useRequest()
|
||||
const loadEmails = async () => { const r = await run(() => api('/api/emails.php', { query: emailsQuery })); if (r?.ok) emails.value = r.data?.data?.emails || [] }
|
||||
|
||||
const emailDetailUsername = ref('admin')
|
||||
const emailDetailId = ref('')
|
||||
const emailDetailResult = ref({})
|
||||
const emailDetail = async () => { const r = await run(() => api('/api/emails.php', { query: { username: emailDetailUsername.value.trim(), id: emailDetailId.value.trim() } })); if (r?.ok) emailDetailResult.value = r.data }
|
||||
|
||||
const sendMail = reactive({ username: 'admin', to: '', subject: '', content: '', isDraft: false })
|
||||
const sendMailResult = ref({})
|
||||
const sendMailSubmit = async () => { const r = await run(() => api('/api/emails.php', { method: 'POST', body: sendMail })); if (r?.ok) sendMailResult.value = r.data }
|
||||
|
||||
const updateMail = reactive({ id: '', username: 'admin', isRead: '', folder: '' })
|
||||
const updateDeleteResult = ref({})
|
||||
const updateEmail = async () => {
|
||||
const body = { id: updateMail.id.trim(), username: updateMail.username.trim() }
|
||||
if (updateMail.isRead !== '') body.isRead = Number(updateMail.isRead)
|
||||
if (updateMail.folder !== '') body.folder = updateMail.folder
|
||||
const r = await run(() => api('/api/emails.php', { method: 'PUT', body }))
|
||||
if (r?.ok) updateDeleteResult.value = r.data
|
||||
}
|
||||
const deleteEmail = async () => {
|
||||
const r = await run(() => api('/api/emails.php', { method: 'DELETE', query: { id: updateMail.id.trim(), username: updateMail.username.trim() } }))
|
||||
if (r?.ok) updateDeleteResult.value = r.data
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>登录</h2>
|
||||
<div class="row">
|
||||
<input v-model="form.username" placeholder="用户名" />
|
||||
<input v-model="form.password" placeholder="密码" type="password" />
|
||||
<button @click="login">登录</button>
|
||||
</div>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<pre>{{ pretty(result) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import { setAuth } from '../composables/auth'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const form = reactive({ username: 'admin', password: '' })
|
||||
const result = ref({})
|
||||
const { loading, error, run } = useRequest()
|
||||
const login = async () => {
|
||||
const r = await run(() => api('/api/users.php', { method: 'POST', body: { login: true, username: form.username.trim(), password: form.password } }))
|
||||
if (r?.ok && r.data?.success && r.data?.data?.token) {
|
||||
result.value = r.data
|
||||
const t = r.data.data.token
|
||||
setAuth({ token: t, username: form.username.trim() })
|
||||
} else {
|
||||
result.value = r.data
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>日志列表</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="row">
|
||||
<input v-model.number="logsQuery.page" type="number" />
|
||||
<input v-model.number="logsQuery.perPage" type="number" />
|
||||
<input v-model="logsQuery.search" placeholder="关键词" />
|
||||
<select v-model="logsQuery.type"><option value="">全部</option><option value="info">info</option><option value="warning">warning</option><option value="error">error</option></select>
|
||||
<input v-model="logsQuery.startDate" type="date" />
|
||||
<input v-model="logsQuery.endDate" type="date" />
|
||||
<button @click="loadLogs">加载</button>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>ID</th><th>类型</th><th>消息</th><th>IP</th><th>用户</th><th>时间</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="l in logs" :key="l.id">
|
||||
<td>{{ l.id }}</td>
|
||||
<td>{{ l.type || '' }}</td>
|
||||
<td>{{ l.message || '' }}</td>
|
||||
<td>{{ l.ip || '' }}</td>
|
||||
<td>{{ l.user_id || '' }}</td>
|
||||
<td>{{ l.created_at || '' }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>删除日志</h2>
|
||||
<div class="row">
|
||||
<input v-model="deleteLogs.id" placeholder="日志ID" />
|
||||
<label><input v-model="deleteLogs.all" type="checkbox" />删除所有</label>
|
||||
<button class="danger" @click="deleteLogsSubmit">删除</button>
|
||||
</div>
|
||||
<pre>{{ pretty(deleteLogsResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const logsQuery = reactive({ page: 1, perPage: 10, search: '', type: '', startDate: '', endDate: '' })
|
||||
const logs = ref([])
|
||||
const deleteLogs = reactive({ id: '', all: false })
|
||||
const deleteLogsResult = ref({})
|
||||
const { loading, error, run } = useRequest()
|
||||
const loadLogs = async () => { const r = await run(() => api('/api/logs.php', { query: logsQuery })); if (r?.ok) logs.value = r.data?.data?.logs || [] }
|
||||
const deleteLogsSubmit = async () => { const r = await run(() => api('/api/logs.php', { method: 'DELETE', query: { id: deleteLogs.id.trim(), all: deleteLogs.all || undefined } })); if (r?.ok) deleteLogsResult.value = r.data }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>邮箱信息</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="row">
|
||||
<input v-model="mailboxUsername" placeholder="用户名" />
|
||||
<button @click="mailboxInfo">获取信息</button>
|
||||
<button @click="mailboxQuota">获取配额</button>
|
||||
</div>
|
||||
<pre>{{ pretty(mailboxResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const mailboxUsername = ref('admin')
|
||||
const mailboxResult = ref({})
|
||||
const { loading, error, run } = useRequest()
|
||||
const mailboxInfo = async () => { const r = await run(() => api('/api/mailbox.php', { query: { username: mailboxUsername.value.trim() } })); if (r?.ok) mailboxResult.value = r.data }
|
||||
const mailboxQuota = async () => { const r = await run(() => api('/api/mailbox.php', { query: { username: mailboxUsername.value.trim(), action: 'quota' } })); if (r?.ok) mailboxResult.value = r.data }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>获取服务器设置</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<button @click="getSettings">获取</button>
|
||||
<pre>{{ pretty(getSettingsResult) }}</pre>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>保存服务器设置</h2>
|
||||
<textarea v-model="settingsPayload" placeholder='{"smtp":{"port":25,"host":"0.0.0.0","max_connections":100},"pop3":{"port":110,"host":"0.0.0.0","max_connections":100},"server":{"domain":"test.com","max_email_size":10485760}}'></textarea>
|
||||
<button @click="saveSettings">保存</button>
|
||||
<pre>{{ pretty(saveSettingsResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const getSettingsResult = ref({})
|
||||
const settingsPayload = ref('')
|
||||
const saveSettingsResult = ref({})
|
||||
const { loading, error, run } = useRequest()
|
||||
const getSettings = async () => { const r = await run(() => api('/api/settings.php')); if (r?.ok) getSettingsResult.value = r.data }
|
||||
const saveSettings = async () => {
|
||||
let body = {}
|
||||
try { body = JSON.parse(settingsPayload.value || '{}') } catch (e) { saveSettingsResult.value = 'JSON格式错误'; return }
|
||||
const r = await run(() => api('/api/settings.php', { method: 'POST', body }))
|
||||
if (r?.ok) saveSettingsResult.value = r.data
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>统计</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="row">
|
||||
<input v-model="statsQuery.username" placeholder="用户名" />
|
||||
<input v-model="statsQuery.startDate" type="date" />
|
||||
<input v-model="statsQuery.endDate" type="date" />
|
||||
<select v-model="statsQuery.type"><option value="mail">mail</option><option value="traffic">traffic</option><option value="send">send</option></select>
|
||||
<button @click="loadStats">加载</button>
|
||||
</div>
|
||||
<pre>{{ pretty(statsResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { api, pretty } from '../composables/api'
|
||||
import { useRequest } from '../composables/request'
|
||||
import Loader from '../components/Loader.vue'
|
||||
import ErrorMessage from '../components/ErrorMessage.vue'
|
||||
|
||||
const statsQuery = reactive({ username: 'admin', startDate: '', endDate: '', type: 'mail' })
|
||||
const statsResult = ref({})
|
||||
const { loading, error, run } = useRequest()
|
||||
const loadStats = async () => { const r = await run(() => api('/api/stats.php', { query: statsQuery })); if (r?.ok) statsResult.value = r.data }
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<section class="section">
|
||||
<div class="card">
|
||||
<h2>用户列表</h2>
|
||||
<Loader :show="loading" />
|
||||
<ErrorMessage :message="error" />
|
||||
<div class="row">
|
||||
<input v-model.number="usersQuery.page" type="number" />
|
||||
<input v-model.number="usersQuery.perPage" type="number" />
|
||||
<input v-model="usersQuery.search" placeholder="搜索关键词" />
|
||||
<button @click="loadUsers">加载</button>
|
||||
</div>
|
||||
<table id="usersTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>用户名</th>
|
||||
<th>邮箱</th>
|
||||
<th>管理员</th>
|
||||
<th>启用</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="u in users" :key="u.username">
|
||||
<td>{{ u.username || "" }}</td>
|
||||
<td>{{ u.email || "" }}</td>
|
||||
<td>{{ u.is_admin ? "是" : "否" }}</td>
|
||||
<td>{{ u.is_enabled ? "是" : "否" }}</td>
|
||||
<td><button @click="deleteUser(u.username)">删除</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>添加用户</h2>
|
||||
<div class="form">
|
||||
<input v-model="addUser.username" placeholder="用户名" />
|
||||
<input v-model="addUser.email" placeholder="邮箱" />
|
||||
<input v-model="addUser.password" placeholder="密码" type="password" />
|
||||
<label
|
||||
><input v-model="addUser.is_admin" type="checkbox" />管理员</label
|
||||
>
|
||||
<label
|
||||
><input v-model="addUser.is_enabled" type="checkbox" />启用</label
|
||||
>
|
||||
<button @click="createUser">添加</button>
|
||||
</div>
|
||||
<pre>{{ pretty(addUserResult) }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue";
|
||||
import { api, pretty } from "../composables/api";
|
||||
import { useRequest } from "../composables/request";
|
||||
import Loader from "../components/Loader.vue";
|
||||
import ErrorMessage from "../components/ErrorMessage.vue";
|
||||
|
||||
const usersQuery = reactive({ page: 1, perPage: 10, search: "" });
|
||||
const users = ref([]);
|
||||
const { loading, error, run } = useRequest();
|
||||
const loadUsers = async () => {
|
||||
const r = await run(() => api("/api/users.php", { query: usersQuery }));
|
||||
if (r?.ok) users.value = r.data?.data?.users || [];
|
||||
};
|
||||
const deleteUser = async (username) => {
|
||||
const r = await run(() =>
|
||||
api("/api/users.php", { method: "DELETE", query: { username } })
|
||||
);
|
||||
if (r?.ok) {
|
||||
alert(pretty(r.data));
|
||||
loadUsers();
|
||||
}
|
||||
};
|
||||
|
||||
const addUser = reactive({
|
||||
username: "",
|
||||
email: "",
|
||||
password: "",
|
||||
is_admin: false,
|
||||
is_enabled: true,
|
||||
});
|
||||
const addUserResult = ref({});
|
||||
const createUser = async () => {
|
||||
const r = await run(() =>
|
||||
api("/api/users.php", { method: "POST", body: addUser })
|
||||
);
|
||||
if (r?.ok) addUserResult.value = r.data;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||