Compare commits
20 Commits
7e7c638ef1
...
feature/pr
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d57345634 | |||
| 0a82fca6d3 | |||
| 1e57e7c33e | |||
| c484948a5e | |||
| 4748b15cc4 | |||
| 9ccba70ede | |||
| 1868b3e248 | |||
| 9f2627faf8 | |||
| a7b1fb902c | |||
| 6afce2ef58 | |||
| fff01ff30f | |||
| a576a93a0b | |||
| a33426f3c2 | |||
| 0dc309642c | |||
| 8dc1a2dc3c | |||
| e477242f16 | |||
| f75156bc62 | |||
| e379f490a4 | |||
| c210ed7fac | |||
| 92b7f60c75 |
197
package-lock.json
generated
197
package-lock.json
generated
@@ -13,6 +13,7 @@
|
|||||||
"@vueuse/core": "^10.2.1",
|
"@vueuse/core": "^10.2.1",
|
||||||
"@vueuse/integrations": "^10.2.1",
|
"@vueuse/integrations": "^10.2.1",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
|
"axios-rate-limit": "^1.3.1",
|
||||||
"loglevel": "^1.8.1",
|
"loglevel": "^1.8.1",
|
||||||
"loglevel-plugin-prefix": "^0.8.4",
|
"loglevel-plugin-prefix": "^0.8.4",
|
||||||
"oidc-client-ts": "^3.0.1",
|
"oidc-client-ts": "^3.0.1",
|
||||||
@@ -554,9 +555,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz",
|
||||||
"integrity": "sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==",
|
"integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -567,9 +568,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-android-arm64": {
|
"node_modules/@rollup/rollup-android-arm64": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz",
|
||||||
"integrity": "sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==",
|
"integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -580,9 +581,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-darwin-arm64": {
|
"node_modules/@rollup/rollup-darwin-arm64": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz",
|
||||||
"integrity": "sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==",
|
"integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -593,9 +594,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-darwin-x64": {
|
"node_modules/@rollup/rollup-darwin-x64": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz",
|
||||||
"integrity": "sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==",
|
"integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -606,9 +607,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz",
|
||||||
"integrity": "sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==",
|
"integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -619,9 +620,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz",
|
||||||
"integrity": "sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==",
|
"integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
@@ -632,9 +633,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz",
|
||||||
"integrity": "sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==",
|
"integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -645,9 +646,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz",
|
||||||
"integrity": "sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==",
|
"integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -658,9 +659,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
|
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz",
|
||||||
"integrity": "sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==",
|
"integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
@@ -671,9 +672,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz",
|
||||||
"integrity": "sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==",
|
"integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"riscv64"
|
"riscv64"
|
||||||
],
|
],
|
||||||
@@ -684,9 +685,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
"node_modules/@rollup/rollup-linux-s390x-gnu": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz",
|
||||||
"integrity": "sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==",
|
"integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
@@ -697,9 +698,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz",
|
||||||
"integrity": "sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==",
|
"integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -710,9 +711,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-linux-x64-musl": {
|
"node_modules/@rollup/rollup-linux-x64-musl": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz",
|
||||||
"integrity": "sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==",
|
"integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -723,9 +724,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz",
|
||||||
"integrity": "sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==",
|
"integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
@@ -736,9 +737,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz",
|
||||||
"integrity": "sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==",
|
"integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"ia32"
|
"ia32"
|
||||||
],
|
],
|
||||||
@@ -749,9 +750,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz",
|
||||||
"integrity": "sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==",
|
"integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
@@ -1355,15 +1356,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.6.8",
|
"version": "1.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.8.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz",
|
||||||
"integrity": "sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==",
|
"integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.6",
|
"follow-redirects": "^1.15.6",
|
||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"proxy-from-env": "^1.1.0"
|
"proxy-from-env": "^1.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/axios-rate-limit": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/axios-rate-limit/-/axios-rate-limit-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-jt5E4FKY8Crqpe8RcyKZUHR9aiNHFg2L9oM7DqeuYj1oj0pV9AJWUhvn2Z9xMwGMnU6VRBEcZJFmW7ruiVx4Hw==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"axios": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/balanced-match": {
|
"node_modules/balanced-match": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||||
@@ -1392,12 +1401,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braces": {
|
"node_modules/braces": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fill-range": "^7.0.1"
|
"fill-range": "^7.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@@ -1454,9 +1463,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001620",
|
"version": "1.0.30001621",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001620.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001621.tgz",
|
||||||
"integrity": "sha512-WJvYsOjd1/BYUY6SNGUosK9DUidBPDTnOARHp3fSmFO1ekdxaY6nKRttEVrfMmYi80ctS0kz1wiWmm14fVc3ew==",
|
"integrity": "sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1691,9 +1700,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.4.773",
|
"version": "1.4.777",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.773.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.777.tgz",
|
||||||
"integrity": "sha512-87eHF+h3PlCRwbxVEAw9KtK3v7lWfc/sUDr0W76955AdYTG4bV/k0zrl585Qnj/skRMH2qOSiE+kqMeOQ+LOpw==",
|
"integrity": "sha512-n02NCwLJ3wexLfK/yQeqfywCblZqLcXphzmid5e8yVPdtEcida7li0A5WQKghHNG0FeOMCzeFOzEbtAh5riXFw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/emoji-regex": {
|
"node_modules/emoji-regex": {
|
||||||
@@ -1830,9 +1839,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fill-range": {
|
"node_modules/fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"to-regex-range": "^5.0.1"
|
"to-regex-range": "^5.0.1"
|
||||||
@@ -1947,13 +1956,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/glob": {
|
"node_modules/glob": {
|
||||||
"version": "10.3.15",
|
"version": "10.3.16",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-10.3.16.tgz",
|
||||||
"integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==",
|
"integrity": "sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"foreground-child": "^3.1.0",
|
"foreground-child": "^3.1.0",
|
||||||
"jackspeak": "^2.3.6",
|
"jackspeak": "^3.1.2",
|
||||||
"minimatch": "^9.0.1",
|
"minimatch": "^9.0.1",
|
||||||
"minipass": "^7.0.4",
|
"minipass": "^7.0.4",
|
||||||
"path-scurry": "^1.11.0"
|
"path-scurry": "^1.11.0"
|
||||||
@@ -2092,9 +2101,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/jackspeak": {
|
"node_modules/jackspeak": {
|
||||||
"version": "2.3.6",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz",
|
||||||
"integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",
|
"integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@isaacs/cliui": "^8.0.2"
|
"@isaacs/cliui": "^8.0.2"
|
||||||
@@ -2222,12 +2231,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/micromatch": {
|
"node_modules/micromatch": {
|
||||||
"version": "4.0.5",
|
"version": "4.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz",
|
||||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
"integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": "^3.0.2",
|
"braces": "^3.0.3",
|
||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2841,9 +2850,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/rollup": {
|
"node_modules/rollup": {
|
||||||
"version": "4.17.2",
|
"version": "4.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.17.2.tgz",
|
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz",
|
||||||
"integrity": "sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==",
|
"integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/estree": "1.0.5"
|
"@types/estree": "1.0.5"
|
||||||
@@ -2856,22 +2865,22 @@
|
|||||||
"npm": ">=8.0.0"
|
"npm": ">=8.0.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@rollup/rollup-android-arm-eabi": "4.17.2",
|
"@rollup/rollup-android-arm-eabi": "4.18.0",
|
||||||
"@rollup/rollup-android-arm64": "4.17.2",
|
"@rollup/rollup-android-arm64": "4.18.0",
|
||||||
"@rollup/rollup-darwin-arm64": "4.17.2",
|
"@rollup/rollup-darwin-arm64": "4.18.0",
|
||||||
"@rollup/rollup-darwin-x64": "4.17.2",
|
"@rollup/rollup-darwin-x64": "4.18.0",
|
||||||
"@rollup/rollup-linux-arm-gnueabihf": "4.17.2",
|
"@rollup/rollup-linux-arm-gnueabihf": "4.18.0",
|
||||||
"@rollup/rollup-linux-arm-musleabihf": "4.17.2",
|
"@rollup/rollup-linux-arm-musleabihf": "4.18.0",
|
||||||
"@rollup/rollup-linux-arm64-gnu": "4.17.2",
|
"@rollup/rollup-linux-arm64-gnu": "4.18.0",
|
||||||
"@rollup/rollup-linux-arm64-musl": "4.17.2",
|
"@rollup/rollup-linux-arm64-musl": "4.18.0",
|
||||||
"@rollup/rollup-linux-powerpc64le-gnu": "4.17.2",
|
"@rollup/rollup-linux-powerpc64le-gnu": "4.18.0",
|
||||||
"@rollup/rollup-linux-riscv64-gnu": "4.17.2",
|
"@rollup/rollup-linux-riscv64-gnu": "4.18.0",
|
||||||
"@rollup/rollup-linux-s390x-gnu": "4.17.2",
|
"@rollup/rollup-linux-s390x-gnu": "4.18.0",
|
||||||
"@rollup/rollup-linux-x64-gnu": "4.17.2",
|
"@rollup/rollup-linux-x64-gnu": "4.18.0",
|
||||||
"@rollup/rollup-linux-x64-musl": "4.17.2",
|
"@rollup/rollup-linux-x64-musl": "4.18.0",
|
||||||
"@rollup/rollup-win32-arm64-msvc": "4.17.2",
|
"@rollup/rollup-win32-arm64-msvc": "4.18.0",
|
||||||
"@rollup/rollup-win32-ia32-msvc": "4.17.2",
|
"@rollup/rollup-win32-ia32-msvc": "4.18.0",
|
||||||
"@rollup/rollup-win32-x64-msvc": "4.17.2",
|
"@rollup/rollup-win32-x64-msvc": "4.18.0",
|
||||||
"fsevents": "~2.3.2"
|
"fsevents": "~2.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"@vueuse/core": "^10.2.1",
|
"@vueuse/core": "^10.2.1",
|
||||||
"@vueuse/integrations": "^10.2.1",
|
"@vueuse/integrations": "^10.2.1",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
|
"axios-rate-limit": "^1.3.1",
|
||||||
"loglevel": "^1.8.1",
|
"loglevel": "^1.8.1",
|
||||||
"loglevel-plugin-prefix": "^0.8.4",
|
"loglevel-plugin-prefix": "^0.8.4",
|
||||||
"oidc-client-ts": "^3.0.1",
|
"oidc-client-ts": "^3.0.1",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { Log, User, UserManager } from "oidc-client-ts";
|
import { Log, User, UserManager, WebStorageStateStore } from "oidc-client-ts";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
|
|
||||||
@@ -11,7 +11,9 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
client_id: import.meta.env.VITE_AUTH_CLIENT_ID,
|
client_id: import.meta.env.VITE_AUTH_CLIENT_ID,
|
||||||
client_secret: import.meta.env.VITE_AUTH_CLIENT_SECRET,
|
client_secret: import.meta.env.VITE_AUTH_CLIENT_SECRET,
|
||||||
redirect_uri: import.meta.env.VITE_AUTH_REDIRECT_URI,
|
redirect_uri: import.meta.env.VITE_AUTH_REDIRECT_URI,
|
||||||
scope: import.meta.env.VITE_AUTH_SCOPE
|
scope: import.meta.env.VITE_AUTH_SCOPE,
|
||||||
|
stateStore: new WebStorageStateStore({ store: window.localStorage }),
|
||||||
|
userStore: new WebStorageStateStore({ store: window.localStorage })
|
||||||
});
|
});
|
||||||
|
|
||||||
const user = ref<User>();
|
const user = ref<User>();
|
||||||
|
|||||||
@@ -1,24 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { vOnClickOutside } from '@vueuse/components';
|
import { vOnClickOutside } from '@vueuse/components';
|
||||||
import { useEventListener, useVModel } from '@vueuse/core';
|
import { useEventListener } from '@vueuse/core';
|
||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
|
|
||||||
interface Props {
|
const open = defineModel('open', { default: false });
|
||||||
open: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Emit {
|
watch(open, value => {
|
||||||
(e: 'update:open', value: boolean): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
open: false,
|
|
||||||
});
|
|
||||||
const emit = defineEmits<Emit>();
|
|
||||||
|
|
||||||
const isOpen = useVModel(props, 'open', emit, {passive: true});
|
|
||||||
|
|
||||||
watch(isOpen, value => {
|
|
||||||
if (value) {
|
if (value) {
|
||||||
document.body.classList.add('overflow-hidden');
|
document.body.classList.add('overflow-hidden');
|
||||||
} else {
|
} else {
|
||||||
@@ -27,18 +14,18 @@ watch(isOpen, value => {
|
|||||||
});
|
});
|
||||||
useEventListener('keyup', e => {
|
useEventListener('keyup', e => {
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
isOpen.value = false;
|
open.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Transition name="fade">
|
<Transition name="fade">
|
||||||
<template v-if="isOpen">
|
<template v-if="open">
|
||||||
<div class="fixed inset-0 z-10">
|
<div class="fixed inset-0 z-10">
|
||||||
<div class="absolute bg-black opacity-80 inset-0 z-0" />
|
<div class="absolute bg-black opacity-80 inset-0 z-0" />
|
||||||
<div class="absolute grid inset-0">
|
<div class="absolute grid inset-0">
|
||||||
<div class="justify-self-center m-auto" v-on-click-outside="() => isOpen = false">
|
<div class="justify-self-center m-auto" v-on-click-outside="() => open = false">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,24 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useVModel } from '@vueuse/core';
|
|
||||||
|
|
||||||
interface Props {
|
const modelValue = defineModel({ default: false });
|
||||||
modelValue?: boolean;
|
|
||||||
}
|
|
||||||
interface Emits {
|
|
||||||
(e: 'update:modelValue', value: boolean): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
modelValue: false
|
|
||||||
});
|
|
||||||
const emit = defineEmits<Emits>();
|
|
||||||
|
|
||||||
const value = useVModel(props, 'modelValue', emit);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<label class="flex items-center relative w-max cursor-pointer select-none">
|
<label class="flex items-center relative w-max cursor-pointer select-none">
|
||||||
<input type="checkbox" class="appearance-none transition-colors cursor-pointer w-10 h-5 rounded-full checked:bg-emerald-500 peer" v-model="value" />
|
<input type="checkbox" class="appearance-none transition-colors cursor-pointer w-10 h-5 rounded-full checked:bg-emerald-500 peer" v-model="modelValue" />
|
||||||
<span class="w-5 h-5 right-5 absolute rounded-full transform transition-transform bg-slate-100 peer-checked:bg-emerald-200" />
|
<span class="w-5 h-5 right-5 absolute rounded-full transform transition-transform bg-slate-100 peer-checked:bg-emerald-200" />
|
||||||
</label>
|
</label>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { vElementHover } from '@vueuse/components';
|
|
||||||
import { useVModel } from '@vueuse/core';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
open: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Emit {
|
|
||||||
(e: 'update:open', value: boolean): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
open: false,
|
|
||||||
});
|
|
||||||
const emit = defineEmits<Emit>();
|
|
||||||
|
|
||||||
const isOpen = useVModel(props, 'open', emit, {passive: true});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div clas="flex flex-col items-center justify-center" :class="{'open': isOpen}">
|
|
||||||
<div v-element-hover="(h: boolean) => isOpen = h" class="m-auto header">
|
|
||||||
<slot name="header" />
|
|
||||||
</div>
|
|
||||||
<div v-if="isOpen" class="m-auto">
|
|
||||||
<div class="z-10 relative">
|
|
||||||
<div class="absolute">
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
@@ -3,5 +3,5 @@ export { default as Dropdown } from './Dropdown.vue';
|
|||||||
export { default as LoadingSpinner } from './LoadingSpinner.vue';
|
export { default as LoadingSpinner } from './LoadingSpinner.vue';
|
||||||
export { default as Modal } from './Modal.vue';
|
export { default as Modal } from './Modal.vue';
|
||||||
export { default as SliderCheckbox } from './SliderCheckbox.vue';
|
export { default as SliderCheckbox } from './SliderCheckbox.vue';
|
||||||
export { default as Tooltip } from './Tooltip.vue';
|
export { default as Tooltip } from './tooltip/Tooltip.vue';
|
||||||
|
|
||||||
|
|||||||
46
src/components/tooltip/Tooltip.vue
Normal file
46
src/components/tooltip/Tooltip.vue
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { vElementHover } from '@vueuse/components';
|
||||||
|
import { useElementBounding } from '@vueuse/core';
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { useSharedWindowSize } from './tooltip';
|
||||||
|
|
||||||
|
const open = defineModel('open', { default: false });
|
||||||
|
|
||||||
|
const { width, height } = useSharedWindowSize();
|
||||||
|
const mainDiv = ref<HTMLDivElement | null>(null);
|
||||||
|
const { top, left } = useElementBounding(mainDiv);
|
||||||
|
|
||||||
|
const positions = computed(() => {
|
||||||
|
if (top.value < height.value / 2) {
|
||||||
|
if (left.value < width.value / 2) {
|
||||||
|
return ['top', 'left'];
|
||||||
|
}
|
||||||
|
return ['top', 'right'];
|
||||||
|
}
|
||||||
|
if (left.value < width.value / 2) {
|
||||||
|
return ['bottom', 'left'];
|
||||||
|
}
|
||||||
|
return ['bottom', 'right'];
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div ref="mainDiv" clas="flex flex-col items-center justify-center" :class="{
|
||||||
|
'open': open,
|
||||||
|
'tooltip-top': positions.includes('top'),
|
||||||
|
'tooltip-bottom': positions.includes('bottom'),
|
||||||
|
'tooltip-left': positions.includes('left'),
|
||||||
|
'tooltip-right': positions.includes('right')
|
||||||
|
}">
|
||||||
|
<div v-element-hover="(h: boolean) => open = h" class="m-auto header">
|
||||||
|
<slot name="header" />
|
||||||
|
</div>
|
||||||
|
<div v-if="open" class="m-auto">
|
||||||
|
<div class="z-10 relative">
|
||||||
|
<div class="absolute">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
3
src/components/tooltip/tooltip.ts
Normal file
3
src/components/tooltip/tooltip.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { createSharedComposable, useWindowSize } from "@vueuse/core";
|
||||||
|
|
||||||
|
export const useSharedWindowSize = createSharedComposable(useWindowSize);
|
||||||
23
src/formaters.spec.ts
Normal file
23
src/formaters.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { describe, expect, test } from 'vitest'
|
||||||
|
import { formatEveDate, formatIsk } from './formaters'
|
||||||
|
|
||||||
|
describe('formatIsk', () => {
|
||||||
|
test('Formats ISK correctly', () => {
|
||||||
|
expect(formatIsk(123456789)).toBe('123.456.789,00 ISK')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('formatEveDate', () => {
|
||||||
|
test('Formats EVE date correctly', () => {
|
||||||
|
const date = new Date(Date.UTC(2022, 0, 1, 0, 0))
|
||||||
|
expect(formatEveDate(date)).toBe('2022.01.01 00:00')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('Returns empty string for undefined date', () => {
|
||||||
|
expect(formatEveDate()).toBe('')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('Returns empty string for null date', () => {
|
||||||
|
expect(formatEveDate(null)).toBe('')
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -11,4 +11,11 @@ export const percentFormater = new Intl.NumberFormat("en-US", {
|
|||||||
maximumFractionDigits: 0
|
maximumFractionDigits: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
export const formatEveDate = (date: Date) => `${date.getUTCFullYear()}.${date.getUTCMonth() + 1}.${date.getUTCDate()} ${date.getUTCHours()}:${date.getUTCMinutes()}`;
|
|
||||||
|
const timeFormat = new Intl.NumberFormat("en-US", {
|
||||||
|
minimumFractionDigits: 0,
|
||||||
|
maximumFractionDigits: 0,
|
||||||
|
minimumIntegerDigits: 2
|
||||||
|
});
|
||||||
|
|
||||||
|
export const formatEveDate = (date?: Date | null) => !date ? '' : `${date.getUTCFullYear()}.${timeFormat.format(date.getUTCMonth() + 1)}.${timeFormat.format(date.getUTCDate())} ${timeFormat.format(date.getUTCHours())}:${timeFormat.format(date.getUTCMinutes())}`;
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import { esiAxiosInstance } from "@/service";
|
|
||||||
|
|
||||||
|
|
||||||
export type MarketOrderHistory = {
|
|
||||||
average: number;
|
|
||||||
date: string;
|
|
||||||
highest: number;
|
|
||||||
lowest: number;
|
|
||||||
order_count: number;
|
|
||||||
volume: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getHistory = async (regionId: number, tyeId: number): Promise<MarketOrderHistory[]> => (await esiAxiosInstance.get(`/markets/${regionId}/history/`, { params: { type_id: tyeId } })).data;
|
|
||||||
35
src/market/RegionalMarketCache.spec.ts
Normal file
35
src/market/RegionalMarketCache.spec.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { describe, expect, test } from 'vitest'
|
||||||
|
import { RegionalMarketCache } from './RegionalMarketCache'
|
||||||
|
|
||||||
|
describe('RegionalMarketCache', () => {
|
||||||
|
test('should cache and retrieve values', async () => {
|
||||||
|
const cache = new RegionalMarketCache<string>(1000)
|
||||||
|
|
||||||
|
cache.set(1, 1, 'test')
|
||||||
|
expect(cache.get(1, 1)).toBe('test')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('should remove values', async () => {
|
||||||
|
const cache = new RegionalMarketCache<string>(1000)
|
||||||
|
|
||||||
|
cache.set(1, 1, 'test')
|
||||||
|
cache.remove(1, 1)
|
||||||
|
expect(cache.get(1, 1)).toBeUndefined()
|
||||||
|
})
|
||||||
|
|
||||||
|
test('should compute values if absent', async () => {
|
||||||
|
const cache = new RegionalMarketCache<string>(1000)
|
||||||
|
const value = await cache.computeIfAbsent(1, 1, () => Promise.resolve('test'))
|
||||||
|
|
||||||
|
expect(value).toBe('test')
|
||||||
|
expect(cache.get(1, 1)).toBe('test')
|
||||||
|
})
|
||||||
|
|
||||||
|
test('should expire values', async () => {
|
||||||
|
const cache = new RegionalMarketCache<string>(1)
|
||||||
|
|
||||||
|
cache.set(1, 1, 'test')
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 10))
|
||||||
|
expect(cache.get(1, 1)).toBeUndefined()
|
||||||
|
})
|
||||||
|
})
|
||||||
50
src/market/RegionalMarketCache.ts
Normal file
50
src/market/RegionalMarketCache.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
class CacheEntry<T> {
|
||||||
|
public value: T;
|
||||||
|
public expiration: Date;
|
||||||
|
|
||||||
|
constructor(value: T, expiration: Date) {
|
||||||
|
this.value = value;
|
||||||
|
this.expiration = expiration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ExpirationSupplier<T> = (v: T) => Date;
|
||||||
|
|
||||||
|
export class RegionalMarketCache<T> {
|
||||||
|
private cache: Record<number, Record<number, CacheEntry<T>>>;
|
||||||
|
private expirationSupplier: (v: T) => Date;
|
||||||
|
|
||||||
|
constructor(expiration: ExpirationSupplier<T> | number) {
|
||||||
|
this.cache = {};
|
||||||
|
this.expirationSupplier = expiration instanceof Function ? expiration : () => new Date(Date.now() + expiration);
|
||||||
|
}
|
||||||
|
|
||||||
|
public get(regionId: number, typeId: number): T | undefined {
|
||||||
|
const entry = this.cache[regionId]?.[typeId];
|
||||||
|
|
||||||
|
if (entry && entry.expiration > new Date()) {
|
||||||
|
return entry.value;
|
||||||
|
}
|
||||||
|
this.remove(regionId, typeId);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
public set(regionId: number, typeId: number, value: T): void {
|
||||||
|
this.cache[regionId] = this.cache[regionId] ?? {};
|
||||||
|
this.cache[regionId][typeId] = new CacheEntry(value, this.expirationSupplier(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
public remove(regionId: number, typeId: number): void {
|
||||||
|
delete this.cache[regionId]?.[typeId];
|
||||||
|
}
|
||||||
|
|
||||||
|
public async computeIfAbsent(regionId: number, typeId: number, supplier: () => (Promise<T> | T)): Promise<T> {
|
||||||
|
let value = this.get(regionId, typeId);
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
value = await supplier();
|
||||||
|
this.set(regionId, typeId, value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { LoadingSpinner, Tooltip } from '@/components';
|
import { LoadingSpinner, Tooltip } from '@/components';
|
||||||
import { formatIsk } from '@/formaters';
|
import { formatIsk } from '@/formaters';
|
||||||
import { getHistory, jitaId } from '@/market';
|
import { getHistory, getHistoryQuartils } from '@/market';
|
||||||
import { getHistoryQuartils } from '@/market/tracking';
|
|
||||||
import { ArrowTrendingDownIcon, ArrowTrendingUpIcon } from '@heroicons/vue/24/outline';
|
import { ArrowTrendingDownIcon, ArrowTrendingUpIcon } from '@heroicons/vue/24/outline';
|
||||||
import { computedAsync } from '@vueuse/core';
|
import { computedAsync } from '@vueuse/core';
|
||||||
import { ref, watchEffect } from 'vue';
|
import { ref, watchEffect } from 'vue';
|
||||||
@@ -23,7 +22,7 @@ const q1 = ref(0);
|
|||||||
const median = ref(0);
|
const median = ref(0);
|
||||||
const q3 = ref(0);
|
const q3 = ref(0);
|
||||||
const lineColor = ref('');
|
const lineColor = ref('');
|
||||||
const history = computedAsync(() => getHistory(jitaId, props.id), []);
|
const history = computedAsync(() => getHistory(props.id), []);
|
||||||
|
|
||||||
watchEffect(async () => {
|
watchEffect(async () => {
|
||||||
if (!open.value || !props.id) {
|
if (!open.value || !props.id) {
|
||||||
@@ -53,7 +52,7 @@ watchEffect(async () => {
|
|||||||
<ArrowTrendingDownIcon v-else />
|
<ArrowTrendingDownIcon v-else />
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="bg-slate-500 -left-1/2 relative" v-if="history.length > 0">
|
<div class="bg-slate-500 -left-1/2 relative tooltip-content" v-if="history.length > 0">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -81,8 +80,18 @@ watchEffect(async () => {
|
|||||||
>:deep(div.header) {
|
>:deep(div.header) {
|
||||||
@apply btn-icon px-2;
|
@apply btn-icon px-2;
|
||||||
}
|
}
|
||||||
&.open>:deep(div.header) {
|
&.open {
|
||||||
|
&.tooltip-top>:deep(div.header) {
|
||||||
@apply rounded-t-md bg-slate-600;
|
@apply rounded-t-md bg-slate-600;
|
||||||
}
|
}
|
||||||
|
&.tooltip-bottom {
|
||||||
|
.tooltip-content {
|
||||||
|
bottom: 79px;
|
||||||
|
}
|
||||||
|
>:deep(div.header) {
|
||||||
|
@apply rounded-b-md bg-slate-600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { marbasAxiosInstance, MarbasObject } from "@/marbas";
|
import { marbasAxiosInstance, MarbasObject } from "@/marbas";
|
||||||
|
import { AxiosResponse } from "axios";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
@@ -15,6 +16,17 @@ export type MarbasAcquiredType = MarbasObject & {
|
|||||||
user: number;
|
user: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type RawMarbasAcquiredType = Omit<MarbasAcquiredType, 'date'> & {
|
||||||
|
date: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertableRawMarbasAcquiredType = Omit<MarbasAcquiredType, 'id' | 'user' | 'date'>;
|
||||||
|
|
||||||
|
const mapRawMarbasAcquiredType = (raw: RawMarbasAcquiredType): MarbasAcquiredType => ({
|
||||||
|
...raw,
|
||||||
|
date: raw.date ? new Date(raw.date) : new Date()
|
||||||
|
});
|
||||||
|
|
||||||
const endpoint = '/api/acquisitions/';
|
const endpoint = '/api/acquisitions/';
|
||||||
|
|
||||||
export const useAcquiredTypesStore = defineStore('market-acquisition', () => {
|
export const useAcquiredTypesStore = defineStore('market-acquisition', () => {
|
||||||
@@ -22,14 +34,13 @@ export const useAcquiredTypesStore = defineStore('market-acquisition', () => {
|
|||||||
|
|
||||||
const types = computed(() => acquiredTypes.value.filter(item => item.remaining > 0));
|
const types = computed(() => acquiredTypes.value.filter(item => item.remaining > 0));
|
||||||
const addAcquiredType = async (type: number, quantity: number, price: number, source?: AcquiredTypeSource) => {
|
const addAcquiredType = async (type: number, quantity: number, price: number, source?: AcquiredTypeSource) => {
|
||||||
const newItem = (await marbasAxiosInstance.post<MarbasAcquiredType>(endpoint, {
|
const newItem = mapRawMarbasAcquiredType((await marbasAxiosInstance.post<RawMarbasAcquiredType, AxiosResponse<RawMarbasAcquiredType>, InsertableRawMarbasAcquiredType>(endpoint, {
|
||||||
type: type,
|
type: type,
|
||||||
quantity: quantity,
|
quantity: quantity,
|
||||||
remaining: quantity,
|
remaining: quantity,
|
||||||
price: price,
|
price: price,
|
||||||
date: new Date(),
|
|
||||||
source: source ?? 'misc',
|
source: source ?? 'misc',
|
||||||
})).data
|
})).data);
|
||||||
|
|
||||||
acquiredTypes.value = [...acquiredTypes.value, newItem];
|
acquiredTypes.value = [...acquiredTypes.value, newItem];
|
||||||
log.info(`Acquired type ${newItem.id} with quantity ${newItem.quantity} and price ${newItem.price}`, newItem);
|
log.info(`Acquired type ${newItem.id} with quantity ${newItem.quantity} and price ${newItem.price}`, newItem);
|
||||||
@@ -57,7 +68,7 @@ export const useAcquiredTypesStore = defineStore('market-acquisition', () => {
|
|||||||
log.info(`Acquired type ${item.id} remaining: ${item.remaining}`, item);
|
log.info(`Acquired type ${item.id} remaining: ${item.remaining}`, item);
|
||||||
};
|
};
|
||||||
|
|
||||||
marbasAxiosInstance.get<MarbasAcquiredType[]>(endpoint).then(res => acquiredTypes.value = res.data.map(item => ({ ...item, date: new Date(item.date) })));
|
marbasAxiosInstance.get<RawMarbasAcquiredType[]>(endpoint).then(res => acquiredTypes.value = res.data.map(mapRawMarbasAcquiredType));
|
||||||
|
|
||||||
return { acquiredTypes: types, addAcquiredType, removeAcquiredType };
|
return { acquiredTypes: types, addAcquiredType, removeAcquiredType };
|
||||||
});
|
});
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { ref } from 'vue';
|
import { RegionalMarketCache } from '../RegionalMarketCache';
|
||||||
|
import { jitaId } from '../market';
|
||||||
import { MarketType } from "../type";
|
import { MarketType } from "../type";
|
||||||
import { MarketTypePrice } from './MarketTypePrice';
|
import { MarketTypePrice } from './MarketTypePrice';
|
||||||
import { getEvepraisalPrices } from './evepraisal';
|
import { getEvepraisalPrices } from './evepraisal';
|
||||||
import { getfuzzworkPrices } from './fuzzwork';
|
import { getfuzzworkPrices } from './fuzzwork';
|
||||||
|
|
||||||
type MarketTypePriceCache = {
|
|
||||||
price: MarketTypePrice,
|
|
||||||
date: Date
|
|
||||||
}
|
|
||||||
|
|
||||||
const cacheDuration = 1000 * 60 * 5; // 5 minutes
|
const cacheDuration = 1000 * 60 * 5; // 5 minutes
|
||||||
const priceGetters = {
|
const priceGetters = {
|
||||||
evepraisal: getEvepraisalPrices,
|
evepraisal: getEvepraisalPrices,
|
||||||
@@ -17,21 +13,21 @@ const priceGetters = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useApraisalStore = defineStore('appraisal', () => {
|
export const useApraisalStore = defineStore('appraisal', () => {
|
||||||
const cache = ref<Record<number, MarketTypePriceCache>>({});
|
const cache: RegionalMarketCache<MarketTypePrice> = new RegionalMarketCache(cacheDuration);
|
||||||
|
|
||||||
const getPricesUncached = priceGetters.fuzzwork;
|
const getPricesUncached = priceGetters.fuzzwork;
|
||||||
|
|
||||||
const getPrice = async (type: MarketType): Promise<MarketTypePrice> => (await getPrices([type]))[0];
|
const getPrice = async (type: MarketType, regionId?: number): Promise<MarketTypePrice> => (await getPrices([type], regionId))[0];
|
||||||
const getPrices = async (types: MarketType[]): Promise<MarketTypePrice[]> => {
|
const getPrices = async (types: MarketType[], regionId?: number): Promise<MarketTypePrice[]> => {
|
||||||
const now = new Date();
|
|
||||||
const cached: MarketTypePrice[] = [];
|
const cached: MarketTypePrice[] = [];
|
||||||
const uncached: MarketType[] = [];
|
const uncached: MarketType[] = [];
|
||||||
|
const rId = regionId ?? jitaId;
|
||||||
|
|
||||||
types.forEach(t => {
|
types.forEach(t => {
|
||||||
const cachedPrice = cache.value[t.id];
|
const cachedPrice = cache.get(rId, t.id);
|
||||||
|
|
||||||
if (cachedPrice && now.getTime() - cachedPrice.date.getTime() < cacheDuration) {
|
if (cachedPrice) {
|
||||||
cached.push(cachedPrice.price);
|
cached.push(cachedPrice);
|
||||||
} else {
|
} else {
|
||||||
uncached.push(t);
|
uncached.push(t);
|
||||||
}
|
}
|
||||||
@@ -40,8 +36,8 @@ export const useApraisalStore = defineStore('appraisal', () => {
|
|||||||
if (uncached.length > 0) {
|
if (uncached.length > 0) {
|
||||||
const prices = await getPricesUncached(uncached);
|
const prices = await getPricesUncached(uncached);
|
||||||
|
|
||||||
prices.forEach(p => cache.value[p.type.id] = { price: p, date: now });
|
prices.forEach(p => cache.set(rId, p.type.id, p));
|
||||||
return [...cached, ...prices];
|
return [ ...cached, ...prices ];
|
||||||
}
|
}
|
||||||
return cached;
|
return cached;
|
||||||
};
|
};
|
||||||
|
|||||||
30
src/market/history/EsiMarketOrderHistory.ts
Normal file
30
src/market/history/EsiMarketOrderHistory.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { esiAxiosInstance } from "@/service";
|
||||||
|
import { RegionalMarketCache } from '../RegionalMarketCache';
|
||||||
|
import { jitaId } from "../market";
|
||||||
|
|
||||||
|
|
||||||
|
export type EsiMarketOrderHistory = {
|
||||||
|
average: number;
|
||||||
|
date: string;
|
||||||
|
highest: number;
|
||||||
|
lowest: number;
|
||||||
|
order_count: number;
|
||||||
|
volume: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO use pinia store
|
||||||
|
const historyCache: RegionalMarketCache<EsiMarketOrderHistory[]> = new RegionalMarketCache(() => {
|
||||||
|
const date = new Date();
|
||||||
|
|
||||||
|
if (date.getUTCHours() >= 11) {
|
||||||
|
date.setUTCDate(date.getUTCDate() + 1);
|
||||||
|
}
|
||||||
|
date.setUTCHours(11, 0, 0, 0);
|
||||||
|
return date;
|
||||||
|
});
|
||||||
|
|
||||||
|
export const getHistory = async (tyeId: number, regionId?: number): Promise<EsiMarketOrderHistory[]> => {
|
||||||
|
const rId = regionId ?? jitaId;
|
||||||
|
|
||||||
|
return historyCache.computeIfAbsent(rId, tyeId, async () => (await esiAxiosInstance.get(`/markets/${rId}/history/`, { params: { type_id: tyeId } })).data);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { MarketOrderHistory } from "@/market";
|
import { EsiMarketOrderHistory } from "@/market";
|
||||||
|
|
||||||
export type HistoryQuartils = {
|
export type HistoryQuartils = {
|
||||||
totalVolume: number,
|
totalVolume: number,
|
||||||
@@ -7,7 +7,7 @@ export type HistoryQuartils = {
|
|||||||
q3: number,
|
q3: number,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getHistoryQuartils = (history: MarketOrderHistory[], days?: number): HistoryQuartils => {
|
export const getHistoryQuartils = (history: EsiMarketOrderHistory[], days?: number): HistoryQuartils => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
|
||||||
const volumes = history
|
const volumes = history
|
||||||
@@ -51,7 +51,7 @@ export const getHistoryQuartils = (history: MarketOrderHistory[], days?: number)
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const estimateVolume = (history: MarketOrderHistory): number => {
|
const estimateVolume = (history: EsiMarketOrderHistory): number => {
|
||||||
if (history.volume === 0) {
|
if (history.volume === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
2
src/market/history/index.ts
Normal file
2
src/market/history/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './EsiMarketOrderHistory';
|
||||||
|
export * from './HistoryQuartils';
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
export * from './RegionalMarketCache';
|
||||||
|
export * from './history';
|
||||||
export * from './tax';
|
export * from './tax';
|
||||||
export * from './type';
|
export * from './type';
|
||||||
|
|
||||||
export * from './MarketOrderHistory';
|
|
||||||
export * from './appraisal';
|
export * from './appraisal';
|
||||||
export * from './market';
|
export * from './market';
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
import { SliderCheckbox } from '@/components';
|
import { SliderCheckbox } from '@/components';
|
||||||
import { SortableHeader, useSort, VirtualScrollTable } from '@/components/table';
|
import { SortableHeader, useSort, VirtualScrollTable } from '@/components/table';
|
||||||
import { formatIsk, percentFormater } from '@/formaters';
|
import { formatIsk, percentFormater } from '@/formaters';
|
||||||
import { MarketType, MarketTypeLabel, TaxInput, useMarketTaxStore } from "@/market";
|
import { getHistoryQuartils, MarketType, MarketTypeLabel, TaxInput, useMarketTaxStore } from "@/market";
|
||||||
import { BookmarkSlashIcon, ShoppingCartIcon } from '@heroicons/vue/24/outline';
|
import { BookmarkSlashIcon, ShoppingCartIcon } from '@heroicons/vue/24/outline';
|
||||||
import { useStorage } from '@vueuse/core';
|
import { useStorage } from '@vueuse/core';
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { getHistoryQuartils } from './HistoryQuartils';
|
|
||||||
import { TrackingResult } from './tracking';
|
import { TrackingResult } from './tracking';
|
||||||
|
|
||||||
type Result = {
|
type Result = {
|
||||||
@@ -163,4 +162,4 @@ const getLineColor = (result: Result) => {
|
|||||||
div.end {
|
div.end {
|
||||||
@apply justify-self-end ms-2;
|
@apply justify-self-end ms-2;
|
||||||
}
|
}
|
||||||
</style>
|
</style>../history/HistoryQuartils
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
export * from './HistoryQuartils';
|
|
||||||
export * from './tracking';
|
export * from './tracking';
|
||||||
|
|
||||||
export { default as TrackingResultTable } from './TrackingResultTable.vue';
|
export { default as TrackingResultTable } from './TrackingResultTable.vue';
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { marbasAxiosInstance, MarbasObject } from "@/marbas";
|
import { marbasAxiosInstance, MarbasObject } from "@/marbas";
|
||||||
import { getHistory, jitaId, MarketOrderHistory, MarketType, MarketTypePrice } from "@/market";
|
import { EsiMarketOrderHistory, getHistory, MarketType, MarketTypePrice } from "@/market";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from "vue";
|
||||||
|
|
||||||
export type TrackingResult = {
|
export type TrackingResult = {
|
||||||
type: MarketType;
|
type: MarketType;
|
||||||
history: MarketOrderHistory[];
|
history: EsiMarketOrderHistory[];
|
||||||
buy: number,
|
buy: number,
|
||||||
sell: number,
|
sell: number,
|
||||||
orderCount: number,
|
orderCount: number,
|
||||||
@@ -47,4 +47,4 @@ export const useMarketTrackingStore = defineStore('marketTracking', () => {
|
|||||||
return { types, addType, removeType };
|
return { types, addType, removeType };
|
||||||
});
|
});
|
||||||
|
|
||||||
export const createResult = async (id: number, price: MarketTypePrice): Promise<TrackingResult> => ({ history: await getHistory(jitaId, id), ...price });
|
export const createResult = async (id: number, price: MarketTypePrice): Promise<TrackingResult> => ({ history: await getHistory(id), ...price });
|
||||||
@@ -1,25 +1,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { vOnClickOutside } from '@vueuse/components';
|
import { vOnClickOutside } from '@vueuse/components';
|
||||||
import { useVirtualList, useVModel } from '@vueuse/core';
|
import { useVirtualList } from '@vueuse/core';
|
||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
import { nextTick, ref, watch, watchEffect } from 'vue';
|
import { nextTick, ref, watch, watchEffect } from 'vue';
|
||||||
import { MarketType, searchMarketTypes } from './MarketType';
|
import { MarketType, searchMarketTypes } from './MarketType';
|
||||||
import MarketTypeLabel from "./MarketTypeLabel.vue";
|
import MarketTypeLabel from "./MarketTypeLabel.vue";
|
||||||
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
modelValue?: MarketType;
|
|
||||||
}
|
|
||||||
interface Emits {
|
interface Emits {
|
||||||
(e: 'update:modelValue', value?: MarketType): void;
|
|
||||||
(e: 'submit'): void;
|
(e: 'submit'): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const modelValue = defineModel<MarketType>();
|
||||||
const emit = defineEmits<Emits>();
|
const emit = defineEmits<Emits>();
|
||||||
|
|
||||||
const value = useVModel(props, 'modelValue', emit);
|
|
||||||
|
|
||||||
const isOpen = ref(false);
|
const isOpen = ref(false);
|
||||||
const name = ref('');
|
const name = ref('');
|
||||||
const suggestions = ref<MarketType[]>([]);
|
const suggestions = ref<MarketType[]>([]);
|
||||||
@@ -47,7 +40,7 @@ const moveUp = () => {
|
|||||||
}
|
}
|
||||||
const select = (type?: MarketType) => {
|
const select = (type?: MarketType) => {
|
||||||
log.debug('Select:', type);
|
log.debug('Select:', type);
|
||||||
value.value = type;
|
modelValue.value = type;
|
||||||
currentIndex.value = -1;
|
currentIndex.value = -1;
|
||||||
suggestions.value = [];
|
suggestions.value = [];
|
||||||
isOpen.value = false;
|
isOpen.value = false;
|
||||||
@@ -62,18 +55,18 @@ const submit = async () => {
|
|||||||
|
|
||||||
select(v);
|
select(v);
|
||||||
await nextTick();
|
await nextTick();
|
||||||
} else if (props.modelValue === undefined && suggestions.value.length > 0) {
|
} else if (modelValue.value === undefined && suggestions.value.length > 0) {
|
||||||
select(suggestions.value[0]);
|
select(suggestions.value[0]);
|
||||||
await nextTick();
|
await nextTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value.value === undefined) {
|
if (modelValue.value === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emit('submit');
|
emit('submit');
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => props.modelValue, async v => {
|
watch(() => modelValue.value, async v => {
|
||||||
if (v === undefined) {
|
if (v === undefined) {
|
||||||
name.value = '';
|
name.value = '';
|
||||||
} else {
|
} else {
|
||||||
@@ -96,10 +89,10 @@ watchEffect(async () => {
|
|||||||
<template>
|
<template>
|
||||||
<div @click="() => isOpen = true" v-on-click-outside="() => isOpen = false">
|
<div @click="() => isOpen = true" v-on-click-outside="() => isOpen = false">
|
||||||
<div class="fake-input">
|
<div class="fake-input">
|
||||||
<img v-if="value?.id" :src="`https://images.evetech.net/types/${value.id}/icon?size=32`" alt="" />
|
<img v-if="modelValue?.id" :src="`https://images.evetech.net/types/${modelValue.id}/icon?size=32`" alt="" />
|
||||||
<input type="text" v-model="name" @keyup.enter="submit" @keyup.down="moveDown" @keyup.up="moveUp" />
|
<input type="text" v-model="name" @keyup.enter="submit" @keyup.down="moveDown" @keyup.up="moveUp" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="suggestions.length > 1" class="z-10 absolute w-96">
|
<div v-if="suggestions.length > 1" class="z-20 absolute w-96">
|
||||||
<div v-bind="containerProps" class="rounded-b" style="height: 300px">
|
<div v-bind="containerProps" class="rounded-b" style="height: 300px">
|
||||||
<div v-bind="wrapperProps">
|
<div v-bind="wrapperProps">
|
||||||
<div v-for="s in list" :key="s.index" class="hover:bg-slate-700" :class="{'bg-slate-500': s.index !== currentIndex, 'bg-emerald-500': s.index === currentIndex}" @click="select(s.data)">
|
<div v-for="s in list" :key="s.index" class="hover:bg-slate-700" :class="{'bg-slate-500': s.index !== currentIndex, 'bg-emerald-500': s.index === currentIndex}" @click="select(s.data)">
|
||||||
|
|||||||
@@ -17,14 +17,12 @@ withDefaults(defineProps<Props>(), {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="id || name">
|
<div v-if="id || name" class="flex flex-row">
|
||||||
<img v-if="id" :src="`https://images.evetech.net/types/${id}/icon?size=32`" class="inline-block w-5 h-5 me-1" alt="" />
|
<img v-if="id" :src="`https://images.evetech.net/types/${id}/icon?size=32`" class="inline-block w-5 h-5 me-1 mt-1" alt="" />
|
||||||
<template v-if="name">
|
<template v-if="name">
|
||||||
{{ name }}
|
{{ name }}
|
||||||
<RouterLink v-if="id" :to="{ name: 'market-types', params: { type: id } }" custom #default="{ navigate }">
|
<RouterLink v-if="id" :to="{ name: 'market-types', params: { type: id } }" class="button btn-icon ms-1 me-1 mt-1" title="Show item info">
|
||||||
<button class="btn-icon me-1" title="Show item info" @click="navigate">
|
|
||||||
<InformationCircleIcon />
|
<InformationCircleIcon />
|
||||||
</button>
|
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<ClipboardButton v-if="!hideCopy" :value="name" />
|
<ClipboardButton v-if="!hideCopy" :value="name" />
|
||||||
</template>
|
</template>
|
||||||
@@ -32,7 +30,7 @@ withDefaults(defineProps<Props>(), {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="postcss">
|
<style scoped lang="postcss">
|
||||||
button:deep(>svg) {
|
button:deep(>svg), .button:deep(>svg) {
|
||||||
@apply relative top-0.5 !w-4 !h-4;
|
@apply !w-4 !h-4;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { MarketType, MarketTypeInput, MarketTypePrice, getHistory, getMarketTypes, jitaId, useApraisalStore } from "@/market";
|
import { MarketType, MarketTypeInput, MarketTypePrice, getHistory, getMarketTypes, useApraisalStore } from "@/market";
|
||||||
import { BuyModal } from '@/market/acquisition';
|
import { BuyModal } from '@/market/acquisition';
|
||||||
import { TrackingResult, TrackingResultTable, createResult, useMarketTrackingStore } from '@/market/tracking';
|
import { TrackingResult, TrackingResultTable, createResult, useMarketTrackingStore } from '@/market/tracking';
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
@@ -15,7 +15,7 @@ const items = ref<TrackingResult[]>([]);
|
|||||||
const addOrRelaod = async (type: MarketType) => {
|
const addOrRelaod = async (type: MarketType) => {
|
||||||
const typeID = type.id;
|
const typeID = type.id;
|
||||||
const [history, price] = await Promise.all([
|
const [history, price] = await Promise.all([
|
||||||
getHistory(jitaId, typeID),
|
getHistory(typeID),
|
||||||
apraisalStore.getPrice(type)
|
apraisalStore.getPrice(type)
|
||||||
]);
|
]);
|
||||||
const itm = {
|
const itm = {
|
||||||
@@ -57,9 +57,10 @@ watch(() => marketTrackingStore.types, async t => {
|
|||||||
const prices = await apraisalStore.getPrices(await getMarketTypes(typesToLoad));
|
const prices = await apraisalStore.getPrices(await getMarketTypes(typesToLoad));
|
||||||
|
|
||||||
items.value = [
|
items.value = [
|
||||||
...items.value,
|
...items.value
|
||||||
...(await Promise.all(typesToLoad.map(i => createResult(i, prices.find(p => p.type.id === i) as MarketTypePrice))))
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
typesToLoad.forEach(async i => items.value.push(await createResult(i, prices.find(p => p.type.id === i) as MarketTypePrice)));
|
||||||
}, { immediate: true });
|
}, { immediate: true });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
22
src/preferences/Preference.ts
Normal file
22
src/preferences/Preference.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
export class Preference<T> {
|
||||||
|
private key: string;
|
||||||
|
private description: string;
|
||||||
|
private value?: T;
|
||||||
|
private defaultValue?: T;
|
||||||
|
|
||||||
|
constructor(key: string, description: string, defaultValue?: T) {
|
||||||
|
this.key = key;
|
||||||
|
this.description = description;
|
||||||
|
this.defaultValue = defaultValue;
|
||||||
|
this.value = this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
private load() {
|
||||||
|
const value = localStorage.getItem(this.key);
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
return JSON.parse(value);
|
||||||
|
}
|
||||||
|
return this.defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
0
src/preferences/index.ts
Normal file
0
src/preferences/index.ts
Normal file
@@ -1,24 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useVModel } from '@vueuse/core';
|
|
||||||
|
|
||||||
interface Props {
|
const modelValue = defineModel({ default: false });
|
||||||
modelValue?: boolean;
|
|
||||||
}
|
|
||||||
interface Emits {
|
|
||||||
(e: 'update:modelValue', value: boolean): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
modelValue: false
|
|
||||||
});
|
|
||||||
const emit = defineEmits<Emits>();
|
|
||||||
|
|
||||||
const value = useVModel(props, 'modelValue', emit);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<label class="flex items-center relative w-max cursor-pointer select-none">
|
<label class="flex items-center relative w-max cursor-pointer select-none">
|
||||||
<input type="checkbox" class="appearance-none transition-colors cursor-pointer w-14 h-7 rounded-full" v-model="value" />
|
<input type="checkbox" class="appearance-none transition-colors cursor-pointer w-14 h-7 rounded-full" v-model="modelValue" />
|
||||||
<span class="absolute font-medium text-xs right-1"> Buy </span>
|
<span class="absolute font-medium text-xs right-1"> Buy </span>
|
||||||
<span class="absolute font-medium text-xs right-8"> Sell </span>
|
<span class="absolute font-medium text-xs right-8"> Sell </span>
|
||||||
<span class="w-7 h-7 right-7 absolute rounded-full transform transition-transform bg-slate-100" />
|
<span class="w-7 h-7 right-7 absolute rounded-full transform transition-transform bg-slate-100" />
|
||||||
|
|||||||
@@ -1,22 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { evepraisalAxiosInstance } from '@/market/appraisal/evepraisal';
|
import { evepraisalAxiosInstance } from '@/market/appraisal/evepraisal';
|
||||||
import { useVModel } from '@vueuse/core';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
name: string;
|
name: string;
|
||||||
modelValue?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Emits {
|
const modelValue = defineModel({ default: '' });
|
||||||
(e: 'update:modelValue', value: string): void;
|
defineProps<Props>();
|
||||||
}
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
|
||||||
modelValue: ''
|
|
||||||
});
|
|
||||||
const emit = defineEmits<Emits>();
|
|
||||||
|
|
||||||
const value = useVModel(props, 'modelValue', emit);
|
|
||||||
|
|
||||||
const loadFromId = async (e: Event) => {
|
const loadFromId = async (e: Event) => {
|
||||||
const input = e.target as HTMLInputElement;
|
const input = e.target as HTMLInputElement;
|
||||||
@@ -31,7 +21,7 @@ const loadFromId = async (e: Event) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
value.value = JSON.stringify(response.data);
|
modelValue.value = JSON.stringify(response.data);
|
||||||
input.value = '';
|
input.value = '';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -39,6 +29,6 @@ const loadFromId = async (e: Event) => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="flex-1 mx-1">
|
<div class="flex-1 mx-1">
|
||||||
<span>{{ name }}</span><input type="text" class="ms-2" @change="loadFromId" placeholder="id evepraisal" />
|
<span>{{ name }}</span><input type="text" class="ms-2" @change="loadFromId" placeholder="id evepraisal" />
|
||||||
<textarea class="mt-1" v-model="value" />
|
<textarea class="mt-1" v-model="modelValue" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import axios, { AxiosInstance } from 'axios';
|
import axios, { AxiosInstance } from 'axios';
|
||||||
|
import rateLimit from 'axios-rate-limit';
|
||||||
import log from 'loglevel';
|
import log from 'loglevel';
|
||||||
|
|
||||||
export const logResource = (a: AxiosInstance) => {
|
export const logResource = (a: AxiosInstance) => {
|
||||||
@@ -14,11 +15,11 @@ export const logResource = (a: AxiosInstance) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const esiAxiosInstance = axios.create({
|
export const esiAxiosInstance = rateLimit(axios.create({
|
||||||
baseURL: import.meta.env.VITE_ESI_URL,
|
baseURL: import.meta.env.VITE_ESI_URL,
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
},
|
},
|
||||||
})
|
}), { maxRPS: 10 })
|
||||||
logResource(esiAxiosInstance)
|
logResource(esiAxiosInstance)
|
||||||
|
|||||||
Reference in New Issue
Block a user