mirror of
https://github.com/calli-eve/eve-pi.git
synced 2026-02-12 10:48:48 +01:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f60003accf | ||
|
|
6f28cc0093 | ||
|
|
c986884ed5 | ||
|
|
4fc97d473e | ||
|
|
de49595f55 | ||
|
|
a1f682e9fc | ||
|
|
67acea9be4 | ||
|
|
98b450fcc7 | ||
|
|
eb15696241 | ||
|
|
741b2480b9 | ||
|
|
b185e5d044 | ||
|
|
f0d4708b43 | ||
|
|
0f33a7ff0c | ||
|
|
bbdcece163 | ||
|
|
2a1e74ca79 | ||
|
|
0e141321b6 | ||
|
|
d433f5420e | ||
|
|
fa5f79068f | ||
|
|
c07dba3afc | ||
|
|
a871bac35f | ||
|
|
eca35f51ac | ||
|
|
9e9ab359ec | ||
|
|
1fc0efd3da | ||
|
|
00a06a9681 | ||
|
|
ac56adbcbe | ||
|
|
a738dc4a22 | ||
|
|
efc28f7e36 | ||
|
|
42f95c17de | ||
|
|
8809fec6e0 | ||
|
|
70fdc4e96f | ||
|
|
09d587c8b0 | ||
|
|
f836785a02 |
@@ -4,3 +4,4 @@ EVE_SSO_SECRET=Secret Key
|
||||
EVE_SSO_CALLBACK_URL=Callback URL (This should be the domain you are hosting at or if run locally it should be http://localhost:3000)
|
||||
NEXT_PUBLIC_PRAISAL_URL=https://praisal.avanto.tk/appraisal/structured.json?persist=no
|
||||
SENTRY_AUTH_TOKEN=Sentry token for error reporting.
|
||||
LOG_LEVEL=warn
|
||||
7
.github/workflows/container.yml
vendored
7
.github/workflows/container.yml
vendored
@@ -40,6 +40,9 @@ jobs:
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
@@ -47,5 +50,5 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
|
||||
@@ -2,7 +2,7 @@
|
||||
version: "2.1"
|
||||
services:
|
||||
eve-pi:
|
||||
build: .
|
||||
image: ghcr.io/calli-eve/eve-pi:latest
|
||||
container_name: eve-pi
|
||||
environment:
|
||||
- EVE_SSO_CLIENT_ID=${EVE_SSO_CLIENT_ID}
|
||||
@@ -10,6 +10,7 @@ services:
|
||||
- EVE_SSO_SECRET=${EVE_SSO_SECRET}
|
||||
- NEXT_PUBLIC_PRAISAL_URL=${NEXT_PUBLIC_PRAISAL_URL}
|
||||
- SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
|
||||
- LOG_LEVEL=warn
|
||||
ports:
|
||||
- 3000:3000
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -43,11 +43,6 @@ module.exports = withSentryConfig(
|
||||
// Transpiles SDK to be compatible with IE11 (increases bundle size)
|
||||
transpileClientSDK: true,
|
||||
|
||||
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
||||
// This can increase your server load as well as your hosting bill.
|
||||
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
|
||||
// side errors will fail.
|
||||
tunnelRoute: "/monitoring",
|
||||
|
||||
// Hides source maps from generated client bundles
|
||||
hideSourceMaps: true,
|
||||
|
||||
588
package-lock.json
generated
588
package-lock.json
generated
@@ -11,19 +11,23 @@
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource/roboto": "^5.0.3",
|
||||
"@hello-pangea/dnd": "^18.0.1",
|
||||
"@mui/icons-material": "^5.11.16",
|
||||
"@mui/material": "^5.13.5",
|
||||
"@sentry/nextjs": "^8.2.1",
|
||||
"@types/node": "20.3.1",
|
||||
"@types/pino": "^7.0.4",
|
||||
"@types/react": "18.2.12",
|
||||
"@types/react-dom": "18.2.5",
|
||||
"autoprefixer": "10.4.14",
|
||||
"chart.js": "^4.4.7",
|
||||
"crypto-js": "^4.1.1",
|
||||
"eslint": "8.42.0",
|
||||
"luxon": "^3.3.0",
|
||||
"luxon": "^3.6.1",
|
||||
"next": "^14.2.23",
|
||||
"next-plausible": "^3.12.0",
|
||||
"pino": "^9.6.0",
|
||||
"pino-pretty": "^13.0.0",
|
||||
"react": "^18.3.1",
|
||||
"react-chartjs-2": "^5.3.0",
|
||||
"react-color": "^2.19.3",
|
||||
@@ -36,7 +40,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/luxon": "^3.3.0",
|
||||
"@types/luxon": "^3.6.1",
|
||||
"@types/react-color": "^3.0.7",
|
||||
"@types/three": "^0.152.1",
|
||||
"eslint-config-next": "^14.2.23",
|
||||
@@ -279,11 +283,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
|
||||
"integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
|
||||
"version": "7.27.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz",
|
||||
"integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
"regenerator-runtime": "^0.14.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -534,6 +539,57 @@
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.3.tgz",
|
||||
"integrity": "sha512-jbZDFwEFARDlo8TqG7th/xjhuq87GYfFpFb+uxuy+0Ng1bhRVgBRWlLj8+WIKhCTOr+h4QXbjpybLWFLUirOwQ=="
|
||||
},
|
||||
"node_modules/@hello-pangea/dnd": {
|
||||
"version": "18.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@hello-pangea/dnd/-/dnd-18.0.1.tgz",
|
||||
"integrity": "sha512-xojVWG8s/TGrKT1fC8K2tIWeejJYTAeJuj36zM//yEm/ZrnZUSFGS15BpO+jGZT1ybWvyXmeDJwPYb4dhWlbZQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.26.7",
|
||||
"css-box-model": "^1.2.1",
|
||||
"raf-schd": "^4.0.3",
|
||||
"react-redux": "^9.2.0",
|
||||
"redux": "^5.0.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@hello-pangea/dnd/node_modules/@types/react": {
|
||||
"version": "19.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.2.tgz",
|
||||
"integrity": "sha512-oxLPMytKchWGbnQM9O7D67uPa9paTNxO7jVoNMXgkkErULBPhPARCfkKL9ytcIJJRGjbsVwW4ugJzyFFvm/Tiw==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@hello-pangea/dnd/node_modules/react-redux": {
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
|
||||
"integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/use-sync-external-store": "^0.0.6",
|
||||
"use-sync-external-store": "^1.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^18.2.25 || ^19",
|
||||
"react": "^18.0 || ^19",
|
||||
"redux": "^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"redux": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.10",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz",
|
||||
@@ -2463,10 +2519,11 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/luxon": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.0.tgz",
|
||||
"integrity": "sha512-uKRI5QORDnrGFYgcdAVnHvEIvEZ8noTpP/Bg+HeUzZghwinDlIS87DEenV5r1YoOF9G4x600YsUXLWZ19rmTmg==",
|
||||
"dev": true
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.6.1.tgz",
|
||||
"integrity": "sha512-GEo4k1yY5PBaPLqEbk+vp2LhVCKPa/TQlTjuCf3exvx6fjB+jVuDa/Zopi8eznEkJf8yeZRzSK/kzG14g5aXPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/mysql": {
|
||||
"version": "2.15.26",
|
||||
@@ -2507,6 +2564,15 @@
|
||||
"@types/pg": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pino": {
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pino/-/pino-7.0.4.tgz",
|
||||
"integrity": "sha512-yKw1UbZOTe7vP1xMQT+oz3FexwgIpBTrM+AC62vWgAkNRULgLTJWfYX+H5/sKPm8VXFbIcXkC3VZPyuaNioZFg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"pino": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/prop-types": {
|
||||
"version": "15.7.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
|
||||
@@ -2604,6 +2670,12 @@
|
||||
"lil-gui": "~0.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/use-sync-external-store": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
|
||||
"integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/webxr": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.2.tgz",
|
||||
@@ -3115,6 +3187,15 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/atomic-sleep": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
|
||||
"integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/autoprefixer": {
|
||||
"version": "10.4.14",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz",
|
||||
@@ -3653,6 +3734,12 @@
|
||||
"simple-swizzle": "^0.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/colorette": {
|
||||
"version": "2.0.20",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
@@ -3711,6 +3798,15 @@
|
||||
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/css-box-model": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz",
|
||||
"integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tiny-invariant": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/csstype": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
@@ -3776,6 +3872,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/dateformat": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
|
||||
"integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
@@ -4977,6 +5082,12 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-copy": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.2.tgz",
|
||||
"integrity": "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -5033,6 +5144,21 @@
|
||||
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
||||
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
|
||||
},
|
||||
"node_modules/fast-redact": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz",
|
||||
"integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-safe-stringify": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
|
||||
"integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-uri": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
|
||||
@@ -5538,6 +5664,12 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/help-me": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz",
|
||||
"integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
@@ -6233,6 +6365,15 @@
|
||||
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/joycon": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
|
||||
"integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
@@ -6391,9 +6532,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/luxon": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz",
|
||||
"integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==",
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
|
||||
"integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
@@ -6872,6 +7014,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-exit-leak-free": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz",
|
||||
"integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
@@ -7119,6 +7270,67 @@
|
||||
"url": "https://github.com/sponsors/jonschlinkert"
|
||||
}
|
||||
},
|
||||
"node_modules/pino": {
|
||||
"version": "9.6.0",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-9.6.0.tgz",
|
||||
"integrity": "sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"atomic-sleep": "^1.0.0",
|
||||
"fast-redact": "^3.1.1",
|
||||
"on-exit-leak-free": "^2.1.0",
|
||||
"pino-abstract-transport": "^2.0.0",
|
||||
"pino-std-serializers": "^7.0.0",
|
||||
"process-warning": "^4.0.0",
|
||||
"quick-format-unescaped": "^4.0.3",
|
||||
"real-require": "^0.2.0",
|
||||
"safe-stable-stringify": "^2.3.1",
|
||||
"sonic-boom": "^4.0.1",
|
||||
"thread-stream": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"pino": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/pino-abstract-transport": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz",
|
||||
"integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"split2": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pino-pretty": {
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-13.0.0.tgz",
|
||||
"integrity": "sha512-cQBBIVG3YajgoUjo1FdKVRX6t9XPxwB9lcNJVD5GCnNM4Y6T12YYx8c6zEejxQsU0wrg9TwmDulcE9LR7qcJqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"colorette": "^2.0.7",
|
||||
"dateformat": "^4.6.3",
|
||||
"fast-copy": "^3.0.2",
|
||||
"fast-safe-stringify": "^2.1.1",
|
||||
"help-me": "^5.0.0",
|
||||
"joycon": "^3.1.1",
|
||||
"minimist": "^1.2.6",
|
||||
"on-exit-leak-free": "^2.1.0",
|
||||
"pino-abstract-transport": "^2.0.0",
|
||||
"pump": "^3.0.0",
|
||||
"secure-json-parse": "^2.4.0",
|
||||
"sonic-boom": "^4.0.1",
|
||||
"strip-json-comments": "^3.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"pino-pretty": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/pino-std-serializers": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz",
|
||||
"integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/possible-typed-array-names": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
|
||||
@@ -7262,6 +7474,22 @@
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/process-warning": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.1.tgz",
|
||||
"integrity": "sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fastify"
|
||||
},
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/fastify"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/progress": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||
@@ -7323,6 +7551,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/quick-format-unescaped": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
|
||||
"integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/raf-schd": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/raf-schd/-/raf-schd-4.0.3.tgz",
|
||||
"integrity": "sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
@@ -7472,6 +7712,21 @@
|
||||
"node": ">=8.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/real-require": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
|
||||
"integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 12.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/redux": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
||||
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/reflect.getprototypeof": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
|
||||
@@ -7496,9 +7751,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/regenerator-runtime": {
|
||||
"version": "0.13.11",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/regexp.prototype.flags": {
|
||||
"version": "1.5.4",
|
||||
@@ -7817,6 +8073,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-stable-stringify": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
|
||||
"integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/scheduler": {
|
||||
"version": "0.23.2",
|
||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
|
||||
@@ -7845,6 +8110,12 @@
|
||||
"url": "https://opencollective.com/webpack"
|
||||
}
|
||||
},
|
||||
"node_modules/secure-json-parse": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",
|
||||
"integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz",
|
||||
@@ -8127,6 +8398,15 @@
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
|
||||
"integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
|
||||
},
|
||||
"node_modules/sonic-boom": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz",
|
||||
"integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"atomic-sleep": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
@@ -8165,6 +8445,15 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/split2": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">= 10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/stacktrace-parser": {
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz",
|
||||
@@ -8663,11 +8952,26 @@
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
||||
},
|
||||
"node_modules/thread-stream": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz",
|
||||
"integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"real-require": "^0.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/three": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/three/-/three-0.154.0.tgz",
|
||||
"integrity": "sha512-Uzz8C/5GesJzv8i+Y2prEMYUwodwZySPcNhuJUdsVMH2Yn4Nm8qlbQe6qRN5fOhg55XB0WiLfTPBxVHxpE60ug=="
|
||||
},
|
||||
"node_modules/tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tinycolor2": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz",
|
||||
@@ -8935,6 +9239,15 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/use-sync-external-store": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz",
|
||||
"integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
@@ -9483,11 +9796,11 @@
|
||||
}
|
||||
},
|
||||
"@babel/runtime": {
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz",
|
||||
"integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==",
|
||||
"version": "7.27.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz",
|
||||
"integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==",
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.13.11"
|
||||
"regenerator-runtime": "^0.14.0"
|
||||
}
|
||||
},
|
||||
"@babel/template": {
|
||||
@@ -9683,6 +9996,39 @@
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-5.0.3.tgz",
|
||||
"integrity": "sha512-jbZDFwEFARDlo8TqG7th/xjhuq87GYfFpFb+uxuy+0Ng1bhRVgBRWlLj8+WIKhCTOr+h4QXbjpybLWFLUirOwQ=="
|
||||
},
|
||||
"@hello-pangea/dnd": {
|
||||
"version": "18.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@hello-pangea/dnd/-/dnd-18.0.1.tgz",
|
||||
"integrity": "sha512-xojVWG8s/TGrKT1fC8K2tIWeejJYTAeJuj36zM//yEm/ZrnZUSFGS15BpO+jGZT1ybWvyXmeDJwPYb4dhWlbZQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.26.7",
|
||||
"css-box-model": "^1.2.1",
|
||||
"raf-schd": "^4.0.3",
|
||||
"react-redux": "^9.2.0",
|
||||
"redux": "^5.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/react": {
|
||||
"version": "19.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.2.tgz",
|
||||
"integrity": "sha512-oxLPMytKchWGbnQM9O7D67uPa9paTNxO7jVoNMXgkkErULBPhPARCfkKL9ytcIJJRGjbsVwW4ugJzyFFvm/Tiw==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"requires": {
|
||||
"csstype": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"react-redux": {
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
|
||||
"integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
|
||||
"requires": {
|
||||
"@types/use-sync-external-store": "^0.0.6",
|
||||
"use-sync-external-store": "^1.4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@humanwhocodes/config-array": {
|
||||
"version": "0.11.10",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz",
|
||||
@@ -10834,9 +11180,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/luxon": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.0.tgz",
|
||||
"integrity": "sha512-uKRI5QORDnrGFYgcdAVnHvEIvEZ8noTpP/Bg+HeUzZghwinDlIS87DEenV5r1YoOF9G4x600YsUXLWZ19rmTmg==",
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.6.1.tgz",
|
||||
"integrity": "sha512-GEo4k1yY5PBaPLqEbk+vp2LhVCKPa/TQlTjuCf3exvx6fjB+jVuDa/Zopi8eznEkJf8yeZRzSK/kzG14g5aXPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/mysql": {
|
||||
@@ -10875,6 +11221,14 @@
|
||||
"@types/pg": "*"
|
||||
}
|
||||
},
|
||||
"@types/pino": {
|
||||
"version": "7.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pino/-/pino-7.0.4.tgz",
|
||||
"integrity": "sha512-yKw1UbZOTe7vP1xMQT+oz3FexwgIpBTrM+AC62vWgAkNRULgLTJWfYX+H5/sKPm8VXFbIcXkC3VZPyuaNioZFg==",
|
||||
"requires": {
|
||||
"pino": "*"
|
||||
}
|
||||
},
|
||||
"@types/prop-types": {
|
||||
"version": "15.7.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
|
||||
@@ -10970,6 +11324,11 @@
|
||||
"lil-gui": "~0.17.0"
|
||||
}
|
||||
},
|
||||
"@types/use-sync-external-store": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
|
||||
"integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg=="
|
||||
},
|
||||
"@types/webxr": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.2.tgz",
|
||||
@@ -11358,6 +11717,11 @@
|
||||
"integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==",
|
||||
"dev": true
|
||||
},
|
||||
"atomic-sleep": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz",
|
||||
"integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="
|
||||
},
|
||||
"autoprefixer": {
|
||||
"version": "10.4.14",
|
||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz",
|
||||
@@ -11692,6 +12056,11 @@
|
||||
"simple-swizzle": "^0.2.2"
|
||||
}
|
||||
},
|
||||
"colorette": {
|
||||
"version": "2.0.20",
|
||||
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
|
||||
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.20.3",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||
@@ -11740,6 +12109,14 @@
|
||||
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
|
||||
"integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
|
||||
},
|
||||
"css-box-model": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz",
|
||||
"integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==",
|
||||
"requires": {
|
||||
"tiny-invariant": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"csstype": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
@@ -11784,6 +12161,11 @@
|
||||
"is-data-view": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"dateformat": {
|
||||
"version": "4.6.3",
|
||||
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
|
||||
"integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA=="
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
|
||||
@@ -12613,6 +12995,11 @@
|
||||
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
|
||||
"integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="
|
||||
},
|
||||
"fast-copy": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.2.tgz",
|
||||
"integrity": "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ=="
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@@ -12663,6 +13050,16 @@
|
||||
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
||||
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
|
||||
},
|
||||
"fast-redact": {
|
||||
"version": "3.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.5.0.tgz",
|
||||
"integrity": "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A=="
|
||||
},
|
||||
"fast-safe-stringify": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
|
||||
"integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="
|
||||
},
|
||||
"fast-uri": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.6.tgz",
|
||||
@@ -12991,6 +13388,11 @@
|
||||
"function-bind": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"help-me": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz",
|
||||
"integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg=="
|
||||
},
|
||||
"hoist-non-react-statics": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
|
||||
@@ -13421,6 +13823,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"joycon": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
|
||||
"integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw=="
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
@@ -13546,9 +13953,9 @@
|
||||
}
|
||||
},
|
||||
"luxon": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz",
|
||||
"integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg=="
|
||||
"version": "3.6.1",
|
||||
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
|
||||
"integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ=="
|
||||
},
|
||||
"magic-string": {
|
||||
"version": "0.30.17",
|
||||
@@ -13841,6 +14248,11 @@
|
||||
"es-object-atoms": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"on-exit-leak-free": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz",
|
||||
"integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA=="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
@@ -14007,6 +14419,57 @@
|
||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="
|
||||
},
|
||||
"pino": {
|
||||
"version": "9.6.0",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-9.6.0.tgz",
|
||||
"integrity": "sha512-i85pKRCt4qMjZ1+L7sy2Ag4t1atFcdbEt76+7iRJn1g2BvsnRMGu9p8pivl9fs63M2kF/A0OacFZhTub+m/qMg==",
|
||||
"requires": {
|
||||
"atomic-sleep": "^1.0.0",
|
||||
"fast-redact": "^3.1.1",
|
||||
"on-exit-leak-free": "^2.1.0",
|
||||
"pino-abstract-transport": "^2.0.0",
|
||||
"pino-std-serializers": "^7.0.0",
|
||||
"process-warning": "^4.0.0",
|
||||
"quick-format-unescaped": "^4.0.3",
|
||||
"real-require": "^0.2.0",
|
||||
"safe-stable-stringify": "^2.3.1",
|
||||
"sonic-boom": "^4.0.1",
|
||||
"thread-stream": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"pino-abstract-transport": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-2.0.0.tgz",
|
||||
"integrity": "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==",
|
||||
"requires": {
|
||||
"split2": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"pino-pretty": {
|
||||
"version": "13.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-13.0.0.tgz",
|
||||
"integrity": "sha512-cQBBIVG3YajgoUjo1FdKVRX6t9XPxwB9lcNJVD5GCnNM4Y6T12YYx8c6zEejxQsU0wrg9TwmDulcE9LR7qcJqA==",
|
||||
"requires": {
|
||||
"colorette": "^2.0.7",
|
||||
"dateformat": "^4.6.3",
|
||||
"fast-copy": "^3.0.2",
|
||||
"fast-safe-stringify": "^2.1.1",
|
||||
"help-me": "^5.0.0",
|
||||
"joycon": "^3.1.1",
|
||||
"minimist": "^1.2.6",
|
||||
"on-exit-leak-free": "^2.1.0",
|
||||
"pino-abstract-transport": "^2.0.0",
|
||||
"pump": "^3.0.0",
|
||||
"secure-json-parse": "^2.4.0",
|
||||
"sonic-boom": "^4.0.1",
|
||||
"strip-json-comments": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"pino-std-serializers": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz",
|
||||
"integrity": "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA=="
|
||||
},
|
||||
"possible-typed-array-names": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
|
||||
@@ -14091,6 +14554,11 @@
|
||||
"fast-diff": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"process-warning": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-warning/-/process-warning-4.0.1.tgz",
|
||||
"integrity": "sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q=="
|
||||
},
|
||||
"progress": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||
@@ -14130,6 +14598,16 @@
|
||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="
|
||||
},
|
||||
"quick-format-unescaped": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
|
||||
"integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
|
||||
},
|
||||
"raf-schd": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/raf-schd/-/raf-schd-4.0.3.tgz",
|
||||
"integrity": "sha512-tQkJl2GRWh83ui2DiPTJz9wEiMN20syf+5oKfB03yYP7ioZcJwsIK8FjrtLwH1m7C7e+Tt2yYBlrOpdT+dyeIQ=="
|
||||
},
|
||||
"randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
@@ -14244,6 +14722,16 @@
|
||||
"picomatch": "^2.2.1"
|
||||
}
|
||||
},
|
||||
"real-require": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz",
|
||||
"integrity": "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg=="
|
||||
},
|
||||
"redux": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
||||
"integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w=="
|
||||
},
|
||||
"reflect.getprototypeof": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz",
|
||||
@@ -14261,9 +14749,9 @@
|
||||
}
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
"version": "0.13.11",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
|
||||
},
|
||||
"regexp.prototype.flags": {
|
||||
"version": "1.5.4",
|
||||
@@ -14454,6 +14942,11 @@
|
||||
"is-regex": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"safe-stable-stringify": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
|
||||
"integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="
|
||||
},
|
||||
"scheduler": {
|
||||
"version": "0.23.2",
|
||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
|
||||
@@ -14473,6 +14966,11 @@
|
||||
"ajv-keywords": "^3.5.2"
|
||||
}
|
||||
},
|
||||
"secure-json-parse": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",
|
||||
"integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.0.tgz",
|
||||
@@ -14664,6 +15162,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sonic-boom": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.0.tgz",
|
||||
"integrity": "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==",
|
||||
"requires": {
|
||||
"atomic-sleep": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
|
||||
@@ -14692,6 +15198,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"split2": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
|
||||
"integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="
|
||||
},
|
||||
"stacktrace-parser": {
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz",
|
||||
@@ -15023,11 +15534,24 @@
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
"integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw=="
|
||||
},
|
||||
"thread-stream": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-3.1.0.tgz",
|
||||
"integrity": "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==",
|
||||
"requires": {
|
||||
"real-require": "^0.2.0"
|
||||
}
|
||||
},
|
||||
"three": {
|
||||
"version": "0.154.0",
|
||||
"resolved": "https://registry.npmjs.org/three/-/three-0.154.0.tgz",
|
||||
"integrity": "sha512-Uzz8C/5GesJzv8i+Y2prEMYUwodwZySPcNhuJUdsVMH2Yn4Nm8qlbQe6qRN5fOhg55XB0WiLfTPBxVHxpE60ug=="
|
||||
},
|
||||
"tiny-invariant": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||
"integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="
|
||||
},
|
||||
"tinycolor2": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz",
|
||||
@@ -15201,6 +15725,12 @@
|
||||
"punycode": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"use-sync-external-store": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz",
|
||||
"integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==",
|
||||
"requires": {}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
|
||||
@@ -13,19 +13,23 @@
|
||||
"@emotion/react": "^11.11.1",
|
||||
"@emotion/styled": "^11.11.0",
|
||||
"@fontsource/roboto": "^5.0.3",
|
||||
"@hello-pangea/dnd": "^18.0.1",
|
||||
"@mui/icons-material": "^5.11.16",
|
||||
"@mui/material": "^5.13.5",
|
||||
"@sentry/nextjs": "^8.2.1",
|
||||
"@types/node": "20.3.1",
|
||||
"@types/pino": "^7.0.4",
|
||||
"@types/react": "18.2.12",
|
||||
"@types/react-dom": "18.2.5",
|
||||
"autoprefixer": "10.4.14",
|
||||
"chart.js": "^4.4.7",
|
||||
"crypto-js": "^4.1.1",
|
||||
"eslint": "8.42.0",
|
||||
"luxon": "^3.3.0",
|
||||
"luxon": "^3.6.1",
|
||||
"next": "^14.2.23",
|
||||
"next-plausible": "^3.12.0",
|
||||
"pino": "^9.6.0",
|
||||
"pino-pretty": "^13.0.0",
|
||||
"react": "^18.3.1",
|
||||
"react-chartjs-2": "^5.3.0",
|
||||
"react-color": "^2.19.3",
|
||||
@@ -38,7 +42,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/luxon": "^3.3.0",
|
||||
"@types/luxon": "^3.6.1",
|
||||
"@types/react-color": "^3.0.7",
|
||||
"@types/three": "^0.152.1",
|
||||
"eslint-config-next": "^14.2.23",
|
||||
|
||||
@@ -1,40 +1,231 @@
|
||||
import { AccessToken } from "@/types";
|
||||
import { Box, Stack, Typography, useTheme } from "@mui/material";
|
||||
import { Box, Stack, Typography, useTheme, Paper, IconButton, Divider } from "@mui/material";
|
||||
import { CharacterRow } from "../Characters/CharacterRow";
|
||||
import { PlanetaryInteractionRow } from "../PlanetaryInteraction/PlanetaryInteractionRow";
|
||||
import { SessionContext } from "@/app/context/Context";
|
||||
import { useContext } from "react";
|
||||
import { useContext, useState, useEffect } from "react";
|
||||
import { PlanRow } from "./PlanRow";
|
||||
export const AccountCard = ({ characters }: { characters: AccessToken[] }) => {
|
||||
const theme = useTheme();
|
||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
||||
import { planetCalculations } from "@/planets";
|
||||
import { EvePraisalResult } from "@/eve-praisal";
|
||||
import { STORAGE_IDS } from "@/const";
|
||||
|
||||
interface AccountTotals {
|
||||
monthlyEstimate: number;
|
||||
storageValue: number;
|
||||
planetCount: number;
|
||||
characterCount: number;
|
||||
runningExtractors: number;
|
||||
totalExtractors: number;
|
||||
}
|
||||
|
||||
const calculateAccountTotals = (characters: AccessToken[], piPrices: EvePraisalResult | undefined): AccountTotals => {
|
||||
let totalMonthlyEstimate = 0;
|
||||
let totalStorageValue = 0;
|
||||
let totalPlanetCount = 0;
|
||||
let totalCharacterCount = characters.length;
|
||||
let runningExtractors = 0;
|
||||
let totalExtractors = 0;
|
||||
|
||||
characters.forEach((character) => {
|
||||
totalPlanetCount += character.planets.length;
|
||||
character.planets.forEach((planet) => {
|
||||
const { localExports, extractors } = planetCalculations(planet);
|
||||
const planetConfig = character.planetConfig.find(p => p.planetId === planet.planet_id);
|
||||
|
||||
// Count running and total extractors
|
||||
if (!planetConfig?.excludeFromTotals) {
|
||||
extractors.forEach(extractor => {
|
||||
totalExtractors++;
|
||||
if (extractor.expiry_time && new Date(extractor.expiry_time) > new Date()) {
|
||||
runningExtractors++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Calculate monthly estimate
|
||||
if (!planetConfig?.excludeFromTotals) {
|
||||
localExports.forEach((exportItem) => {
|
||||
const valueInMillions = (((piPrices?.appraisal.items.find(
|
||||
(a) => a.typeID === exportItem.typeId,
|
||||
)?.prices.sell.min ?? 0) *
|
||||
exportItem.amount) /
|
||||
1000000) *
|
||||
24 *
|
||||
30;
|
||||
totalMonthlyEstimate += valueInMillions;
|
||||
});
|
||||
}
|
||||
|
||||
if (!planetConfig?.excludeFromTotals) {
|
||||
planet.info.pins
|
||||
.filter(pin => STORAGE_IDS().some(storage => storage.type_id === pin.type_id))
|
||||
.forEach(storage => {
|
||||
storage.contents?.forEach(content => {
|
||||
const valueInMillions = (piPrices?.appraisal.items.find(
|
||||
(a) => a.typeID === content.type_id,
|
||||
)?.prices.sell.min ?? 0) * content.amount / 1000000;
|
||||
totalStorageValue += valueInMillions;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
monthlyEstimate: totalMonthlyEstimate,
|
||||
storageValue: totalStorageValue,
|
||||
planetCount: totalPlanetCount,
|
||||
characterCount: totalCharacterCount,
|
||||
runningExtractors,
|
||||
totalExtractors
|
||||
};
|
||||
};
|
||||
|
||||
export const AccountCard = ({ characters, isCollapsed: propIsCollapsed }: { characters: AccessToken[], isCollapsed?: boolean }) => {
|
||||
const theme = useTheme();
|
||||
const [localIsCollapsed, setLocalIsCollapsed] = useState(false);
|
||||
const { planMode, piPrices } = useContext(SessionContext);
|
||||
const { monthlyEstimate, storageValue, planetCount, characterCount, runningExtractors, totalExtractors } = calculateAccountTotals(characters, piPrices);
|
||||
|
||||
// Update local collapse state when prop changes
|
||||
useEffect(() => {
|
||||
setLocalIsCollapsed(propIsCollapsed ?? false);
|
||||
}, [propIsCollapsed]);
|
||||
|
||||
const { planMode } = useContext(SessionContext);
|
||||
return (
|
||||
<Box
|
||||
<Paper
|
||||
elevation={2}
|
||||
sx={{
|
||||
padding: 1,
|
||||
borderBottom: theme.custom.compactMode ? "" : "solid 1px gray",
|
||||
padding: theme.custom.compactMode ? theme.spacing(1) : theme.spacing(2),
|
||||
margin: theme.spacing(1),
|
||||
display: 'flex',
|
||||
alignItems: 'flex-start',
|
||||
gap: 1,
|
||||
backgroundColor: theme.palette.background.paper,
|
||||
transition: 'all 0.2s ease-in-out',
|
||||
cursor: 'grab',
|
||||
'&:hover': {
|
||||
boxShadow: theme.shadows[4],
|
||||
},
|
||||
'&:active': {
|
||||
boxShadow: theme.shadows[8],
|
||||
cursor: 'grabbing',
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Typography style={{ fontSize: "0.8rem" }} paddingLeft={2}>
|
||||
{characters[0].account !== "-"
|
||||
? `Account: ${characters[0].account}`
|
||||
: "No account name"}
|
||||
</Typography>
|
||||
{characters.map((c) => (
|
||||
<Stack
|
||||
key={c.character.characterId}
|
||||
direction="row"
|
||||
alignItems="flex-start"
|
||||
<Box sx={{ flex: 1 }}>
|
||||
<Box
|
||||
sx={{
|
||||
backgroundColor: theme.palette.background.default,
|
||||
borderRadius: 1,
|
||||
padding: theme.spacing(1),
|
||||
marginBottom: theme.spacing(2),
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
cursor: 'pointer',
|
||||
'&:hover': {
|
||||
backgroundColor: theme.palette.action.hover,
|
||||
},
|
||||
}}
|
||||
onClick={() => setLocalIsCollapsed(!localIsCollapsed)}
|
||||
>
|
||||
<CharacterRow character={c} />
|
||||
{planMode ? (
|
||||
<PlanRow character={c} />
|
||||
) : (
|
||||
<PlanetaryInteractionRow character={c} />
|
||||
)}
|
||||
</Stack>
|
||||
))}
|
||||
</Box>
|
||||
<Box>
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "0.9rem",
|
||||
fontWeight: 500,
|
||||
color: theme.palette.text.primary,
|
||||
}}
|
||||
>
|
||||
{characters.length > 0 && characters[0].account !== "-"
|
||||
? `Account: ${characters[0].account}`
|
||||
: "No account name"}
|
||||
</Typography>
|
||||
<Box sx={{
|
||||
display: 'flex',
|
||||
gap: 2,
|
||||
flexWrap: 'wrap',
|
||||
mt: 1,
|
||||
alignItems: 'center'
|
||||
}}>
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "0.8rem",
|
||||
color: theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
Monthly: {monthlyEstimate >= 1000
|
||||
? `${(monthlyEstimate / 1000).toFixed(2)} B`
|
||||
: `${monthlyEstimate.toFixed(2)} M`} ISK
|
||||
</Typography>
|
||||
<Divider orientation="vertical" flexItem sx={{ height: 16, borderColor: theme.palette.divider }} />
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "0.8rem",
|
||||
color: theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
Storage: {storageValue >= 1000
|
||||
? `${(storageValue / 1000).toFixed(2)} B`
|
||||
: `${storageValue.toFixed(2)} M`} ISK
|
||||
</Typography>
|
||||
<Divider orientation="vertical" flexItem sx={{ height: 16, borderColor: theme.palette.divider }} />
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "0.8rem",
|
||||
color: theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
Planets: {planetCount}
|
||||
</Typography>
|
||||
<Divider orientation="vertical" flexItem sx={{ height: 16, borderColor: theme.palette.divider }} />
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "0.8rem",
|
||||
color: theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
Characters: {characterCount}
|
||||
</Typography>
|
||||
<Divider orientation="vertical" flexItem sx={{ height: 16, borderColor: theme.palette.divider }} />
|
||||
<Typography
|
||||
sx={{
|
||||
fontSize: "0.8rem",
|
||||
color: runningExtractors < totalExtractors ? theme.palette.error.main : theme.palette.text.secondary,
|
||||
}}
|
||||
>
|
||||
Extractors: {runningExtractors}/{totalExtractors}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
<IconButton
|
||||
size="small"
|
||||
sx={{
|
||||
transform: localIsCollapsed ? 'rotate(-90deg)' : 'rotate(0deg)',
|
||||
transition: 'transform 0.2s ease-in-out'
|
||||
}}
|
||||
>
|
||||
{localIsCollapsed ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
|
||||
</IconButton>
|
||||
</Box>
|
||||
{!localIsCollapsed && characters.map((c) => (
|
||||
<Stack
|
||||
key={c.character.characterId}
|
||||
direction="row"
|
||||
alignItems="flex-start"
|
||||
>
|
||||
<CharacterRow character={c} />
|
||||
{planMode ? (
|
||||
<PlanRow character={c} />
|
||||
) : (
|
||||
<PlanetaryInteractionRow character={c} />
|
||||
)}
|
||||
</Stack>
|
||||
))}
|
||||
</Box>
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { SessionContext } from "@/app/context/Context";
|
||||
import { Button, Tooltip } from "@mui/material";
|
||||
import { useContext } from "react";
|
||||
|
||||
export const AlertModeButton = () => {
|
||||
const { alertMode, toggleAlertMode } = useContext(SessionContext);
|
||||
return (
|
||||
<Tooltip title="Toggle alert mode to show only accounts and planets that need action.">
|
||||
<Button
|
||||
style={{
|
||||
backgroundColor: alertMode
|
||||
? "rgba(144, 202, 249, 0.08)"
|
||||
: "inherit",
|
||||
}}
|
||||
onClick={toggleAlertMode}
|
||||
>
|
||||
Alert mode
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
@@ -12,20 +12,25 @@ import * as React from "react";
|
||||
import { DowloadButton } from "../Backup/DowloadButton";
|
||||
import { UploadButton } from "../Backup/UploadButton";
|
||||
import { CCPButton } from "../CCP/CCPButton";
|
||||
import { CompactModeButton } from "../CompactModeButton/CompactModeButton";
|
||||
import { DiscordButton } from "../Discord/DiscordButton";
|
||||
import { GitHubButton } from "../Github/GitHubButton";
|
||||
import { LoginButton } from "../Login/LoginButton";
|
||||
import { PlanModeButton } from "../PlanModeButton/PlanModeButton";
|
||||
import { SettingsButton } from "../Settings/SettingsButtons";
|
||||
import { AlertModeButton } from "../AlertModeButton/AlertModeButton";
|
||||
import { SupportButton } from "../SupportButton/SupportButton";
|
||||
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
DialogTitle,
|
||||
DialogContent,
|
||||
DialogContentText,
|
||||
DialogActions,
|
||||
} from "@mui/material";
|
||||
import { useState } from "react";
|
||||
|
||||
function ResponsiveAppBar() {
|
||||
const [anchorElNav, setAnchorElNav] = React.useState<null | HTMLElement>(
|
||||
null,
|
||||
);
|
||||
const [faqOpen, setFaqOpen] = useState(false);
|
||||
|
||||
const handleOpenNavMenu = (event: React.MouseEvent<HTMLElement>) => {
|
||||
setAnchorElNav(event.currentTarget);
|
||||
@@ -102,23 +107,26 @@ function ResponsiveAppBar() {
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<GitHubButton />
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<CCPButton />
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<SupportButton />
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<SettingsButton />
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<CompactModeButton />
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
handleCloseNavMenu();
|
||||
setFaqOpen(true);
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
href=""
|
||||
style={{ width: "100%" }}
|
||||
sx={{ color: "white", display: "flex", justifyContent: "flex-start" }}
|
||||
>
|
||||
FAQ
|
||||
</Button>
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<PlanModeButton />
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleCloseNavMenu}>
|
||||
<AlertModeButton />
|
||||
<CCPButton />
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Box>
|
||||
@@ -146,7 +154,7 @@ function ResponsiveAppBar() {
|
||||
flexGrow: 1,
|
||||
display: { xs: "none", md: "flex" },
|
||||
alignItems: "center",
|
||||
gap: "0.2rem"
|
||||
gap: "0.2rem",
|
||||
}}
|
||||
>
|
||||
<LoginButton />
|
||||
@@ -154,15 +162,132 @@ function ResponsiveAppBar() {
|
||||
<UploadButton />
|
||||
<DiscordButton />
|
||||
<GitHubButton />
|
||||
<CCPButton />
|
||||
<SupportButton />
|
||||
|
||||
<SettingsButton />
|
||||
<CompactModeButton />
|
||||
<PlanModeButton />
|
||||
<AlertModeButton />
|
||||
<Button onClick={() => setFaqOpen(true)} color="inherit">
|
||||
FAQ
|
||||
</Button>
|
||||
<CCPButton />
|
||||
</Box>
|
||||
</Toolbar>
|
||||
</Container>
|
||||
<Dialog
|
||||
open={faqOpen}
|
||||
onClose={() => setFaqOpen(false)}
|
||||
aria-labelledby="faq-dialog-title"
|
||||
>
|
||||
<DialogTitle id="faq-dialog-title">
|
||||
Frequently Asked Questions
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
<strong>EVE Online Partner Code</strong>
|
||||
<br />
|
||||
Consider using my partner code for CCP related purchases to support
|
||||
this project:
|
||||
<Button
|
||||
href=""
|
||||
style={{ width: "100%" }}
|
||||
sx={{ color: "white", display: "block" }}
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText("CALLIEVE");
|
||||
}}
|
||||
>
|
||||
CALLIEVE
|
||||
</Button>{" "}
|
||||
Click button above to copy to clipboard.
|
||||
<br />
|
||||
<br />
|
||||
<strong>What is this application?</strong>
|
||||
<br />
|
||||
This EVE Online Planetary Interaction tool that helps you track and
|
||||
manage your colonies and production chains. Main usecase is to see
|
||||
if your extractors are running.
|
||||
<br />
|
||||
<br />
|
||||
<strong>How do I add characters?</strong>
|
||||
<br />
|
||||
You can add characters by clicking the "Add Character"
|
||||
button in the app bar and following the authentication process.
|
||||
<br />
|
||||
<br />
|
||||
<strong>Why don't my storage numbers add up?</strong>
|
||||
<br />
|
||||
EVE Online API (ESI) provides planetary interaction endpoints. These
|
||||
are updated when you submit changes to planet. For example after an
|
||||
extractor restart.
|
||||
<br />
|
||||
<br />
|
||||
<strong>What does exclude mean?</strong>
|
||||
<br />
|
||||
Exclude means that this planet will not be counted in totals. This
|
||||
is useful if you have longer production chains where exports of a
|
||||
planet are consumed by another planet.
|
||||
<br />
|
||||
<br />
|
||||
<strong>How do see my planets production chains?</strong>
|
||||
<br />
|
||||
Click on the planet row to open the extraction simulation.
|
||||
<br />
|
||||
<br />
|
||||
<strong>What is Compact Mode?</strong>
|
||||
<br />
|
||||
Compact Mode reduces the size of character cards to show more
|
||||
information at once. You can toggle it in the settings.
|
||||
<br />
|
||||
<br />
|
||||
<strong>What is Alert Mode?</strong>
|
||||
<br />
|
||||
Alert mode shows only the planets that have extractors offline and
|
||||
need attention.
|
||||
<br />
|
||||
<br />
|
||||
<strong>What does off-blanace mean?</strong>
|
||||
<br />
|
||||
Off-blanace alert shows up for planets that have two extractors that
|
||||
are extracting different amount of material. Treshold can be set in
|
||||
settings. Generally you want to keep this below 1000.
|
||||
<br />
|
||||
<br />
|
||||
<strong>How do I reorder accounts?</strong>
|
||||
<br />
|
||||
You can drag and drop account cards to reorder them. The order will
|
||||
be saved automatically.
|
||||
<br />
|
||||
<br />
|
||||
<strong>How do I add a character to account groups?</strong>
|
||||
<br />
|
||||
You can add a character to an account group by clicking the cog on
|
||||
the character card and typing in the account/group name.
|
||||
<br />
|
||||
<br />
|
||||
<strong>I like icons! Why so much text?</strong>
|
||||
<br />
|
||||
Toggle this option in settings.
|
||||
<br />
|
||||
<br />
|
||||
<strong>I like colors! Why your alert colors are so ugly?</strong>
|
||||
<br />
|
||||
Change the color scheme in settings.
|
||||
<br />
|
||||
<br />
|
||||
<strong>What does the 3D view do?</strong>
|
||||
<br />
|
||||
Nothing. Just made it for fun
|
||||
<br />
|
||||
<br />
|
||||
<strong>Why are planet settings empty?</strong>
|
||||
<br />
|
||||
Its a work in progress feature. Plan is to be able to configuer
|
||||
planet and planet exports to belong to production chains.
|
||||
<br />
|
||||
<br />
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setFaqOpen(false)}>Close</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</AppBar>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Dialog, DialogActions, DialogTitle } from "@mui/material";
|
||||
import { Button, Dialog, DialogActions, DialogTitle, Box } from "@mui/material";
|
||||
import { AccessToken, CharacterUpdate } from "../../../types";
|
||||
import { useEffect, useState, KeyboardEvent } from "react";
|
||||
import TextField from "@mui/material/TextField";
|
||||
@@ -34,7 +34,9 @@ export const CharacterDialog = ({
|
||||
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
|
||||
if (event.key === "Enter") {
|
||||
closeDialog();
|
||||
character && updateCharacter(character, { account, comment });
|
||||
if (character) {
|
||||
updateCharacter(character, { account, comment });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,16 +46,27 @@ export const CharacterDialog = ({
|
||||
onClose={closeDialog}
|
||||
fullWidth={true}
|
||||
>
|
||||
<DialogTitle>{character && character.character.name}</DialogTitle>
|
||||
<TextField
|
||||
id="outlined-basic"
|
||||
label="Account name"
|
||||
variant="outlined"
|
||||
value={account ?? ""}
|
||||
sx={{ margin: 1 }}
|
||||
onChange={(event) => setAccount(event.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
<DialogTitle>{character?.character?.name}</DialogTitle>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', margin: 1 }}>
|
||||
<TextField
|
||||
id="outlined-basic"
|
||||
label="Account name"
|
||||
variant="outlined"
|
||||
value={account ?? ""}
|
||||
sx={{ flex: 1 }}
|
||||
onChange={(event) => setAccount(event.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setAccount("-");
|
||||
}}
|
||||
variant="outlined"
|
||||
sx={{ ml: 1 }}
|
||||
>
|
||||
Clear account
|
||||
</Button>
|
||||
</Box>
|
||||
<TextField
|
||||
id="outlined-basic"
|
||||
label="System"
|
||||
@@ -77,6 +90,7 @@ export const CharacterDialog = ({
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => {
|
||||
console.log("Saving character", character, { account, comment, system });
|
||||
character &&
|
||||
updateCharacter(character, { account, comment, system });
|
||||
closeDialog();
|
||||
|
||||
@@ -7,16 +7,18 @@ import { styled, useTheme } from "@mui/material/styles";
|
||||
import React from "react";
|
||||
import { CharacterDialog } from "./CharacterDialog";
|
||||
import { AccessToken } from "@/types";
|
||||
import { Box, Button, Tooltip } from "@mui/material";
|
||||
import { Box, Tooltip, IconButton, Typography } from "@mui/material";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
import { EVE_IMAGE_URL } from "@/const";
|
||||
import { CharacterContext } from "@/app/context/Context";
|
||||
|
||||
const StackItem = styled(Stack)(({ theme }) => ({
|
||||
...theme.typography.body2,
|
||||
padding: theme.custom.compactMode ? theme.spacing(1) : theme.spacing(2),
|
||||
display: "flex",
|
||||
textAlign: "left",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
alignItems: "flex-start",
|
||||
}));
|
||||
|
||||
export const CharacterRow = ({ character }: { character: AccessToken }) => {
|
||||
@@ -29,8 +31,6 @@ export const CharacterRow = ({ character }: { character: AccessToken }) => {
|
||||
return (
|
||||
<StackItem
|
||||
key={character.character.characterId}
|
||||
alignItems="flex-start"
|
||||
justifyContent="flex-start"
|
||||
>
|
||||
<CharacterDialog
|
||||
character={selectedCharacter}
|
||||
@@ -38,13 +38,49 @@ export const CharacterRow = ({ character }: { character: AccessToken }) => {
|
||||
updateCharacter={updateCharacter}
|
||||
closeDialog={() => setSelectedCharacter(undefined)}
|
||||
/>
|
||||
<Typography
|
||||
sx={{
|
||||
whiteSpace: "nowrap",
|
||||
fontSize: theme.custom.smallText,
|
||||
textAlign: "left",
|
||||
lineHeight: 1.2,
|
||||
marginBottom: "0.4rem",
|
||||
marginLeft: "0.2rem",
|
||||
overflow: "visible",
|
||||
textOverflow: "clip",
|
||||
width: "1rem"
|
||||
}}
|
||||
>
|
||||
{character.character.name}
|
||||
</Typography>
|
||||
<Tooltip title={character.comment}>
|
||||
<Box
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
maxWidth={120}
|
||||
onClick={() => setSelectedCharacter(character)}
|
||||
position="relative"
|
||||
sx={{ cursor: "pointer" }}
|
||||
>
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setSelectedCharacter(character);
|
||||
}}
|
||||
sx={{
|
||||
p: 0,
|
||||
position: "absolute",
|
||||
top: 4,
|
||||
left: 4,
|
||||
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
||||
"&:hover": {
|
||||
backgroundColor: "rgba(0, 0, 0, 0.7)",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<SettingsIcon fontSize="small" sx={{ color: "white" }} />
|
||||
</IconButton>
|
||||
<Image
|
||||
unoptimized
|
||||
src={`${EVE_IMAGE_URL}/characters/${character.character.characterId}/portrait?size=128`}
|
||||
@@ -53,16 +89,6 @@ export const CharacterRow = ({ character }: { character: AccessToken }) => {
|
||||
height={theme.custom.cardImageSize}
|
||||
style={{ marginBottom: "0.2rem", borderRadius: 8 }}
|
||||
/>
|
||||
<Button
|
||||
style={{
|
||||
padding: 6,
|
||||
fontSize: theme.custom.smallText,
|
||||
lineHeight: 1,
|
||||
}}
|
||||
variant="outlined"
|
||||
>
|
||||
{character.character.name}
|
||||
</Button>
|
||||
</Box>
|
||||
</Tooltip>
|
||||
</StackItem>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { SessionContext } from "@/app/context/Context";
|
||||
import { Button, Tooltip } from "@mui/material";
|
||||
import { useContext } from "react";
|
||||
|
||||
export const CompactModeButton = () => {
|
||||
const { compactMode, toggleCompactMode } = useContext(SessionContext);
|
||||
return (
|
||||
<Tooltip title="Toggle compact layout for widescreen">
|
||||
<Button
|
||||
style={{
|
||||
backgroundColor: compactMode
|
||||
? "rgba(144, 202, 249, 0.08)"
|
||||
: "inherit",
|
||||
}}
|
||||
onClick={toggleCompactMode}
|
||||
>
|
||||
Compact mode
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
@@ -5,12 +5,22 @@ import {
|
||||
Grid,
|
||||
ThemeProvider,
|
||||
createTheme,
|
||||
Button,
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import { AccountCard } from "./Account/AccountCard";
|
||||
import { AccessToken } from "@/types";
|
||||
import { CharacterContext, SessionContext } from "../context/Context";
|
||||
import ResponsiveAppBar from "./AppBar/AppBar";
|
||||
import { Summary } from "./Summary/Summary";
|
||||
import {
|
||||
DragDropContext,
|
||||
Droppable,
|
||||
Draggable,
|
||||
DropResult,
|
||||
} from "@hello-pangea/dnd";
|
||||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
||||
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
|
||||
|
||||
interface Grouped {
|
||||
[key: string]: AccessToken[];
|
||||
@@ -38,7 +48,47 @@ declare module "@mui/material/styles" {
|
||||
}
|
||||
|
||||
export const MainGrid = () => {
|
||||
const { characters } = useContext(CharacterContext);
|
||||
const { characters, updateCharacter } = useContext(CharacterContext);
|
||||
const { compactMode, toggleCompactMode, alertMode, toggleAlertMode, planMode, togglePlanMode, extractionTimeMode, toggleExtractionTimeMode } = useContext(SessionContext);
|
||||
const [accountOrder, setAccountOrder] = useState<string[]>([]);
|
||||
const [allCollapsed, setAllCollapsed] = useState(false);
|
||||
|
||||
// Initialize account order when characters change
|
||||
useEffect(() => {
|
||||
const currentAccounts = Object.keys(
|
||||
characters.reduce<Grouped>((group, character) => {
|
||||
const { account } = character;
|
||||
group[account ?? ""] = group[account ?? ""] ?? [];
|
||||
group[account ?? ""].push(character);
|
||||
return group;
|
||||
}, {}),
|
||||
);
|
||||
|
||||
const savedOrder = localStorage.getItem("accountOrder");
|
||||
if (savedOrder) {
|
||||
try {
|
||||
const parsedOrder = JSON.parse(savedOrder);
|
||||
const validOrder = parsedOrder.filter((account: string) =>
|
||||
currentAccounts.includes(account),
|
||||
);
|
||||
const newAccounts = currentAccounts.filter(
|
||||
(account) => !validOrder.includes(account),
|
||||
);
|
||||
setAccountOrder([...validOrder, ...newAccounts]);
|
||||
} catch (e) {
|
||||
setAccountOrder(currentAccounts);
|
||||
}
|
||||
} else {
|
||||
setAccountOrder(currentAccounts);
|
||||
}
|
||||
}, [characters]);
|
||||
|
||||
useEffect(() => {
|
||||
if (accountOrder.length > 0) {
|
||||
localStorage.setItem("accountOrder", JSON.stringify(accountOrder));
|
||||
}
|
||||
}, [accountOrder]);
|
||||
|
||||
const groupByAccount = characters.reduce<Grouped>((group, character) => {
|
||||
const { account } = character;
|
||||
group[account ?? ""] = group[account ?? ""] ?? [];
|
||||
@@ -46,7 +96,6 @@ export const MainGrid = () => {
|
||||
return group;
|
||||
}, {});
|
||||
|
||||
const { compactMode } = useContext(SessionContext);
|
||||
const [darkTheme, setDarkTheme] = useState(
|
||||
createTheme({
|
||||
palette: {
|
||||
@@ -79,24 +128,142 @@ export const MainGrid = () => {
|
||||
);
|
||||
}, [compactMode]);
|
||||
|
||||
const handleDragEnd = (result: DropResult) => {
|
||||
if (!result.destination) return;
|
||||
|
||||
const items = Array.from(accountOrder);
|
||||
const [reorderedItem] = items.splice(result.source.index, 1);
|
||||
items.splice(result.destination.index, 0, reorderedItem);
|
||||
|
||||
setAccountOrder(items);
|
||||
};
|
||||
|
||||
const DragDropContextComponent = DragDropContext as any;
|
||||
const DroppableComponent = Droppable as any;
|
||||
const DraggableComponent = Draggable as any;
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={darkTheme}>
|
||||
<CssBaseline />
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
<ResponsiveAppBar />
|
||||
{compactMode ? <></> : <Summary characters={characters} />}
|
||||
<Grid container spacing={1}>
|
||||
{Object.values(groupByAccount).map((g, id) => (
|
||||
<Grid
|
||||
item
|
||||
xs={12}
|
||||
sm={compactMode ? 6 : 12}
|
||||
key={`account-${id}-${g[0].account}`}
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "flex-start",
|
||||
padding: 1,
|
||||
gap: 1,
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
startIcon={
|
||||
allCollapsed ? <KeyboardArrowDownIcon /> : <KeyboardArrowUpIcon />
|
||||
}
|
||||
onClick={() => setAllCollapsed(!allCollapsed)}
|
||||
size="small"
|
||||
>
|
||||
{allCollapsed ? "Expand All" : "Collapse All"}
|
||||
</Button>
|
||||
<Tooltip title="Toggle compact layout for widescreen">
|
||||
<Button
|
||||
size="small"
|
||||
style={{
|
||||
backgroundColor: compactMode
|
||||
? "rgba(144, 202, 249, 0.08)"
|
||||
: "inherit",
|
||||
}}
|
||||
onClick={toggleCompactMode}
|
||||
>
|
||||
<AccountCard characters={g} />
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
Compact mode
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="Toggle alert mode to show only accounts and planets that need action.">
|
||||
<Button
|
||||
size="small"
|
||||
style={{
|
||||
backgroundColor: alertMode
|
||||
? "rgba(144, 202, 249, 0.08)"
|
||||
: "inherit",
|
||||
}}
|
||||
onClick={toggleAlertMode}
|
||||
>
|
||||
Alert mode
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="Toggle plan mode that show layout for widescreen">
|
||||
<Button
|
||||
size="small"
|
||||
style={{
|
||||
backgroundColor: planMode
|
||||
? "rgba(144, 202, 249, 0.08)"
|
||||
: "inherit",
|
||||
}}
|
||||
onClick={togglePlanMode}
|
||||
>
|
||||
Plan mode
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title="Toggle extraction time display mode">
|
||||
<Button
|
||||
size="small"
|
||||
style={{
|
||||
backgroundColor: extractionTimeMode
|
||||
? "rgba(144, 202, 249, 0.08)"
|
||||
: "inherit",
|
||||
}}
|
||||
onClick={toggleExtractionTimeMode}
|
||||
>
|
||||
Extraction datetime
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
<DragDropContextComponent onDragEnd={handleDragEnd}>
|
||||
<DroppableComponent droppableId="accounts">
|
||||
{(provided: any) => (
|
||||
<Grid
|
||||
container
|
||||
spacing={1}
|
||||
sx={{ padding: 1, width: "100%" }}
|
||||
{...provided.droppableProps}
|
||||
ref={provided.innerRef}
|
||||
>
|
||||
{accountOrder.map((account, index) => (
|
||||
<DraggableComponent
|
||||
key={account}
|
||||
draggableId={account}
|
||||
index={index}
|
||||
>
|
||||
{(provided: any) => (
|
||||
<Grid
|
||||
item
|
||||
xs={12}
|
||||
sm={compactMode ? 6 : 12}
|
||||
ref={provided.innerRef}
|
||||
{...provided.draggableProps}
|
||||
{...provided.dragHandleProps}
|
||||
sx={{
|
||||
"& > *": {
|
||||
width: "100%",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{groupByAccount[account] &&
|
||||
groupByAccount[account].length > 0 && (
|
||||
<AccountCard
|
||||
characters={groupByAccount[account]}
|
||||
isCollapsed={allCollapsed}
|
||||
/>
|
||||
)}
|
||||
</Grid>
|
||||
)}
|
||||
</DraggableComponent>
|
||||
))}
|
||||
{provided.placeholder}
|
||||
</Grid>
|
||||
)}
|
||||
</DroppableComponent>
|
||||
</DragDropContextComponent>
|
||||
</Box>
|
||||
</ThemeProvider>
|
||||
);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { SessionContext } from "@/app/context/Context";
|
||||
import { Button, Tooltip } from "@mui/material";
|
||||
import { useContext } from "react";
|
||||
|
||||
export const PlanModeButton = () => {
|
||||
const { planMode, togglePlanMode } = useContext(SessionContext);
|
||||
return (
|
||||
<Tooltip title="Toggle plan mode that show layout for widescreen">
|
||||
<Button onClick={togglePlanMode} style={{backgroundColor: planMode ? 'rgba(144, 202, 249, 0.08)' : 'inherit'}}>
|
||||
Plan mode
|
||||
|
||||
</Button>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
@@ -3,8 +3,6 @@ import { planetCalculations } from "@/planets";
|
||||
import { AccessToken, PlanetWithInfo } from "@/types";
|
||||
import {
|
||||
Card,
|
||||
Checkbox,
|
||||
FormControlLabel,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
@@ -20,12 +18,6 @@ import Image from "next/image";
|
||||
import { ColorContext, SessionContext } from "@/app/context/Context";
|
||||
import { useContext } from "react";
|
||||
|
||||
export type PlanetConfig = {
|
||||
characterId: number;
|
||||
planetId: number;
|
||||
excludeFromTotals: boolean;
|
||||
};
|
||||
|
||||
export const PlanetConfigDialog = ({
|
||||
planet,
|
||||
character,
|
||||
@@ -35,14 +27,9 @@ export const PlanetConfigDialog = ({
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
const { colors } = useContext(ColorContext);
|
||||
const { piPrices, readPlanetConfig, updatePlanetConfig } =
|
||||
useContext(SessionContext);
|
||||
const { piPrices } = useContext(SessionContext);
|
||||
const { extractors, localProduction, localImports, localExports } =
|
||||
planetCalculations(planet);
|
||||
const planetConfig = readPlanetConfig({
|
||||
characterId: character.character.characterId,
|
||||
planetId: planet.planet_id,
|
||||
});
|
||||
|
||||
return (
|
||||
<Card style={{ padding: "1rem", margin: "1rem" }}>
|
||||
@@ -189,23 +176,6 @@ export const PlanetConfigDialog = ({
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
<Card style={{ marginTop: "1rem" }}>
|
||||
<Typography>Planet configuration</Typography>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={planetConfig.excludeFromTotals}
|
||||
onChange={() =>
|
||||
updatePlanetConfig({
|
||||
...planetConfig,
|
||||
excludeFromTotals: !planetConfig.excludeFromTotals,
|
||||
})
|
||||
}
|
||||
/>
|
||||
}
|
||||
label="Consumed by production chain"
|
||||
/>
|
||||
</Card>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -65,6 +65,7 @@ export interface ProductionNode {
|
||||
quantity: number;
|
||||
}>;
|
||||
cycleTime: number;
|
||||
factoryCount: number;
|
||||
}
|
||||
|
||||
export interface ProductionChainBalance {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Box, Paper, Typography, Stack } from '@mui/material';
|
||||
import { Line } from 'react-chartjs-2';
|
||||
import { useTheme } from '@mui/material';
|
||||
import { getProgramOutputPrediction, ProductionNode } from './ExtractionSimulation';
|
||||
import { PI_TYPES_MAP } from '@/const';
|
||||
import { ProductionChainVisualization } from './ProductionChainVisualization';
|
||||
@@ -15,6 +14,8 @@ import {
|
||||
Tooltip,
|
||||
Legend
|
||||
} from 'chart.js';
|
||||
import { DateTime } from 'luxon';
|
||||
import Countdown from 'react-countdown';
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
@@ -43,6 +44,7 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
|
||||
extractors,
|
||||
productionNodes
|
||||
}) => {
|
||||
|
||||
const CYCLE_TIME = 30 * 60; // 30 minutes in seconds
|
||||
|
||||
// Calculate program duration and cycles for each extractor
|
||||
@@ -57,6 +59,7 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
const maxCycles = Math.max(...extractorPrograms.map(e => e.cycles));
|
||||
|
||||
// Get output predictions for each extractor
|
||||
@@ -156,14 +159,18 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
|
||||
const installedSchematicIds = Array.from(new Set(productionNodes.map(node => node.schematicId)));
|
||||
|
||||
// Create factories array with correct counts
|
||||
const factories = installedSchematicIds.map(schematicId => ({
|
||||
schematic_id: schematicId,
|
||||
count: productionNodes.filter(node => node.schematicId === schematicId).length
|
||||
}));
|
||||
const factories = installedSchematicIds.map(schematicId => {
|
||||
const node = productionNodes.find(n => n.schematicId === schematicId);
|
||||
if (!node) return { schematic_id: schematicId, count: 0 };
|
||||
return {
|
||||
schematic_id: schematicId,
|
||||
count: node.factoryCount
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<Paper sx={{ p: 2 }}>
|
||||
{extractors.length > 0 ? <Paper sx={{ p: 2 }}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
Extraction Simulation
|
||||
</Typography>
|
||||
@@ -191,20 +198,27 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
|
||||
<Typography variant="body2" component="div" sx={{ pl: 2 }}>
|
||||
• Expiry Time: {new Date(expiryTime).toLocaleString()}
|
||||
</Typography>
|
||||
<Typography variant="body2" component="div" sx={{ pl: 2 }}>
|
||||
• Factory Count: {factories.find(f => f.schematic_id === typeId)?.count ?? 0}
|
||||
</Typography>
|
||||
<Typography variant="body2" component="div" sx={{ pl: 2 }}>
|
||||
• Expires in: <Countdown overtime={true} date={DateTime.fromISO(expiryTime).toMillis()} />
|
||||
</Typography>
|
||||
</Stack>
|
||||
))}
|
||||
</Box>
|
||||
<div style={{ height: '300px' }}>
|
||||
<Line data={chartData} options={chartOptions} />
|
||||
</div>
|
||||
</Paper>
|
||||
</Paper> : null}
|
||||
|
||||
<ProductionChainVisualization
|
||||
extractedTypeIds={extractedTypeIds}
|
||||
extractors={extractors.map(e => ({
|
||||
typeId: e.typeId,
|
||||
baseValue: e.baseValue,
|
||||
cycleTime: CYCLE_TIME
|
||||
cycleTime: CYCLE_TIME,
|
||||
expiryTime: e.expiryTime
|
||||
}))}
|
||||
factories={factories}
|
||||
extractorTotals={extractorTotals}
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
import React from 'react';
|
||||
import { Box, Paper, Typography, Stack } from '@mui/material';
|
||||
import { Line } from 'react-chartjs-2';
|
||||
import { getProgramOutputPrediction } from './ExtractionSimulation';
|
||||
import { PI_TYPES_MAP } from '@/const';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
} from 'chart.js';
|
||||
import { DateTime } from 'luxon';
|
||||
import Countdown from 'react-countdown';
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
);
|
||||
|
||||
interface ExtractorConfig {
|
||||
typeId: number;
|
||||
baseValue: number;
|
||||
cycleTime: number;
|
||||
installTime: string;
|
||||
expiryTime: string;
|
||||
}
|
||||
|
||||
interface ExtractionSimulationTooltipProps {
|
||||
extractors: ExtractorConfig[];
|
||||
}
|
||||
|
||||
export const ExtractionSimulationTooltip: React.FC<ExtractionSimulationTooltipProps> = ({
|
||||
extractors
|
||||
}) => {
|
||||
const CYCLE_TIME = 30 * 60; // 30 minutes in seconds
|
||||
|
||||
// Calculate program duration and cycles for each extractor
|
||||
const extractorPrograms = extractors.map(extractor => {
|
||||
const installDate = new Date(extractor.installTime);
|
||||
const expiryDate = new Date(extractor.expiryTime);
|
||||
const programDuration = (expiryDate.getTime() - installDate.getTime()) / 1000; // Convert to seconds
|
||||
return {
|
||||
...extractor,
|
||||
programDuration,
|
||||
cycles: Math.floor(programDuration / CYCLE_TIME)
|
||||
};
|
||||
});
|
||||
|
||||
const maxCycles = Math.max(...extractorPrograms.map(e => e.cycles));
|
||||
|
||||
// Get output predictions for each extractor
|
||||
const extractorOutputs = extractorPrograms.map(extractor => ({
|
||||
typeId: extractor.typeId,
|
||||
cycleTime: CYCLE_TIME,
|
||||
cycles: extractor.cycles,
|
||||
prediction: getProgramOutputPrediction(
|
||||
extractor.baseValue,
|
||||
CYCLE_TIME,
|
||||
extractor.cycles
|
||||
)
|
||||
}));
|
||||
|
||||
// Create datasets for the chart
|
||||
const datasets = extractorOutputs.map((output, index) => {
|
||||
const hue = (360 / extractors.length) * index;
|
||||
return {
|
||||
label: `${PI_TYPES_MAP[output.typeId]?.name ?? `Resource ${output.typeId}`}`,
|
||||
data: output.prediction,
|
||||
borderColor: `hsl(${hue}, 70%, 50%)`,
|
||||
backgroundColor: `hsl(${hue}, 70%, 80%)`,
|
||||
tension: 0.4
|
||||
};
|
||||
});
|
||||
|
||||
const chartData = {
|
||||
labels: Array.from({ length: maxCycles }, (_, i) => {
|
||||
return (i % 4 === 0) ? `Cycle ${i + 1}` : '';
|
||||
}),
|
||||
datasets
|
||||
};
|
||||
|
||||
const chartOptions = {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: 'top' as const,
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Extraction Output Prediction'
|
||||
},
|
||||
tooltip: {
|
||||
callbacks: {
|
||||
title: (context: any) => `Cycle ${context[0].dataIndex + 1}`,
|
||||
label: (context: any) => `Output: ${context.raw.toFixed(1)} units`
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true,
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Units per Cycle'
|
||||
}
|
||||
},
|
||||
x: {
|
||||
ticks: {
|
||||
autoSkip: true,
|
||||
maxTicksLimit: 24
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Paper sx={{ p: 1, bgcolor: 'background.paper', minWidth: 800 }}>
|
||||
<Stack direction="row" spacing={2} sx={{ width: '100%' }}>
|
||||
<Box sx={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ height: '200px' }}>
|
||||
<Line data={chartData} options={chartOptions} />
|
||||
</div>
|
||||
</Box>
|
||||
<Box sx={{ flex: 1, minWidth: 0 }}>
|
||||
<Stack spacing={1}>
|
||||
{extractorPrograms.map(({ typeId, cycleTime, cycles, installTime, expiryTime }, idx) => {
|
||||
const prediction = getProgramOutputPrediction(
|
||||
extractors[idx].baseValue,
|
||||
CYCLE_TIME,
|
||||
cycles
|
||||
);
|
||||
const totalOutput = prediction.reduce((sum, val) => sum + val, 0);
|
||||
|
||||
return (
|
||||
<Paper key={typeId} sx={{ p: 1, bgcolor: 'background.default' }}>
|
||||
<Typography variant="subtitle2">
|
||||
{PI_TYPES_MAP[typeId]?.name}
|
||||
</Typography>
|
||||
<Stack spacing={0.5}>
|
||||
<Typography variant="body2">
|
||||
• Total Output: {totalOutput.toFixed(1)} units per program
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
• Cycle Time: {(cycleTime / 60).toFixed(1)} minutes
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
• Program Cycles: {cycles}
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
• Average per Cycle: {(totalOutput / cycles).toFixed(1)} units
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
• Average per hour: {(totalOutput / cycles * 2).toFixed(1)} units
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
• Expires in: <Countdown overtime={true} date={DateTime.fromISO(expiryTime).toMillis()} />
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Paper>
|
||||
);
|
||||
})}
|
||||
{extractors.length === 2 && (
|
||||
<Paper sx={{ p: 1, bgcolor: 'background.default' }}>
|
||||
<Typography variant="subtitle2" color="error">
|
||||
Balance
|
||||
</Typography>
|
||||
<Stack spacing={0.5}>
|
||||
{extractors.map((extractor, index) => {
|
||||
const averagePerHour = (extractor.baseValue * 3600) / extractor.cycleTime;
|
||||
return (
|
||||
<Typography key={index} variant="body2">
|
||||
• {PI_TYPES_MAP[extractor.typeId]?.name}: {averagePerHour.toFixed(1)} u/h
|
||||
</Typography>
|
||||
);
|
||||
})}
|
||||
<Typography
|
||||
variant="body2"
|
||||
color="error"
|
||||
sx={{
|
||||
mt: 1,
|
||||
fontWeight: 'bold',
|
||||
borderTop: '1px solid',
|
||||
borderColor: 'divider',
|
||||
pt: 1
|
||||
}}
|
||||
>
|
||||
Difference: {Math.abs(
|
||||
(extractors[0].baseValue * 3600 / extractors[0].cycleTime) -
|
||||
(extractors[1].baseValue * 3600 / extractors[1].cycleTime)
|
||||
).toFixed(1)} u/h
|
||||
</Typography>
|
||||
</Stack>
|
||||
</Paper>
|
||||
)}
|
||||
</Stack>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
@@ -1,31 +1,21 @@
|
||||
import { Stack, Typography, styled, useTheme } from "@mui/material";
|
||||
import { Stack, Typography, styled, useTheme, Tooltip } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import {
|
||||
AccessToken,
|
||||
Planet,
|
||||
PlanetInfo,
|
||||
PlanetInfoUniverse,
|
||||
PlanetWithInfo,
|
||||
} from "@/types";
|
||||
import React, { forwardRef, useContext, useEffect, useState } from "react";
|
||||
import React, { useContext } from "react";
|
||||
import { DateTime } from "luxon";
|
||||
import { EXTRACTOR_TYPE_IDS } from "@/const";
|
||||
import Countdown from "react-countdown";
|
||||
import PinsCanvas3D from "./PinsCanvas3D";
|
||||
import Slide from "@mui/material/Slide";
|
||||
import { TransitionProps } from "@mui/material/transitions";
|
||||
import Dialog from "@mui/material/Dialog";
|
||||
import AppBar from "@mui/material/AppBar";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import Button from "@mui/material/Button";
|
||||
import { getProgramOutputPrediction } from "./ExtractionSimulation";
|
||||
import {
|
||||
alertModeVisibility,
|
||||
extractorsHaveExpired,
|
||||
timeColor,
|
||||
} from "./timeColors";
|
||||
import { ColorContext, SessionContext } from "@/app/context/Context";
|
||||
import { ExtractionSimulationTooltip } from "./ExtractionSimulationTooltip";
|
||||
|
||||
const StackItem = styled(Stack)(({ theme }) => ({
|
||||
...theme.typography.body2,
|
||||
@@ -36,15 +26,6 @@ const StackItem = styled(Stack)(({ theme }) => ({
|
||||
alignItems: "center",
|
||||
}));
|
||||
|
||||
const Transition = forwardRef(function Transition(
|
||||
props: TransitionProps & {
|
||||
children: React.ReactElement;
|
||||
},
|
||||
ref: React.Ref<unknown>,
|
||||
) {
|
||||
return <Slide direction="up" ref={ref} {...props} />;
|
||||
});
|
||||
|
||||
export const PlanetCard = ({
|
||||
character,
|
||||
planet,
|
||||
@@ -57,18 +38,8 @@ export const PlanetCard = ({
|
||||
const planetInfo = planet.info;
|
||||
const planetInfoUniverse = planet.infoUniverse;
|
||||
|
||||
const [planetRenderOpen, setPlanetRenderOpen] = useState(false);
|
||||
|
||||
const theme = useTheme();
|
||||
|
||||
const handle3DrenderOpen = () => {
|
||||
setPlanetRenderOpen(true);
|
||||
};
|
||||
|
||||
const handle3DrenderClose = () => {
|
||||
setPlanetRenderOpen(false);
|
||||
};
|
||||
|
||||
const extractorsExpiryTime =
|
||||
(planetInfo &&
|
||||
planetInfo.pins
|
||||
@@ -79,7 +50,77 @@ export const PlanetCard = ({
|
||||
const { colors } = useContext(ColorContext);
|
||||
const expired = extractorsHaveExpired(extractorsExpiryTime);
|
||||
|
||||
const CYCLE_TIME = 30 * 60; // 30 minutes in seconds
|
||||
|
||||
const extractors = planetInfo?.pins
|
||||
.filter((p) => EXTRACTOR_TYPE_IDS.some((e) => e === p.type_id))
|
||||
.map((p) => ({
|
||||
typeId: p.type_id,
|
||||
baseValue: p.extractor_details?.qty_per_cycle || 0,
|
||||
cycleTime: p.extractor_details?.cycle_time || 3600,
|
||||
installTime: p.install_time || "",
|
||||
expiryTime: p.expiry_time || "",
|
||||
installedSchematicId: p.extractor_details?.product_type_id || undefined
|
||||
})) || [];
|
||||
|
||||
// Calculate program duration and cycles for each extractor
|
||||
const extractorPrograms = extractors.map(extractor => {
|
||||
const installDate = new Date(extractor.installTime);
|
||||
const expiryDate = new Date(extractor.expiryTime);
|
||||
const programDuration = (expiryDate.getTime() - installDate.getTime()) / 1000; // Convert to seconds
|
||||
return {
|
||||
...extractor,
|
||||
programDuration,
|
||||
cycles: Math.floor(programDuration / CYCLE_TIME)
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
// Get output predictions for each extractor
|
||||
const extractorOutputs = extractorPrograms.map(extractor => ({
|
||||
typeId: extractor.typeId,
|
||||
cycleTime: CYCLE_TIME,
|
||||
cycles: extractor.cycles,
|
||||
prediction: getProgramOutputPrediction(
|
||||
extractor.baseValue,
|
||||
CYCLE_TIME,
|
||||
extractor.cycles
|
||||
)
|
||||
}));
|
||||
|
||||
// Calculate average per hour for each extractor
|
||||
const extractorAverages = extractorOutputs.map(extractor => {
|
||||
const totalOutput = extractor.prediction.reduce((sum, val) => sum + val, 0);
|
||||
const programDuration = extractor.cycles * CYCLE_TIME;
|
||||
const averagePerHour = (totalOutput / programDuration) * 3600;
|
||||
return {
|
||||
typeId: extractor.typeId,
|
||||
averagePerHour
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
title={
|
||||
extractors.length > 0 ? (
|
||||
<ExtractionSimulationTooltip
|
||||
extractors={extractors}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
componentsProps={{
|
||||
tooltip: {
|
||||
sx: {
|
||||
bgcolor: 'background.paper',
|
||||
'& .MuiTooltip-arrow': {
|
||||
color: 'background.paper',
|
||||
},
|
||||
maxWidth: 'none',
|
||||
width: 'fit-content'
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<StackItem
|
||||
alignItems="flex-start"
|
||||
height="100%"
|
||||
@@ -87,15 +128,32 @@ export const PlanetCard = ({
|
||||
minHeight={theme.custom.cardMinHeight}
|
||||
visibility={alertModeVisibility(alertMode, expired)}
|
||||
>
|
||||
<Image
|
||||
unoptimized
|
||||
src={`/${planet.planet_type}.png`}
|
||||
alt=""
|
||||
width={theme.custom.cardImageSize}
|
||||
height={theme.custom.cardImageSize}
|
||||
style={{ borderRadius: 8, marginRight: 4 }}
|
||||
onClick={handle3DrenderOpen}
|
||||
/>
|
||||
|
||||
<div style={{ position: 'relative' }}>
|
||||
<Image
|
||||
unoptimized
|
||||
src={`/${planet.planet_type}.png`}
|
||||
alt=""
|
||||
width={theme.custom.cardImageSize}
|
||||
height={theme.custom.cardImageSize}
|
||||
style={{
|
||||
borderRadius: 8,
|
||||
marginRight: 4,
|
||||
position: 'relative',
|
||||
zIndex: 0
|
||||
}}
|
||||
/>
|
||||
<div style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: theme.custom.cardImageSize,
|
||||
height: theme.custom.cardImageSize,
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
||||
borderRadius: 8,
|
||||
}} />
|
||||
</div>
|
||||
|
||||
{expired && (
|
||||
<Image
|
||||
width={32}
|
||||
@@ -109,55 +167,41 @@ export const PlanetCard = ({
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
{planetInfoUniverse?.name}
|
||||
</Typography>
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
L{planet.upgrade_level}
|
||||
</Typography>
|
||||
{extractorsExpiryTime.map((e, idx) => {
|
||||
const extractor = extractors[idx];
|
||||
const average = extractorAverages[idx];
|
||||
return (
|
||||
<div key={`${e}-${idx}-${character.character.characterId}`}>
|
||||
<Typography
|
||||
color={timeColor(e, colors)}
|
||||
fontSize={theme.custom.smallText}
|
||||
>
|
||||
{!expired && e && <Countdown
|
||||
overtime={true}
|
||||
date={DateTime.fromISO(e).toMillis()}
|
||||
/>
|
||||
}
|
||||
</Typography>
|
||||
{!expired && extractor && average && (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
|
||||
<Image
|
||||
unoptimized
|
||||
src={`https://images.evetech.net/types/${extractor.installedSchematicId}/icon?size=32`}
|
||||
alt=""
|
||||
width={16}
|
||||
height={16}
|
||||
style={{ borderRadius: 4 }}
|
||||
/>
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
{average.averagePerHour.toFixed(1)}/h
|
||||
</Typography>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{extractorsExpiryTime.map((e, idx) => {
|
||||
return (
|
||||
<Typography
|
||||
key={`${e}-${idx}-${character.character.characterId}`}
|
||||
color={timeColor(e, colors)}
|
||||
fontSize={theme.custom.smallText}
|
||||
>
|
||||
{e ? (
|
||||
<Countdown
|
||||
overtime={true}
|
||||
date={DateTime.fromISO(e).toMillis()}
|
||||
/>
|
||||
) : (
|
||||
"STOPPED"
|
||||
)}
|
||||
</Typography>
|
||||
);
|
||||
})}
|
||||
<Dialog
|
||||
fullScreen
|
||||
open={planetRenderOpen}
|
||||
onClose={handle3DrenderClose}
|
||||
TransitionComponent={Transition}
|
||||
>
|
||||
<AppBar sx={{ position: "relative" }}>
|
||||
<Toolbar>
|
||||
<IconButton
|
||||
edge="start"
|
||||
color="inherit"
|
||||
onClick={handle3DrenderClose}
|
||||
aria-label="close"
|
||||
>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
<Typography sx={{ ml: 2, flex: 1 }} variant="h6" component="div">
|
||||
{planetInfoUniverse?.name}
|
||||
</Typography>
|
||||
<Button autoFocus color="inherit" onClick={handle3DrenderClose}>
|
||||
Close
|
||||
</Button>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<PinsCanvas3D planetInfo={planetInfo} />
|
||||
</Dialog>
|
||||
</StackItem>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ColorContext, SessionContext } from "@/app/context/Context";
|
||||
import { PI_TYPES_MAP, STORAGE_IDS, STORAGE_CAPACITIES, PI_PRODUCT_VOLUMES } from "@/const";
|
||||
import { PI_TYPES_MAP, STORAGE_IDS, STORAGE_CAPACITIES, PI_PRODUCT_VOLUMES, EVE_IMAGE_URL, PI_SCHEMATICS } from "@/const";
|
||||
import { planetCalculations } from "@/planets";
|
||||
import { AccessToken, PlanetWithInfo } from "@/types";
|
||||
import CloseIcon from "@mui/icons-material/Close";
|
||||
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
||||
import { Button, Tooltip, Typography, useTheme, Menu, MenuItem, IconButton } from "@mui/material";
|
||||
import { Button, Tooltip, Typography, useTheme, Menu, MenuItem, IconButton, Checkbox, FormControlLabel } from "@mui/material";
|
||||
import AppBar from "@mui/material/AppBar";
|
||||
import Dialog from "@mui/material/Dialog";
|
||||
import Slide from "@mui/material/Slide";
|
||||
@@ -20,10 +20,9 @@ import { PlanetConfigDialog } from "../PlanetConfig/PlanetConfigDialog";
|
||||
import PinsCanvas3D from "./PinsCanvas3D";
|
||||
import { alertModeVisibility, timeColor } from "./timeColors";
|
||||
import { ExtractionSimulationDisplay } from './ExtractionSimulationDisplay';
|
||||
import { ExtractionSimulationTooltip } from './ExtractionSimulationTooltip';
|
||||
import { ProductionNode } from './ExtractionSimulation';
|
||||
import { Collapse, Box, Stack } from "@mui/material";
|
||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
|
||||
|
||||
const Transition = forwardRef(function Transition(
|
||||
props: TransitionProps & {
|
||||
@@ -42,6 +41,7 @@ export const PlanetTableRow = ({
|
||||
character: AccessToken;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
const { showProductIcons, extractionTimeMode } = useContext(SessionContext);
|
||||
|
||||
const [planetRenderOpen, setPlanetRenderOpen] = useState(false);
|
||||
const [planetConfigOpen, setPlanetConfigOpen] = useState(false);
|
||||
@@ -72,14 +72,15 @@ export const PlanetTableRow = ({
|
||||
setPlanetConfigOpen(false);
|
||||
};
|
||||
|
||||
const { piPrices, alertMode } = useContext(SessionContext);
|
||||
const { piPrices, alertMode, updatePlanetConfig, readPlanetConfig, balanceThreshold } = useContext(SessionContext);
|
||||
const planetInfo = planet.info;
|
||||
const planetInfoUniverse = planet.infoUniverse;
|
||||
const { expired, extractors, localProduction, localImports, localExports } =
|
||||
planetCalculations(planet);
|
||||
const planetConfig = character.planetConfig.find(
|
||||
(p) => p.planetId === planet.planet_id,
|
||||
);
|
||||
const planetConfig = readPlanetConfig({
|
||||
characterId: character.character.characterId,
|
||||
planetId: planet.planet_id,
|
||||
});
|
||||
const { colors } = useContext(ColorContext);
|
||||
// Convert local production to ProductionNode array for simulation
|
||||
const productionNodes: ProductionNode[] = Array.from(localProduction).map(([schematicId, schematic]) => ({
|
||||
@@ -94,18 +95,25 @@ export const PlanetTableRow = ({
|
||||
typeId: output.type_id,
|
||||
quantity: output.quantity
|
||||
})),
|
||||
cycleTime: schematic.cycle_time
|
||||
cycleTime: schematic.cycle_time,
|
||||
factoryCount: schematic.count || 1
|
||||
}));
|
||||
|
||||
// Convert Map to Array for schematic IDs
|
||||
const installedSchematicIds = Array.from(localProduction.values()).map(p => p.schematic_id);
|
||||
|
||||
// Get extractor head types safely
|
||||
const extractedTypeIds = extractors
|
||||
.map(e => e.extractor_details?.product_type_id)
|
||||
.filter((id): id is number => id !== undefined);
|
||||
// Calculate extractor averages and check for large differences
|
||||
const extractorAverages = extractors
|
||||
.filter(e => e.extractor_details?.product_type_id && e.extractor_details?.qty_per_cycle)
|
||||
.map(e => {
|
||||
const cycleTime = e.extractor_details?.cycle_time || 3600;
|
||||
const qtyPerCycle = e.extractor_details?.qty_per_cycle || 0;
|
||||
return {
|
||||
typeId: e.extractor_details!.product_type_id!,
|
||||
averagePerHour: (qtyPerCycle * 3600) / cycleTime
|
||||
};
|
||||
});
|
||||
|
||||
const hasLargeExtractorDifference = extractorAverages.length === 2 &&
|
||||
Math.abs(extractorAverages[0].averagePerHour - extractorAverages[1].averagePerHour) > balanceThreshold;
|
||||
|
||||
// Get storage facilities
|
||||
const storageFacilities = planetInfo.pins.filter(pin =>
|
||||
STORAGE_IDS().some(storage => storage.type_id === pin.type_id)
|
||||
);
|
||||
@@ -116,30 +124,101 @@ export const PlanetTableRow = ({
|
||||
const storageType = PI_TYPES_MAP[pin.type_id].name;
|
||||
const storageCapacity = STORAGE_CAPACITIES[pin.type_id] || 0;
|
||||
|
||||
// Calculate total volume of stored products for this specific pin
|
||||
const totalVolume = (pin.contents || [])
|
||||
.reduce((sum: number, item: any) => {
|
||||
const volume = PI_PRODUCT_VOLUMES[item.type_id] || 0;
|
||||
return sum + (item.amount * volume);
|
||||
}, 0);
|
||||
|
||||
const totalValue = (pin.contents || [])
|
||||
.reduce((sum: number, item: any) => {
|
||||
const price = piPrices?.appraisal.items.find((a) => a.typeID === item.type_id)?.prices.sell.min ?? 0;
|
||||
return sum + (item.amount * price);
|
||||
}, 0);
|
||||
|
||||
const fillRate = storageCapacity > 0 ? (totalVolume / storageCapacity) * 100 : 0;
|
||||
|
||||
return {
|
||||
type: storageType,
|
||||
capacity: storageCapacity,
|
||||
used: totalVolume,
|
||||
fillRate: fillRate
|
||||
fillRate: fillRate,
|
||||
value: totalValue
|
||||
};
|
||||
};
|
||||
|
||||
const handleExcludeChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
updatePlanetConfig({
|
||||
...planetConfig,
|
||||
excludeFromTotals: event.target.checked,
|
||||
});
|
||||
};
|
||||
|
||||
const renderProductDisplay = (typeId: number, amount?: number) => {
|
||||
if (!typeId || !PI_TYPES_MAP[typeId]) {
|
||||
return (
|
||||
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }}>
|
||||
<Typography fontSize={theme.custom.smallText} color="text.secondary">
|
||||
No product
|
||||
</Typography>
|
||||
{amount !== undefined && (
|
||||
<Typography fontSize={theme.custom.smallText} style={{ marginLeft: "5px", flexShrink: 0 }}>
|
||||
{amount}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (showProductIcons) {
|
||||
return (
|
||||
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }}>
|
||||
<Image
|
||||
src={`${EVE_IMAGE_URL}/types/${typeId}/icon?size=32`}
|
||||
alt={PI_TYPES_MAP[typeId].name}
|
||||
width={32}
|
||||
height={32}
|
||||
style={{ marginRight: "5px" }}
|
||||
/>
|
||||
{amount !== undefined && (
|
||||
<Typography fontSize={theme.custom.smallText} style={{ marginLeft: "5px", flexShrink: 0 }}>
|
||||
{amount}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }}>
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
{PI_TYPES_MAP[typeId].name}
|
||||
</Typography>
|
||||
{amount !== undefined && (
|
||||
<Typography fontSize={theme.custom.smallText} style={{ marginLeft: "5px", flexShrink: 0 }}>
|
||||
{amount}
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<TableRow
|
||||
style={{ visibility: alertModeVisibility(alertMode, expired) }}
|
||||
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
|
||||
sx={{
|
||||
"&:last-child td, &:last-child th": { border: 0 },
|
||||
cursor: 'pointer',
|
||||
'&:hover': {
|
||||
backgroundColor: 'action.hover'
|
||||
}
|
||||
}}
|
||||
onClick={(e) => {
|
||||
if (!(e.target as HTMLElement).closest('.clickable-cell')) return;
|
||||
setSimulationOpen(!simulationOpen);
|
||||
}}
|
||||
>
|
||||
<TableCell component="th" scope="row">
|
||||
<TableCell component="th" scope="row" className="clickable-cell">
|
||||
<Tooltip
|
||||
title={`${
|
||||
planet.planet_type.charAt(0).toUpperCase() +
|
||||
@@ -154,18 +233,66 @@ export const PlanetTableRow = ({
|
||||
height={theme.custom.cardImageSize / 6}
|
||||
style={{ marginRight: "5px" }}
|
||||
/>
|
||||
{planetInfoUniverse?.name}
|
||||
<Tooltip
|
||||
placement="right"
|
||||
title={
|
||||
extractors.length > 0 ? (
|
||||
<ExtractionSimulationTooltip
|
||||
extractors={extractors
|
||||
.filter(e => e.extractor_details?.product_type_id && e.extractor_details?.qty_per_cycle)
|
||||
.map(e => ({
|
||||
typeId: e.extractor_details!.product_type_id!,
|
||||
baseValue: e.extractor_details!.qty_per_cycle!,
|
||||
cycleTime: e.extractor_details!.cycle_time || 3600,
|
||||
installTime: e.install_time ?? "",
|
||||
expiryTime: e.expiry_time ?? ""
|
||||
}))}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
componentsProps={{
|
||||
tooltip: {
|
||||
sx: {
|
||||
bgcolor: 'background.paper',
|
||||
'& .MuiTooltip-arrow': {
|
||||
color: 'background.paper',
|
||||
},
|
||||
maxWidth: 'none',
|
||||
width: 'fit-content'
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Stack spacing={0}>
|
||||
<Typography
|
||||
fontSize={theme.custom.smallText}
|
||||
color={hasLargeExtractorDifference ? 'error' : 'inherit'}
|
||||
>
|
||||
{planetInfoUniverse?.name}
|
||||
</Typography>
|
||||
{hasLargeExtractorDifference && (
|
||||
<Typography
|
||||
fontSize={theme.custom.smallText}
|
||||
color="error"
|
||||
sx={{ opacity: 0.7 }}
|
||||
>
|
||||
off-balance
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell>{planet.upgrade_level}</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">{planet.upgrade_level}</TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{extractors.length === 0 &&<Typography fontSize={theme.custom.smallText}>No extractors</Typography>}
|
||||
{extractors.map((e, idx) => {
|
||||
return (
|
||||
<div
|
||||
key={`${e}-${idx}-${character.character.characterId}`}
|
||||
style={{ display: "flex" }}
|
||||
style={{ display: "flex", alignItems: "center" }}
|
||||
>
|
||||
<Typography
|
||||
color={timeColor(e.expiry_time, colors)}
|
||||
@@ -173,76 +300,117 @@ export const PlanetTableRow = ({
|
||||
paddingRight={1}
|
||||
>
|
||||
{e ? (
|
||||
<Countdown
|
||||
overtime={true}
|
||||
date={DateTime.fromISO(e.expiry_time ?? "").toMillis()}
|
||||
/>
|
||||
extractionTimeMode ? (
|
||||
DateTime.fromISO(e.expiry_time ?? "").toFormat('yyyy-MM-dd HH:mm:ss')
|
||||
) : (
|
||||
<Countdown
|
||||
overtime={true}
|
||||
date={DateTime.fromISO(e.expiry_time ?? "").toMillis()}
|
||||
/>
|
||||
)
|
||||
) : (
|
||||
"STOPPED"
|
||||
)}
|
||||
</Typography>
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
{
|
||||
PI_TYPES_MAP[e.extractor_details?.product_type_id ?? 0]
|
||||
?.name
|
||||
}
|
||||
</Typography>
|
||||
{renderProductDisplay(e.extractor_details?.product_type_id ?? 0)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{Array.from(localProduction).map((schematic, idx) => {
|
||||
return (
|
||||
<Typography
|
||||
<div
|
||||
key={`prod-${character.character.characterId}-${planet.planet_id}-${idx}`}
|
||||
fontSize={theme.custom.smallText}
|
||||
style={{ display: "flex", alignItems: "center" }}
|
||||
>
|
||||
{schematic[1].name}
|
||||
</Typography>
|
||||
{renderProductDisplay(schematic[1].outputs[0].type_id)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{localImports.map((i) => (
|
||||
<Typography
|
||||
key={`import-${character.character.characterId}-${planet.planet_id}-${i.type_id}`}
|
||||
fontSize={theme.custom.smallText}
|
||||
>
|
||||
{PI_TYPES_MAP[i.type_id].name} ({i.quantity}/h)
|
||||
</Typography>
|
||||
))}
|
||||
{localImports.map((i) => {
|
||||
// Find all storage facilities (including launchpads) containing this import
|
||||
const storagesWithImport = storageFacilities.filter(storage =>
|
||||
storage.contents?.some(content => content.type_id === i.type_id)
|
||||
);
|
||||
|
||||
// Get the total amount in all storage facilities
|
||||
const totalAmount = storagesWithImport.reduce((sum, storage) => {
|
||||
const content = storage.contents?.find(content => content.type_id === i.type_id);
|
||||
return sum + (content?.amount ?? 0);
|
||||
}, 0);
|
||||
|
||||
// Calculate consumption rate per hour
|
||||
const schematic = PI_SCHEMATICS.find(s => s.schematic_id === i.schematic_id);
|
||||
const cycleTime = schematic?.cycle_time ?? 3600;
|
||||
const consumptionPerHour = i.quantity * i.factoryCount * (3600 / cycleTime);
|
||||
|
||||
// Calculate time until depletion in hours
|
||||
const hoursUntilDepletion = consumptionPerHour > 0 ? totalAmount / consumptionPerHour : 0;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={`import-${character.character.characterId}-${planet.planet_id}-${i.type_id}`}
|
||||
style={{ display: "flex", alignItems: "center" }}
|
||||
>
|
||||
{renderProductDisplay(i.type_id, i.quantity * i.factoryCount)}
|
||||
{totalAmount > 0 && (
|
||||
<Tooltip title={
|
||||
<>
|
||||
<div>Total: {totalAmount.toFixed(1)} units</div>
|
||||
<div>Will be depleted in {hoursUntilDepletion.toFixed(1)} hours</div>
|
||||
</>
|
||||
}>
|
||||
<Typography
|
||||
fontSize={theme.custom.smallText}
|
||||
color={hoursUntilDepletion < 24 ? 'error' : hoursUntilDepletion < 48 ? 'warning' : 'success'}
|
||||
sx={{ ml: 1 }}
|
||||
>
|
||||
({hoursUntilDepletion.toFixed(1)}h)
|
||||
</Typography>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{localExports.map((exports) => (
|
||||
<Typography
|
||||
<div
|
||||
key={`export-${character.character.characterId}-${planet.planet_id}-${exports.typeId}`}
|
||||
fontSize={theme.custom.smallText}
|
||||
style={{ display: "flex", alignItems: "center" }}
|
||||
>
|
||||
{PI_TYPES_MAP[exports.typeId].name}
|
||||
</Typography>
|
||||
{renderProductDisplay(exports.typeId, exports.amount)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{localExports.map((exports) => (
|
||||
<Typography
|
||||
<FormControlLabel
|
||||
key={`export-excluded-${character.character.characterId}-${planet.planet_id}-${exports.typeId}`}
|
||||
fontSize={theme.custom.smallText}
|
||||
>
|
||||
{planetConfig?.excludeFromTotals ? "ex" : ""}
|
||||
</Typography>
|
||||
control={
|
||||
<Checkbox
|
||||
checked={planetConfig.excludeFromTotals}
|
||||
onChange={handleExcludeChange}
|
||||
size="small"
|
||||
/>
|
||||
}
|
||||
label=""
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{localExports.map((exports) => (
|
||||
<Typography
|
||||
@@ -254,7 +422,7 @@ export const PlanetTableRow = ({
|
||||
))}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
@@ -287,8 +455,9 @@ export const PlanetTableRow = ({
|
||||
})}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="clickable-cell">
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
{storageFacilities.length === 0 &&<Typography fontSize={theme.custom.smallText}>No storage</Typography>}
|
||||
{storageFacilities
|
||||
.sort((a, b) => {
|
||||
const isALaunchpad = a.type_id === 2256 || a.type_id === 2542 || a.type_id === 2543 || a.type_id === 2544 || a.type_id === 2552 || a.type_id === 2555 || a.type_id === 2556 || a.type_id === 2557;
|
||||
@@ -319,12 +488,17 @@ export const PlanetTableRow = ({
|
||||
<Typography fontSize={theme.custom.smallText} style={{ color }}>
|
||||
{fillRate.toFixed(1)}%
|
||||
</Typography>
|
||||
{storageInfo.value > 0 && (
|
||||
<Typography fontSize={theme.custom.smallText} style={{ marginLeft: "5px" }}>
|
||||
({Math.round(storageInfo.value / 1000000)}M)
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<TableCell className="menu-cell">
|
||||
<IconButton
|
||||
aria-label="more"
|
||||
aria-controls="planet-menu"
|
||||
@@ -346,14 +520,6 @@ export const PlanetTableRow = ({
|
||||
}}>
|
||||
Configure Planet
|
||||
</MenuItem>
|
||||
{extractors.length > 0 && (
|
||||
<MenuItem onClick={() => {
|
||||
setSimulationOpen(!simulationOpen);
|
||||
handleMenuClose();
|
||||
}}>
|
||||
{simulationOpen ? 'Hide Extraction Simulation' : 'Show Extraction Simulation'}
|
||||
</MenuItem>
|
||||
)}
|
||||
<MenuItem onClick={() => {
|
||||
handle3DrenderOpen();
|
||||
handleMenuClose();
|
||||
@@ -364,7 +530,7 @@ export const PlanetTableRow = ({
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell colSpan={6} style={{ paddingBottom: 0, paddingTop: 0 }}>
|
||||
<TableCell colSpan={6} style={{ paddingBottom: 0, paddingTop: 0, border: 'none' }}>
|
||||
<Collapse in={simulationOpen} timeout="auto" unmountOnExit>
|
||||
<Box sx={{ my: 2 }}>
|
||||
<ExtractionSimulationDisplay
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AccessToken } from "@/types";
|
||||
import { Stack, Tooltip, Typography, styled, useTheme } from "@mui/material";
|
||||
import { Icon, IconButton, Stack, Tooltip, Typography, styled, useTheme } from "@mui/material";
|
||||
import { PlanetCard } from "./PlanetCard";
|
||||
import { NoPlanetCard } from "./NoPlanetCard";
|
||||
import Table from "@mui/material/Table";
|
||||
@@ -10,7 +10,7 @@ import TableHead from "@mui/material/TableHead";
|
||||
import TableRow from "@mui/material/TableRow";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import { PlanetTableRow } from "./PlanetTableRow";
|
||||
import Image from "next/image";
|
||||
import { Settings } from "@mui/icons-material";
|
||||
|
||||
const StackItem = styled(Stack)(({ theme }) => ({
|
||||
...theme.typography.body2,
|
||||
@@ -36,8 +36,8 @@ const PlanetaryIteractionTable = ({
|
||||
|
||||
return (
|
||||
<StackItem width="100%">
|
||||
<TableContainer component={Paper}>
|
||||
<Table size="small" aria-label="a dense table">
|
||||
<TableContainer component={Paper} sx={{ width: '100%' }}>
|
||||
<Table size="small" aria-label="a dense table" sx={{ width: '100%' }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell width="8%">
|
||||
@@ -84,8 +84,8 @@ const PlanetaryIteractionTable = ({
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="2%">
|
||||
<Tooltip title="How many units per hour factories are producing">
|
||||
<Typography fontSize={theme.custom.smallText}>u/h</Typography>
|
||||
<Tooltip title="How many units per hour factories are producing on this planet">
|
||||
<Typography fontSize={theme.custom.smallText}>uph</Typography>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="4%" align="right">
|
||||
@@ -98,10 +98,17 @@ const PlanetaryIteractionTable = ({
|
||||
<TableCell width="10%">
|
||||
<Tooltip title="Storage facility fill rate">
|
||||
<Typography fontSize={theme.custom.smallText}>
|
||||
Storage Fill rate
|
||||
Storage%
|
||||
</Typography>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Tooltip title="Planet settings">
|
||||
<IconButton aria-label="settings">
|
||||
<Settings fontSize="small" />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
@@ -152,8 +159,8 @@ export const PlanetaryInteractionRow = ({
|
||||
const theme = useTheme();
|
||||
|
||||
return theme.custom.compactMode ? (
|
||||
<PlanetaryInteractionIconsRow character={character} />
|
||||
<div style={{ marginTop: "1.2rem" }}><PlanetaryInteractionIconsRow character={character} /></div>
|
||||
) : (
|
||||
<PlanetaryIteractionTable character={character} />
|
||||
<div style={{ marginTop: "1.4rem" }}><PlanetaryIteractionTable character={character} /></div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import React from 'react';
|
||||
import { Box, Paper, Typography, Grid, Stack, Divider } from '@mui/material';
|
||||
import { Box, Paper, Typography, Grid, Stack } from '@mui/material';
|
||||
import { EVE_IMAGE_URL } from '@/const';
|
||||
import { PI_TYPES_MAP } from '@/const';
|
||||
import { DateTime } from 'luxon';
|
||||
import Countdown from 'react-countdown';
|
||||
import Image from 'next/image';
|
||||
|
||||
interface Factory {
|
||||
schematic_id: number;
|
||||
@@ -29,6 +32,7 @@ interface ProductionChainVisualizationProps {
|
||||
typeId: number;
|
||||
baseValue: number;
|
||||
cycleTime: number;
|
||||
expiryTime: string;
|
||||
}>;
|
||||
factories: Factory[];
|
||||
extractorTotals: Map<number, number>;
|
||||
@@ -39,8 +43,10 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
|
||||
extractedTypeIds,
|
||||
factories,
|
||||
extractorTotals,
|
||||
productionNodes
|
||||
productionNodes,
|
||||
extractors
|
||||
}) => {
|
||||
|
||||
// Get all type IDs involved in the production chain
|
||||
const allTypeIds = new Set<number>();
|
||||
const requiredInputs = new Set<number>();
|
||||
@@ -214,9 +220,15 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
|
||||
|
||||
// Get factory count for a type
|
||||
const getFactoryCount = (typeId: number): number => {
|
||||
const node = nodesByOutput.get(typeId);
|
||||
if (!node) return 0;
|
||||
return factories.find(f => f.schematic_id === node.schematicId)?.count ?? 0;
|
||||
// First find the node that produces this type
|
||||
const producingNode = productionNodes.find(node =>
|
||||
node.outputs.some(output => output.typeId === typeId)
|
||||
);
|
||||
|
||||
if (!producingNode) return 0;
|
||||
|
||||
// Then find the factory count for this schematic
|
||||
return factories.find(f => f.schematic_id === producingNode.schematicId)?.count ?? 0;
|
||||
};
|
||||
|
||||
// Get input requirements for a type
|
||||
@@ -232,6 +244,11 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
|
||||
return node?.cycleTime;
|
||||
};
|
||||
|
||||
// Get extractor expiry time for a type
|
||||
const getExtractorExpiryTime = (typeId: number): string | undefined => {
|
||||
return extractors.find(e => e.typeId === typeId)?.expiryTime;
|
||||
};
|
||||
|
||||
return (
|
||||
<Paper sx={{ p: 2, my: 2 }}>
|
||||
<Typography variant="h6" gutterBottom>
|
||||
@@ -258,6 +275,7 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
|
||||
const consumption = consumptionTotals.get(typeId) ?? 0;
|
||||
const inputs = getInputRequirements(typeId);
|
||||
const cycleTime = getSchematicCycleTime(typeId);
|
||||
const expiryTime = getExtractorExpiryTime(typeId);
|
||||
|
||||
return (
|
||||
<Grid item key={typeId} xs={12} sm={6} md={4}>
|
||||
@@ -274,7 +292,7 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
|
||||
}}
|
||||
>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
|
||||
<img
|
||||
<Image
|
||||
src={`${EVE_IMAGE_URL}/types/${typeId}/icon`}
|
||||
alt={type?.name ?? `Type ${typeId}`}
|
||||
width={48}
|
||||
@@ -292,19 +310,49 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
|
||||
</Box>
|
||||
</Box>
|
||||
<Stack spacing={0.5}>
|
||||
{production > 0 && (
|
||||
<>
|
||||
<Typography variant="caption" color="success.main">
|
||||
Production: {production.toFixed(1)} units total
|
||||
{factoryCount > 0 && (
|
||||
<Typography variant="caption" color="info.main">
|
||||
Factories: {factoryCount}
|
||||
</Typography>
|
||||
)}
|
||||
{inputs.length > 0 && (
|
||||
<Box>
|
||||
<Typography variant="caption" color="text.secondary">
|
||||
Inputs:
|
||||
</Typography>
|
||||
</>
|
||||
{inputs.map(input => (
|
||||
<Typography
|
||||
key={input.typeId}
|
||||
variant="caption"
|
||||
sx={{ display: 'block', ml: 1 }}
|
||||
>
|
||||
{PI_TYPES_MAP[input.typeId]?.name}: {input.quantity * factoryCount}/cycle
|
||||
</Typography>
|
||||
))}
|
||||
</Box>
|
||||
)}
|
||||
{expiryTime && (
|
||||
<Box>
|
||||
<Typography variant="caption" color="text.secondary">
|
||||
Extractor expires in:
|
||||
</Typography>
|
||||
<Typography variant="caption" sx={{ ml: 1 }}>
|
||||
<Countdown
|
||||
overtime={true}
|
||||
date={DateTime.fromISO(expiryTime).toMillis()}
|
||||
/>
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
{production > 0 && (
|
||||
<Typography variant="caption" color="success.main">
|
||||
Production: {production.toFixed(1)} units total
|
||||
</Typography>
|
||||
)}
|
||||
{consumption > 0 && (
|
||||
<>
|
||||
<Typography variant="caption" color="error.main">
|
||||
Consumption: {consumption.toFixed(1)} units total
|
||||
</Typography>
|
||||
</>
|
||||
<Typography variant="caption" color="error.main">
|
||||
Consumption: {consumption.toFixed(1)} units total
|
||||
</Typography>
|
||||
)}
|
||||
{isImported && (
|
||||
<>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {
|
||||
ColorContext,
|
||||
ColorSelectionType,
|
||||
SessionContext,
|
||||
} from "@/app/context/Context";
|
||||
import {
|
||||
Button,
|
||||
@@ -10,14 +11,18 @@ import {
|
||||
DialogTitle,
|
||||
Tooltip,
|
||||
Typography,
|
||||
TextField,
|
||||
Box,
|
||||
FormControlLabel,
|
||||
Checkbox,
|
||||
} from "@mui/material";
|
||||
import { ColorChangeHandler, ColorResult, CompactPicker } from "react-color";
|
||||
import React from "react";
|
||||
import { useContext } from "react";
|
||||
import React, { useState, useContext } from "react";
|
||||
|
||||
export const SettingsButton = () => {
|
||||
const { colors, setColors } = useContext(ColorContext);
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const { balanceThreshold, setBalanceThreshold, showProductIcons, setShowProductIcons } = useContext(SessionContext);
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
const handleClickOpen = () => {
|
||||
setOpen(true);
|
||||
@@ -26,6 +31,7 @@ export const SettingsButton = () => {
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
const handleColorSelection = (key: string, currentColors: ColorSelectionType) => (selection: ColorResult) => {
|
||||
console.log(key, selection.hex)
|
||||
setColors({
|
||||
@@ -34,10 +40,23 @@ export const SettingsButton = () => {
|
||||
})
|
||||
};
|
||||
|
||||
const handleBalanceThresholdChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const value = parseInt(event.target.value);
|
||||
if (!isNaN(value) && value >= 0 && value <= 100000) {
|
||||
setBalanceThreshold(value);
|
||||
}
|
||||
};
|
||||
|
||||
const handleShowProductIconsChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setShowProductIcons(event.target.checked);
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip title="Toggle settings dialog">
|
||||
<>
|
||||
<Button onClick={handleClickOpen}>Settings</Button>
|
||||
<Button onClick={handleClickOpen} color="inherit">
|
||||
Settings
|
||||
</Button>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
@@ -45,9 +64,35 @@ export const SettingsButton = () => {
|
||||
aria-describedby="alert-dialog-description"
|
||||
>
|
||||
<DialogTitle id="alert-dialog-title">
|
||||
{"Override default timer colors"}
|
||||
{"Settings"}
|
||||
</DialogTitle>
|
||||
|
||||
<DialogContent style={{ paddingTop: "1rem" }}>
|
||||
<Box sx={{ mt: 2 }}>
|
||||
<Typography variant="subtitle1">Display Settings</Typography>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={showProductIcons}
|
||||
onChange={handleShowProductIconsChange}
|
||||
/>
|
||||
}
|
||||
label="Show product icons instead of names"
|
||||
/>
|
||||
</Box>
|
||||
<Box sx={{ mt: 2 }}>
|
||||
<Typography variant="subtitle1">Balance Threshold</Typography>
|
||||
<TextField
|
||||
type="number"
|
||||
value={balanceThreshold}
|
||||
onChange={handleBalanceThresholdChange}
|
||||
fullWidth
|
||||
margin="normal"
|
||||
inputProps={{ min: 0, max: 100000 }}
|
||||
helperText="Set the threshold for balance alerts (0-100,000)"
|
||||
error={balanceThreshold < 0 || balanceThreshold > 100000}
|
||||
/>
|
||||
</Box>
|
||||
{Object.keys(colors).map((key) => {
|
||||
return (
|
||||
<div key={`color-row-${key}`}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SessionContext } from "@/app/context/Context";
|
||||
import { PI_TYPES_MAP } from "@/const";
|
||||
import { PI_TYPES_MAP, STORAGE_IDS } from "@/const";
|
||||
import { planetCalculations } from "@/planets";
|
||||
import { AccessToken } from "@/types";
|
||||
import {
|
||||
@@ -19,10 +19,12 @@ import {
|
||||
AccordionSummary,
|
||||
AccordionDetails,
|
||||
TableSortLabel,
|
||||
Box,
|
||||
TextField,
|
||||
} from "@mui/material";
|
||||
import { useContext, useState } from "react";
|
||||
import { useContext, useState, useEffect } from "react";
|
||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||
import { argv0 } from "process";
|
||||
import { DateTime } from "luxon";
|
||||
|
||||
const StackItem = styled(Stack)(({ theme }) => ({
|
||||
...theme.typography.body2,
|
||||
@@ -41,13 +43,39 @@ const displayValue = (valueInMillions: number): string =>
|
||||
? `${(valueInMillions / 1000).toFixed(2)} B`
|
||||
: `${valueInMillions.toFixed(2)} M`;
|
||||
|
||||
type SortBy = "name" | "perHour" | "price";
|
||||
type SortBy = "name" | "perHour" | "storage" | "price" | "storagePrice" | "progress";
|
||||
type SortDirection = "asc" | "desc";
|
||||
|
||||
export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
const { piPrices } = useContext(SessionContext);
|
||||
const [sortDirection, setSortDirection] = useState<SortDirection>("asc");
|
||||
const [sortBy, setSortBy] = useState<SortBy>("name");
|
||||
const [startDate, setStartDate] = useState<string>(DateTime.now().startOf('day').toISO());
|
||||
const [activityPercentage, setActivityPercentage] = useState<number>(100);
|
||||
|
||||
// Load saved values from localStorage on mount
|
||||
useEffect(() => {
|
||||
const savedDate = localStorage.getItem('productionStartDate');
|
||||
if (savedDate) {
|
||||
setStartDate(savedDate);
|
||||
}
|
||||
|
||||
const savedActivity = localStorage.getItem('activityPercentage');
|
||||
if (savedActivity) {
|
||||
setActivityPercentage(parseFloat(savedActivity));
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Save values to localStorage when they change
|
||||
useEffect(() => {
|
||||
localStorage.setItem('productionStartDate', startDate);
|
||||
}, [startDate]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('activityPercentage', activityPercentage.toString());
|
||||
}, [activityPercentage]);
|
||||
|
||||
// Calculate exports and storage amounts
|
||||
const exports = characters.flatMap((char) => {
|
||||
return char.planets
|
||||
.filter(
|
||||
@@ -62,6 +90,28 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
});
|
||||
});
|
||||
|
||||
// Calculate storage amounts
|
||||
const storageAmounts = characters.reduce<Grouped>((totals, character) => {
|
||||
character.planets
|
||||
.filter(
|
||||
(p) =>
|
||||
!character.planetConfig.some(
|
||||
(c) => c.planetId == p.planet_id && c.excludeFromTotals,
|
||||
),
|
||||
)
|
||||
.forEach((planet) => {
|
||||
planet.info.pins
|
||||
.filter(pin => STORAGE_IDS().some(storage => storage.type_id === pin.type_id))
|
||||
.forEach(storage => {
|
||||
storage.contents?.forEach(content => {
|
||||
const current = totals[content.type_id] || 0;
|
||||
totals[content.type_id] = current + content.amount;
|
||||
});
|
||||
});
|
||||
});
|
||||
return totals;
|
||||
}, {});
|
||||
|
||||
const groupedByMaterial = exports.reduce<Grouped>((totals, material) => {
|
||||
const { typeId, amount } = material;
|
||||
const newTotal = isNaN(totals[typeId]) ? amount : totals[typeId] + amount;
|
||||
@@ -69,27 +119,44 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
return totals;
|
||||
}, {});
|
||||
|
||||
const startDateTime = DateTime.fromISO(startDate);
|
||||
const hoursSinceStart = DateTime.now().diff(startDateTime, 'hours').hours;
|
||||
|
||||
const withProductNameAndPrice = Object.keys(groupedByMaterial).map(
|
||||
(typeIdString) => {
|
||||
const typeId = parseInt(typeIdString);
|
||||
const amount = groupedByMaterial[typeId];
|
||||
const storageAmount = storageAmounts[typeId] || 0;
|
||||
const adjustedAmount = amount * (activityPercentage / 100);
|
||||
const valueInMillions =
|
||||
(((piPrices?.appraisal.items.find((a) => a.typeID === typeId)?.prices
|
||||
.sell.min ?? 0) *
|
||||
amount) /
|
||||
adjustedAmount) /
|
||||
1000000) *
|
||||
24 *
|
||||
30;
|
||||
const storageValueInMillions =
|
||||
((piPrices?.appraisal.items.find((a) => a.typeID === typeId)?.prices
|
||||
.sell.min ?? 0) *
|
||||
storageAmount) /
|
||||
1000000;
|
||||
|
||||
// Calculate expected production and progress
|
||||
const expectedProduction = adjustedAmount * hoursSinceStart;
|
||||
const progress = hoursSinceStart > 0 ? (storageAmount / expectedProduction) * 100 : 0;
|
||||
|
||||
return {
|
||||
typeId,
|
||||
amount,
|
||||
amount: adjustedAmount,
|
||||
storageAmount,
|
||||
materialName: PI_TYPES_MAP[typeId].name,
|
||||
price: valueInMillions,
|
||||
storageValue: storageValueInMillions,
|
||||
progress,
|
||||
};
|
||||
},
|
||||
);
|
||||
const theme = useTheme();
|
||||
|
||||
|
||||
return (
|
||||
<StackItem width="100%">
|
||||
@@ -98,14 +165,48 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
<h2>Totals</h2>
|
||||
</AccordionSummary>
|
||||
<AccordionDetails>
|
||||
<TableContainer component={Paper}>
|
||||
<Table size="small" aria-label="a dense table">
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 2 }}>
|
||||
<TextField
|
||||
label="Production Start Date"
|
||||
type="date"
|
||||
value={DateTime.fromISO(startDate).toFormat('yyyy-MM-dd')}
|
||||
onChange={(e) => {
|
||||
const newDate = DateTime.fromFormat(e.target.value, 'yyyy-MM-dd').startOf('day').toISO();
|
||||
if (newDate) setStartDate(newDate);
|
||||
}}
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
size="small"
|
||||
/>
|
||||
<TextField
|
||||
label="Activity %"
|
||||
type="number"
|
||||
value={activityPercentage}
|
||||
onChange={(e) => {
|
||||
const value = Math.min(100, Math.max(0, parseFloat(e.target.value) || 0));
|
||||
setActivityPercentage(value);
|
||||
}}
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
inputProps={{
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 1,
|
||||
}}
|
||||
size="small"
|
||||
sx={{ width: '100px' }}
|
||||
/>
|
||||
</Box>
|
||||
<TableContainer component={Paper} sx={{ width: '100%' }}>
|
||||
<Table size="small" aria-label="a dense table" sx={{ width: '100%' }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell width="40%">
|
||||
<TableCell width="20%">
|
||||
<Tooltip title="What exports factories are producing">
|
||||
<TableSortLabel
|
||||
active={true}
|
||||
active={sortBy === "name"}
|
||||
direction={sortDirection}
|
||||
onClick={() => {
|
||||
setSortDirection(
|
||||
@@ -118,10 +219,10 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
</TableSortLabel>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="10%">
|
||||
<Tooltip title="How many units per hour factories are producing">
|
||||
<TableCell width="10%" align="right">
|
||||
<Tooltip title={`Adjusted production rate (${activityPercentage}% activity)`}>
|
||||
<TableSortLabel
|
||||
active={true}
|
||||
active={sortBy === "perHour"}
|
||||
direction={sortDirection}
|
||||
onClick={() => {
|
||||
setSortDirection(
|
||||
@@ -135,9 +236,41 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="10%" align="right">
|
||||
<Tooltip title="How many million ISK per month this planet is exporting (Jita sell min)">
|
||||
<Tooltip title="Amount currently in storage">
|
||||
<TableSortLabel
|
||||
active={true}
|
||||
active={sortBy === "storage"}
|
||||
direction={sortDirection}
|
||||
onClick={() => {
|
||||
setSortDirection(
|
||||
sortDirection === "asc" ? "desc" : "asc",
|
||||
);
|
||||
setSortBy("storage");
|
||||
}}
|
||||
>
|
||||
Units in storage
|
||||
</TableSortLabel>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="15%" align="right">
|
||||
<Tooltip title="Current ISK value of storage">
|
||||
<TableSortLabel
|
||||
active={sortBy === "storagePrice"}
|
||||
direction={sortDirection}
|
||||
onClick={() => {
|
||||
setSortDirection(
|
||||
sortDirection === "asc" ? "desc" : "asc",
|
||||
);
|
||||
setSortBy("storagePrice");
|
||||
}}
|
||||
>
|
||||
Produced ISK value
|
||||
</TableSortLabel>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="15%" align="right">
|
||||
<Tooltip title="Monthly ISK value from production">
|
||||
<TableSortLabel
|
||||
active={sortBy === "price"}
|
||||
direction={sortDirection}
|
||||
onClick={() => {
|
||||
setSortDirection(
|
||||
@@ -146,7 +279,23 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
setSortBy("price");
|
||||
}}
|
||||
>
|
||||
ISK/M
|
||||
Maximum possible ISK/M
|
||||
</TableSortLabel>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
<TableCell width="15%" align="right">
|
||||
<Tooltip title="Progress towards monthly production target">
|
||||
<TableSortLabel
|
||||
active={sortBy === "progress"}
|
||||
direction={sortDirection}
|
||||
onClick={() => {
|
||||
setSortDirection(
|
||||
sortDirection === "asc" ? "desc" : "asc",
|
||||
);
|
||||
setSortBy("progress");
|
||||
}}
|
||||
>
|
||||
Progress from start date
|
||||
</TableSortLabel>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
@@ -167,12 +316,30 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
if (sortDirection === "desc")
|
||||
return a.amount > b.amount ? -1 : 1;
|
||||
}
|
||||
if (sortBy === "storage") {
|
||||
if (sortDirection === "asc")
|
||||
return a.storageAmount > b.storageAmount ? 1 : -1;
|
||||
if (sortDirection === "desc")
|
||||
return a.storageAmount > b.storageAmount ? -1 : 1;
|
||||
}
|
||||
if (sortBy === "price") {
|
||||
if (sortDirection === "asc")
|
||||
return a.price > b.price ? 1 : -1;
|
||||
if (sortDirection === "desc")
|
||||
return a.price > b.price ? -1 : 1;
|
||||
}
|
||||
if (sortBy === "storagePrice") {
|
||||
if (sortDirection === "asc")
|
||||
return a.storageValue > b.storageValue ? 1 : -1;
|
||||
if (sortDirection === "desc")
|
||||
return a.storageValue > b.storageValue ? -1 : 1;
|
||||
}
|
||||
if (sortBy === "progress") {
|
||||
if (sortDirection === "asc")
|
||||
return a.progress > b.progress ? 1 : -1;
|
||||
if (sortDirection === "desc")
|
||||
return a.progress > b.progress ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
.map((product) => (
|
||||
@@ -180,7 +347,10 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
key={product.materialName}
|
||||
material={product.materialName}
|
||||
amount={product.amount}
|
||||
storageAmount={product.storageAmount}
|
||||
price={product.price}
|
||||
storageValue={product.storageValue}
|
||||
progress={product.progress}
|
||||
/>
|
||||
))}
|
||||
<SummaryRow
|
||||
@@ -189,6 +359,10 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
(amount, p) => amount + p.price,
|
||||
0,
|
||||
)}
|
||||
storageValue={withProductNameAndPrice.reduce(
|
||||
(amount, p) => amount + p.storageValue,
|
||||
0,
|
||||
)}
|
||||
/>
|
||||
</TableBody>
|
||||
</Table>
|
||||
@@ -202,17 +376,32 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
|
||||
const SummaryRow = ({
|
||||
material,
|
||||
amount,
|
||||
storageAmount,
|
||||
price,
|
||||
storageValue,
|
||||
progress,
|
||||
}: {
|
||||
material: string;
|
||||
amount?: number;
|
||||
storageAmount?: number;
|
||||
price: number;
|
||||
storageValue?: number;
|
||||
progress?: number;
|
||||
}) => (
|
||||
<TableRow>
|
||||
<TableCell component="th" scope="row">
|
||||
{material}
|
||||
</TableCell>
|
||||
<TableCell>{amount}</TableCell>
|
||||
<TableCell align="right">{amount?.toFixed(1)}</TableCell>
|
||||
<TableCell align="right">{storageAmount?.toFixed(1)}</TableCell>
|
||||
<TableCell align="right">{storageValue !== undefined && displayValue(storageValue)}</TableCell>
|
||||
<TableCell align="right">{displayValue(price)}</TableCell>
|
||||
<TableCell align="right">
|
||||
{progress !== undefined && (
|
||||
<Typography color={progress >= 100 ? 'success.main' : progress >= 75 ? 'warning.main' : 'error.main'}>
|
||||
{progress.toFixed(1)}%
|
||||
</Typography>
|
||||
)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { Box, Button, Tooltip } from "@mui/material";
|
||||
export const SupportButton = () => {
|
||||
return (
|
||||
<Box>
|
||||
<Tooltip
|
||||
title={`
|
||||
Consider using code 'CALLIEVE' on EVE store checkout to support the project! Click to copy to clipboard ;)
|
||||
`}
|
||||
>
|
||||
<Button
|
||||
href=""
|
||||
style={{ width: "100%" }}
|
||||
sx={{ color: "white", display: "block" }}
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText("CALLIEVE");
|
||||
}}
|
||||
>
|
||||
CALLIEVE
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -1,7 +1,6 @@
|
||||
import { EvePraisalResult } from "@/eve-praisal";
|
||||
import { AccessToken, CharacterUpdate } from "@/types";
|
||||
import { AccessToken, CharacterUpdate, PlanetConfig } from "@/types";
|
||||
import { Dispatch, SetStateAction, createContext } from "react";
|
||||
import { PlanetConfig } from "../components/PlanetConfig/PlanetConfigDialog";
|
||||
|
||||
export const CharacterContext = createContext<{
|
||||
characters: AccessToken[];
|
||||
@@ -27,6 +26,8 @@ export const SessionContext = createContext<{
|
||||
togglePlanMode: () => void;
|
||||
alertMode: boolean;
|
||||
toggleAlertMode: () => void;
|
||||
extractionTimeMode: boolean;
|
||||
toggleExtractionTimeMode: () => void;
|
||||
piPrices: EvePraisalResult | undefined;
|
||||
updatePlanetConfig: (config: PlanetConfig) => void;
|
||||
readPlanetConfig: ({
|
||||
@@ -36,6 +37,10 @@ export const SessionContext = createContext<{
|
||||
characterId: number;
|
||||
planetId: number;
|
||||
}) => PlanetConfig;
|
||||
balanceThreshold: number;
|
||||
setBalanceThreshold: Dispatch<SetStateAction<number>>;
|
||||
showProductIcons: boolean;
|
||||
setShowProductIcons: (show: boolean) => void;
|
||||
}>({
|
||||
sessionReady: false,
|
||||
refreshSession: () => {},
|
||||
@@ -48,6 +53,8 @@ export const SessionContext = createContext<{
|
||||
togglePlanMode: () => {},
|
||||
alertMode: false,
|
||||
toggleAlertMode: () => {},
|
||||
extractionTimeMode: false,
|
||||
toggleExtractionTimeMode: () => {},
|
||||
piPrices: undefined,
|
||||
updatePlanetConfig: () => {},
|
||||
readPlanetConfig: ({
|
||||
@@ -59,7 +66,12 @@ export const SessionContext = createContext<{
|
||||
}) => {
|
||||
return { characterId, planetId, excludeFromTotals: true };
|
||||
},
|
||||
balanceThreshold: 1000,
|
||||
setBalanceThreshold: () => {},
|
||||
showProductIcons: false,
|
||||
setShowProductIcons: () => {},
|
||||
});
|
||||
|
||||
export type ColorSelectionType = {
|
||||
defaultColor: string;
|
||||
expiredColor: string;
|
||||
@@ -81,6 +93,7 @@ export const defaultColors = {
|
||||
dayColor: "#2F695A",
|
||||
twoDaysColor: "#2F695A",
|
||||
};
|
||||
|
||||
export const ColorContext = createContext<{
|
||||
colors: ColorSelectionType;
|
||||
setColors: (colors: ColorSelectionType) => void;
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { EvePraisalResult, fetchAllPrices } from "@/eve-praisal";
|
||||
import { getPlanet, getPlanetUniverse, getPlanets } from "@/planets";
|
||||
import { PlanetConfig } from "./components/PlanetConfig/PlanetConfigDialog";
|
||||
import { PlanetConfig } from "@/types";
|
||||
|
||||
const Home = () => {
|
||||
const searchParams = useSearchParams();
|
||||
@@ -29,6 +29,9 @@ const Home = () => {
|
||||
const [piPrices, setPiPrices] = useState<EvePraisalResult | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const [balanceThreshold, setBalanceThreshold] = useState(1000);
|
||||
const [showProductIcons, setShowProductIcons] = useState(false);
|
||||
const [extractionTimeMode, setExtractionTimeMode] = useState(false);
|
||||
|
||||
const [colors, setColors] = useState<ColorSelectionType>(defaultColors);
|
||||
const [alertMode, setAlertMode] = useState(false);
|
||||
@@ -147,6 +150,10 @@ const Home = () => {
|
||||
setAlertMode(!alertMode);
|
||||
};
|
||||
|
||||
const toggleExtractionTimeMode = () => {
|
||||
setExtractionTimeMode(!extractionTimeMode);
|
||||
};
|
||||
|
||||
const updatePlanetConfig = (config: PlanetConfig) => {
|
||||
const charactersToSave = characters.map((c) => {
|
||||
if (c.character.characterId === config.characterId) {
|
||||
@@ -199,6 +206,17 @@ const Home = () => {
|
||||
setAlertMode(JSON.parse(storedAlertMode));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const storedBalanceThreshold = localStorage.getItem("balanceThreshold");
|
||||
if (storedBalanceThreshold) {
|
||||
setBalanceThreshold(parseInt(storedBalanceThreshold));
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem("balanceThreshold", balanceThreshold.toString());
|
||||
}, [balanceThreshold]);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem("compactMode", compactMode ? "true" : "false");
|
||||
}, [compactMode]);
|
||||
@@ -211,6 +229,17 @@ const Home = () => {
|
||||
localStorage.setItem("colors", JSON.stringify(colors));
|
||||
}, [colors]);
|
||||
|
||||
useEffect(() => {
|
||||
const savedMode = localStorage.getItem('extractionTimeMode');
|
||||
if (savedMode) {
|
||||
setExtractionTimeMode(savedMode === 'true');
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
localStorage.setItem('extractionTimeMode', extractionTimeMode.toString());
|
||||
}, [extractionTimeMode]);
|
||||
|
||||
useEffect(() => {
|
||||
fetch("api/env")
|
||||
.then((r) => r.json())
|
||||
@@ -236,7 +265,7 @@ const Home = () => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const ESI_CACHE_TIME_MS = 600000;
|
||||
const ESI_CACHE_TIME_MS = 3000000;
|
||||
const interval = setInterval(() => {
|
||||
const characters = initializeCharacters();
|
||||
refreshSession(characters)
|
||||
@@ -262,8 +291,14 @@ const Home = () => {
|
||||
piPrices,
|
||||
alertMode,
|
||||
toggleAlertMode,
|
||||
extractionTimeMode,
|
||||
toggleExtractionTimeMode,
|
||||
updatePlanetConfig,
|
||||
readPlanetConfig,
|
||||
balanceThreshold,
|
||||
setBalanceThreshold,
|
||||
showProductIcons,
|
||||
setShowProductIcons,
|
||||
}}
|
||||
>
|
||||
<CharacterContext.Provider
|
||||
|
||||
@@ -1,11 +1,51 @@
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import logger from "@/utils/logger";
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === "GET") {
|
||||
const EVE_SSO_CALLBACK_URL = process.env.EVE_SSO_CALLBACK_URL;
|
||||
const EVE_SSO_CLIENT_ID = process.env.EVE_SSO_CLIENT_ID;
|
||||
res.json({ EVE_SSO_CLIENT_ID, EVE_SSO_CALLBACK_URL });
|
||||
logger.info({
|
||||
event: 'env_request_start'
|
||||
});
|
||||
|
||||
try {
|
||||
const EVE_SSO_CALLBACK_URL = process.env.EVE_SSO_CALLBACK_URL;
|
||||
const EVE_SSO_CLIENT_ID = process.env.EVE_SSO_CLIENT_ID;
|
||||
|
||||
if (!EVE_SSO_CALLBACK_URL || !EVE_SSO_CLIENT_ID) {
|
||||
logger.error({
|
||||
event: 'env_request_failed',
|
||||
reason: 'missing_env_vars',
|
||||
vars: {
|
||||
hasCallbackUrl: !!EVE_SSO_CALLBACK_URL,
|
||||
hasClientId: !!EVE_SSO_CLIENT_ID
|
||||
}
|
||||
});
|
||||
return res.status(500).json({ error: 'Missing required environment variables' });
|
||||
}
|
||||
|
||||
logger.info({
|
||||
event: 'env_request_success',
|
||||
vars: {
|
||||
hasCallbackUrl: true,
|
||||
hasClientId: true
|
||||
}
|
||||
});
|
||||
|
||||
return res.json({ EVE_SSO_CLIENT_ID, EVE_SSO_CALLBACK_URL });
|
||||
} catch (e) {
|
||||
logger.error({
|
||||
event: 'env_request_failed',
|
||||
reason: 'unexpected_error',
|
||||
error: e
|
||||
});
|
||||
return res.status(500).json({ error: 'Internal server error' });
|
||||
}
|
||||
} else {
|
||||
logger.warn({
|
||||
event: 'invalid_method',
|
||||
method: req.method,
|
||||
path: req.url
|
||||
});
|
||||
res.status(404).end();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,19 +1,45 @@
|
||||
import { getPraisal } from "@/eve-praisal";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import logger from "@/utils/logger";
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === "POST") {
|
||||
const praisalRequest: { quantity: number; type_id: number }[] = JSON.parse(
|
||||
req.body
|
||||
);
|
||||
logger.info({
|
||||
event: 'praisal_request_start'
|
||||
});
|
||||
|
||||
try {
|
||||
const praisalRequest: { quantity: number; type_id: number }[] = JSON.parse(
|
||||
req.body
|
||||
);
|
||||
|
||||
logger.info({
|
||||
event: 'praisal_request_parsed',
|
||||
items: praisalRequest.length
|
||||
});
|
||||
|
||||
const praisal = await getPraisal(praisalRequest);
|
||||
|
||||
logger.info({
|
||||
event: 'praisal_request_success',
|
||||
items: praisalRequest.length
|
||||
});
|
||||
|
||||
return res.json(praisal);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
res.status(404).end();
|
||||
logger.error({
|
||||
event: 'praisal_request_failed',
|
||||
error: e,
|
||||
body: req.body
|
||||
});
|
||||
return res.status(500).json({ error: 'Failed to get praisal' });
|
||||
}
|
||||
} else {
|
||||
logger.warn({
|
||||
event: 'invalid_method',
|
||||
method: req.method,
|
||||
path: req.url
|
||||
});
|
||||
res.status(404).end();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { AccessToken } from "@/types";
|
||||
import { extractCharacterFromToken } from "@/utils";
|
||||
import { extractCharacterFromToken } from "@/utils/utils";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import crypto from "crypto-js";
|
||||
import logger from "@/utils/logger";
|
||||
|
||||
const EVE_SSO_TOKEN_URL = "https://login.eveonline.com/v2/oauth/token";
|
||||
const EVE_SSO_CLIENT_ID = process.env.EVE_SSO_CLIENT_ID ?? "";
|
||||
@@ -10,6 +11,14 @@ const EVE_SSO_SECRET = process.env.EVE_SSO_SECRET ?? "";
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === "POST") {
|
||||
const accessToken: AccessToken = req.body;
|
||||
logger.info({
|
||||
event: 'token_refresh_start',
|
||||
character: {
|
||||
name: accessToken.character.name,
|
||||
characterId: accessToken.character.characterId
|
||||
}
|
||||
});
|
||||
|
||||
const params = new URLSearchParams({
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: crypto.AES.decrypt(
|
||||
@@ -33,7 +42,20 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
body: params,
|
||||
headers,
|
||||
}).then((res) => res.json());
|
||||
|
||||
const character = extractCharacterFromToken(response);
|
||||
if (!character) {
|
||||
logger.error({
|
||||
event: 'token_refresh_failed',
|
||||
reason: 'character_extraction_failed',
|
||||
character: {
|
||||
name: accessToken.character.name,
|
||||
characterId: accessToken.character.characterId
|
||||
}
|
||||
});
|
||||
return res.json({ ...accessToken, needsLogin: true });
|
||||
}
|
||||
|
||||
const token: AccessToken = {
|
||||
access_token: response.access_token,
|
||||
token_type: response.token_type,
|
||||
@@ -51,12 +73,26 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
planetConfig: accessToken.planetConfig ?? [],
|
||||
};
|
||||
|
||||
console.log("Refresh", character.name, character.characterId);
|
||||
logger.info({
|
||||
event: 'token_refresh_success',
|
||||
character: {
|
||||
name: character.name,
|
||||
characterId: character.characterId
|
||||
}
|
||||
});
|
||||
|
||||
return res.json(token);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
res.json({ ...accessToken, needsLogin: true });
|
||||
logger.error({
|
||||
event: 'token_refresh_failed',
|
||||
reason: 'api_error',
|
||||
error: e,
|
||||
character: {
|
||||
name: accessToken.character.name,
|
||||
characterId: accessToken.character.characterId
|
||||
}
|
||||
});
|
||||
return res.json({ ...accessToken, needsLogin: true });
|
||||
}
|
||||
} else {
|
||||
res.status(404).end();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AccessToken } from "@/types";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import crypto from "crypto-js";
|
||||
import logger from "@/utils/logger";
|
||||
|
||||
const EVE_SSO_REVOKE_URL = "https://login.eveonline.com/v2/oauth/revoke";
|
||||
const EVE_SSO_CLIENT_ID = process.env.EVE_SSO_CLIENT_ID ?? "";
|
||||
@@ -9,6 +10,14 @@ const EVE_SSO_SECRET = process.env.EVE_SSO_SECRET ?? "";
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === "POST") {
|
||||
const accessToken: AccessToken = req.body;
|
||||
logger.info({
|
||||
event: 'token_revoke_start',
|
||||
character: {
|
||||
name: accessToken.character.name,
|
||||
characterId: accessToken.character.characterId
|
||||
}
|
||||
});
|
||||
|
||||
const params = new URLSearchParams({
|
||||
grant_type: "refresh_token",
|
||||
refresh_token: crypto.AES.decrypt(
|
||||
@@ -27,24 +36,42 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
};
|
||||
|
||||
try {
|
||||
await fetch(EVE_SSO_REVOKE_URL, {
|
||||
const response = await fetch(EVE_SSO_REVOKE_URL, {
|
||||
method: "POST",
|
||||
body: params,
|
||||
headers,
|
||||
}).then((res) => res.json());
|
||||
});
|
||||
|
||||
console.log(
|
||||
"Revoke",
|
||||
accessToken.character.name,
|
||||
accessToken.character.characterId
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
logger.info({
|
||||
event: 'token_revoke_success',
|
||||
character: {
|
||||
name: accessToken.character.name,
|
||||
characterId: accessToken.character.characterId
|
||||
}
|
||||
});
|
||||
|
||||
return res.end();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
logger.error({
|
||||
event: 'token_revoke_failed',
|
||||
error: e,
|
||||
character: {
|
||||
name: accessToken.character.name,
|
||||
characterId: accessToken.character.characterId
|
||||
}
|
||||
});
|
||||
return res.status(500).end();
|
||||
}
|
||||
} else {
|
||||
logger.warn({
|
||||
event: 'invalid_method',
|
||||
method: req.method,
|
||||
path: req.url
|
||||
});
|
||||
res.status(404).end();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { AccessToken } from "@/types";
|
||||
import { extractCharacterFromToken } from "@/utils";
|
||||
import { extractCharacterFromToken } from "@/utils/utils";
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import crypto from "crypto-js";
|
||||
import logger from "@/utils/logger";
|
||||
|
||||
const EVE_SSO_TOKEN_URL = "https://login.eveonline.com/v2/oauth/token";
|
||||
const EVE_SSO_CLIENT_ID = process.env.EVE_SSO_CLIENT_ID ?? "";
|
||||
@@ -10,7 +11,19 @@ const EVE_SSO_SECRET = process.env.EVE_SSO_SECRET ?? "";
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
if (req.method === "GET") {
|
||||
const code = req.query.code as string;
|
||||
if (!code || code === undefined) return res.status(404).end();
|
||||
if (!code || code === undefined) {
|
||||
logger.warn({
|
||||
event: 'token_request_failed',
|
||||
reason: 'missing_code',
|
||||
query: req.query
|
||||
});
|
||||
return res.status(404).end();
|
||||
}
|
||||
|
||||
logger.info({
|
||||
event: 'token_request_start',
|
||||
code: code
|
||||
});
|
||||
|
||||
const params = new URLSearchParams({
|
||||
grant_type: "authorization_code",
|
||||
@@ -26,34 +39,69 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
"User-Agent": "https://github.com/calli-eve/eve-pi",
|
||||
};
|
||||
|
||||
const response = await fetch(EVE_SSO_TOKEN_URL, {
|
||||
method: "POST",
|
||||
body: params,
|
||||
headers,
|
||||
}).then((res) => res.json());
|
||||
try {
|
||||
const response = await fetch(EVE_SSO_TOKEN_URL, {
|
||||
method: "POST",
|
||||
body: params,
|
||||
headers,
|
||||
});
|
||||
|
||||
const character = extractCharacterFromToken(response);
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
console.log("Login", character.name, character.characterId);
|
||||
const data = await response.json();
|
||||
const character = extractCharacterFromToken(data);
|
||||
|
||||
const token: AccessToken = {
|
||||
access_token: response.access_token,
|
||||
token_type: response.token_type,
|
||||
refresh_token: crypto.AES.encrypt(
|
||||
response.refresh_token,
|
||||
EVE_SSO_SECRET,
|
||||
).toString(),
|
||||
expires_at: Date.now() + response.expires_in * 1000,
|
||||
character,
|
||||
needsLogin: false,
|
||||
account: "-",
|
||||
comment: "",
|
||||
system: "",
|
||||
planets: [],
|
||||
planetConfig: [],
|
||||
};
|
||||
res.json(token);
|
||||
if (!character) {
|
||||
logger.error({
|
||||
event: 'token_request_failed',
|
||||
reason: 'character_extraction_failed',
|
||||
data
|
||||
});
|
||||
return res.status(500).end();
|
||||
}
|
||||
|
||||
logger.info({
|
||||
event: 'token_request_success',
|
||||
character: {
|
||||
name: character.name,
|
||||
characterId: character.characterId
|
||||
}
|
||||
});
|
||||
|
||||
const token: AccessToken = {
|
||||
access_token: data.access_token,
|
||||
token_type: data.token_type,
|
||||
refresh_token: crypto.AES.encrypt(
|
||||
data.refresh_token,
|
||||
EVE_SSO_SECRET,
|
||||
).toString(),
|
||||
expires_at: Date.now() + data.expires_in * 1000,
|
||||
character,
|
||||
needsLogin: false,
|
||||
account: "-",
|
||||
comment: "",
|
||||
system: "",
|
||||
planets: [],
|
||||
planetConfig: [],
|
||||
};
|
||||
return res.json(token);
|
||||
} catch (e) {
|
||||
logger.error({
|
||||
event: 'token_request_failed',
|
||||
reason: 'api_error',
|
||||
error: e,
|
||||
code: code
|
||||
});
|
||||
return res.status(500).end();
|
||||
}
|
||||
} else {
|
||||
logger.warn({
|
||||
event: 'invalid_method',
|
||||
method: req.method,
|
||||
path: req.url
|
||||
});
|
||||
res.status(404).end();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ export const getPlanetUniverse = async (
|
||||
export const planetCalculations = (planet: PlanetWithInfo) => {
|
||||
const planetInfo = planet.info;
|
||||
type SchematicId = number;
|
||||
const extractors: PlanetInfo["pins"] = planetInfo.pins.filter((p) =>
|
||||
const extractors = planetInfo.pins.filter((p) =>
|
||||
EXTRACTOR_TYPE_IDS.some((e) => e === p.type_id),
|
||||
);
|
||||
const localProduction = planetInfo.pins
|
||||
@@ -61,10 +61,19 @@ export const planetCalculations = (planet: PlanetWithInfo) => {
|
||||
const schematic = PI_SCHEMATICS.find(
|
||||
(s) => s.schematic_id == f.schematic_id,
|
||||
);
|
||||
if (schematic) acc.set(f.schematic_id, schematic);
|
||||
if (schematic) {
|
||||
const existing = acc.get(f.schematic_id);
|
||||
if (existing) {
|
||||
// If we already have this schematic, increment its count
|
||||
existing.count = (existing.count || 0) + 1;
|
||||
} else {
|
||||
// First time seeing this schematic, set count to 1
|
||||
acc.set(f.schematic_id, { ...schematic, count: 1 });
|
||||
}
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, new Map<SchematicId, (typeof PI_SCHEMATICS)[number]>());
|
||||
}, new Map<SchematicId, (typeof PI_SCHEMATICS)[number] & { count: number }>());
|
||||
|
||||
const locallyProduced = Array.from(localProduction)
|
||||
.flatMap((p) => p[1].outputs)
|
||||
@@ -85,7 +94,13 @@ export const planetCalculations = (planet: PlanetWithInfo) => {
|
||||
![...locallyProduced, ...locallyExcavated].some(
|
||||
(lp) => lp === p.type_id,
|
||||
),
|
||||
);
|
||||
).map((p) => ({
|
||||
...p,
|
||||
factoryCount: planetInfo.pins
|
||||
.filter((f) => f.schematic_id === p.schematic_id)
|
||||
.length,
|
||||
}));
|
||||
|
||||
|
||||
const localExports = locallyProduced
|
||||
.filter((p) => !locallyConsumed.some((lp) => lp === p))
|
||||
|
||||
109
src/types.ts
109
src/types.ts
@@ -1,6 +1,3 @@
|
||||
import { PlanetConfig } from "./app/components/PlanetConfig/PlanetConfigDialog";
|
||||
import { Api } from "./esi-api";
|
||||
|
||||
export interface AccessToken {
|
||||
access_token: string;
|
||||
expires_at: number;
|
||||
@@ -20,10 +17,50 @@ export interface Character {
|
||||
characterId: number;
|
||||
}
|
||||
|
||||
export interface Planet {
|
||||
planet_id: number;
|
||||
solar_system_id: number;
|
||||
planet_type: "temperate" | "barren" | "oceanic" | "ice" | "gas" | "lava" | "storm" | "plasma";
|
||||
last_update: string;
|
||||
num_pins: number;
|
||||
owner_id: number;
|
||||
upgrade_level: number;
|
||||
}
|
||||
|
||||
export interface PlanetInfo {
|
||||
links: Array<{
|
||||
destination_pin_id: number;
|
||||
link_level: number;
|
||||
source_pin_id: number;
|
||||
}>;
|
||||
pins: Pin[];
|
||||
routes: Array<{
|
||||
content_type_id: number;
|
||||
destination_pin_id: number;
|
||||
quantity: number;
|
||||
route_id: number;
|
||||
source_pin_id: number;
|
||||
waypoints?: number[];
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface PlanetInfoUniverse {
|
||||
name: string;
|
||||
planet_id: number;
|
||||
system_id: number;
|
||||
type_id: number;
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PlanetWithInfo extends Planet {
|
||||
info: PlanetInfo;
|
||||
infoUniverse: PlanetInfoUniverse;
|
||||
}
|
||||
|
||||
export interface CharacterPlanets {
|
||||
name: string;
|
||||
characterId: number;
|
||||
@@ -38,31 +75,51 @@ export interface CharacterUpdate {
|
||||
system?: string;
|
||||
}
|
||||
|
||||
export type Planet = EsiType<"v1", "getCharactersCharacterIdPlanets">[number];
|
||||
|
||||
export type PlanetInfoUniverse = EsiType<"v1", "getUniversePlanetsPlanetId">;
|
||||
|
||||
export type PlanetInfo = EsiType<
|
||||
"v3",
|
||||
"getCharactersCharacterIdPlanetsPlanetId"
|
||||
>;
|
||||
|
||||
export interface Env {
|
||||
EVE_SSO_CALLBACK_URL: string;
|
||||
EVE_SSO_CLIENT_ID: string;
|
||||
}
|
||||
|
||||
type EsiApiVersionType = keyof InstanceType<typeof Api<unknown>>;
|
||||
type EsiApiPathType<V extends EsiApiVersionType> = keyof InstanceType<
|
||||
typeof Api<unknown>
|
||||
>[V];
|
||||
type EsiApiResponseType<
|
||||
V extends EsiApiVersionType,
|
||||
T extends EsiApiPathType<V>,
|
||||
> = Awaited<ReturnType<InstanceType<typeof Api<unknown>>[V][T]>>;
|
||||
export type EsiType<
|
||||
V extends EsiApiVersionType,
|
||||
T extends EsiApiPathType<V>,
|
||||
> = EsiApiResponseType<V, T> extends { data: any }
|
||||
? EsiApiResponseType<V, T>["data"]
|
||||
: never;
|
||||
export interface EvePraisalResult {
|
||||
appraisal: {
|
||||
items: Array<{
|
||||
typeID: number;
|
||||
prices: {
|
||||
sell: {
|
||||
min: number;
|
||||
};
|
||||
};
|
||||
}>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Pin {
|
||||
pin_id: number;
|
||||
type_id: number;
|
||||
schematic_id?: number;
|
||||
expiry_time?: string;
|
||||
install_time?: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
extractor_details?: {
|
||||
cycle_time?: number;
|
||||
head_radius?: number;
|
||||
heads: Array<{
|
||||
head_id: number;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}>;
|
||||
product_type_id?: number;
|
||||
qty_per_cycle?: number;
|
||||
};
|
||||
contents?: Array<{
|
||||
type_id: number;
|
||||
amount: number;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface PlanetConfig {
|
||||
characterId: number;
|
||||
planetId: number;
|
||||
excludeFromTotals: boolean;
|
||||
}
|
||||
|
||||
13
src/utils.ts
13
src/utils.ts
@@ -1,13 +0,0 @@
|
||||
import { AccessToken, Character } from "./types";
|
||||
|
||||
export const extractCharacterFromToken = (token: AccessToken): Character => {
|
||||
const decodedToken = parseJwt(token.access_token);
|
||||
return {
|
||||
name: decodedToken.name,
|
||||
characterId: decodedToken.sub.split(":")[2],
|
||||
};
|
||||
};
|
||||
|
||||
const parseJwt = (token: string) => {
|
||||
return JSON.parse(Buffer.from(token.split(".")[1], "base64").toString());
|
||||
};
|
||||
18
src/utils/logger.ts
Normal file
18
src/utils/logger.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import pino from 'pino';
|
||||
|
||||
const logger = pino({
|
||||
level: process.env.LOG_LEVEL || 'info',
|
||||
transport: {
|
||||
target: 'pino-pretty',
|
||||
options: {
|
||||
colorize: true,
|
||||
translateTime: 'SYS:standard',
|
||||
ignore: 'pid,hostname',
|
||||
},
|
||||
},
|
||||
base: {
|
||||
env: process.env.NODE_ENV,
|
||||
},
|
||||
});
|
||||
|
||||
export default logger;
|
||||
22
src/utils/utils.ts
Normal file
22
src/utils/utils.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { AccessToken, Character } from "../types";
|
||||
|
||||
export const extractCharacterFromToken = (token: AccessToken): Character | null => {
|
||||
const decodedToken = parseJwt(token.access_token);
|
||||
if (!decodedToken || !decodedToken.name || !decodedToken.sub) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
name: decodedToken.name,
|
||||
characterId: decodedToken.sub.split(":")[2],
|
||||
};
|
||||
};
|
||||
|
||||
const parseJwt = (token: string | undefined) => {
|
||||
if (!token) return null;
|
||||
try {
|
||||
return JSON.parse(Buffer.from(token.split(".")[1], "base64").toString());
|
||||
} catch (error) {
|
||||
console.error('Failed to parse JWT token:', error);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user