feat: redesign dashboard, add lightbox bulk download, and standardize ui
This commit is contained in:
1 parent
8728308fc6
commit
4a9da65901
13 files changed
+923
-104
No files matched your search
@@ -19,6 +19,7 @@
|
||||
"@better-auth/drizzle-adapter": "^1.6.26",
|
||||
"@js-temporal/polyfill": "^0.5.1",
|
||||
"@radix-ui/react-slot": "^1.3.3",
|
||||
"archiver": "^8.0.0",
|
||||
"better-auth": "^1.6.26",
|
||||
"clsx": "^2.1.1",
|
||||
"drizzle-orm": "^0.45.2",
|
||||
@@ -30,6 +31,7 @@
|
||||
"pg": "^8.22.0",
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"recharts": "^3.10.1",
|
||||
"server-only": "^0.0.1",
|
||||
"sharp": "^0.35.3",
|
||||
"tailwind-merge": "^3.6.0",
|
||||
@@ -41,6 +43,7 @@
|
||||
"@testcontainers/postgresql": "^12.1.0",
|
||||
"@testing-library/jest-dom": "^7.0.0",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@types/archiver": "^8.0.0",
|
||||
"@types/node": "^24.13.3",
|
||||
"@types/nodemailer": "^8.0.1",
|
||||
"@types/pdfmake": "^0.3.3",
|
||||
|
||||
Generated
+383
@@ -17,6 +17,9 @@ importers:
|
||||
'@radix-ui/react-slot':
|
||||
specifier: ^1.3.3
|
||||
version: 1.3.3(@types/react@19.2.18)(react@19.2.8)
|
||||
archiver:
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0
|
||||
better-auth:
|
||||
specifier: ^1.6.26
|
||||
version: 1.6.26(drizzle-kit@0.31.10)(drizzle-orm@0.45.2(@types/pg@8.21.0)(kysely@0.29.4)(pg@8.22.0))(next@16.3.0(@babel/core@7.29.7)(@playwright/test@1.62.1)(@types/node@24.13.3)(react-dom@19.2.8(react@19.2.8))(react@19.2.8))(pg@8.22.0)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(vitest@4.1.10(@types/node@24.13.3)(jsdom@30.0.1(@noble/hashes@2.3.0))(msw@2.15.0(@types/node@24.13.3)(typescript@5.9.3))(vite@8.2.1(@types/node@24.13.3)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.11)(yaml@2.9.0)))
|
||||
@@ -50,6 +53,9 @@ importers:
|
||||
react-dom:
|
||||
specifier: ^19.2.8
|
||||
version: 19.2.8(react@19.2.8)
|
||||
recharts:
|
||||
specifier: ^3.10.1
|
||||
version: 3.10.1(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react-is@17.0.2)(react@19.2.8)(redux@5.0.1)
|
||||
server-only:
|
||||
specifier: ^0.0.1
|
||||
version: 0.0.1
|
||||
@@ -78,6 +84,9 @@ importers:
|
||||
'@testing-library/react':
|
||||
specifier: ^16.3.2
|
||||
version: 16.3.2(@testing-library/dom@10.4.1)(@types/react-dom@19.2.4(@types/react@19.2.18))(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react@19.2.8)
|
||||
'@types/archiver':
|
||||
specifier: ^8.0.0
|
||||
version: 8.0.0
|
||||
'@types/node':
|
||||
specifier: ^24.13.3
|
||||
version: 24.13.3
|
||||
@@ -1376,6 +1385,17 @@ packages:
|
||||
'@types/react':
|
||||
optional: true
|
||||
|
||||
'@reduxjs/toolkit@2.12.0':
|
||||
resolution: {integrity: sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==}
|
||||
peerDependencies:
|
||||
react: ^16.9.0 || ^17.0.0 || ^18 || ^19
|
||||
react-redux: ^7.2.1 || ^8.1.3 || ^9.0.0
|
||||
peerDependenciesMeta:
|
||||
react:
|
||||
optional: true
|
||||
react-redux:
|
||||
optional: true
|
||||
|
||||
'@rolldown/binding-android-arm64@1.2.3':
|
||||
resolution: {integrity: sha512-zrJtHDcaZJ1Fp7xf4hNl+7seH9Cn/N5TwLYkhgXREtBwAd/jaqW3uqeHxpDugJLVICWg4eW44kOQEGJ1r6jCGw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
@@ -1475,6 +1495,9 @@ packages:
|
||||
'@standard-schema/spec@1.1.0':
|
||||
resolution: {integrity: sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==}
|
||||
|
||||
'@standard-schema/utils@0.3.0':
|
||||
resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==}
|
||||
|
||||
'@swc/helpers@0.5.15':
|
||||
resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==}
|
||||
|
||||
@@ -1601,12 +1624,42 @@ packages:
|
||||
'@tybys/wasm-util@0.10.3':
|
||||
resolution: {integrity: sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==}
|
||||
|
||||
'@types/archiver@8.0.0':
|
||||
resolution: {integrity: sha512-YpXPbEuv9+eUIPPQWUPahj3cvs9isWRuF+J4z+KbdYVDO3rWorWQFxUVHnwPu2AgKwvgpki5F2VMX0Xx+mX45A==}
|
||||
|
||||
'@types/aria-query@5.0.4':
|
||||
resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==}
|
||||
|
||||
'@types/chai@5.2.3':
|
||||
resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==}
|
||||
|
||||
'@types/d3-array@3.2.2':
|
||||
resolution: {integrity: sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==}
|
||||
|
||||
'@types/d3-color@3.1.3':
|
||||
resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==}
|
||||
|
||||
'@types/d3-ease@3.0.2':
|
||||
resolution: {integrity: sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==}
|
||||
|
||||
'@types/d3-interpolate@3.0.4':
|
||||
resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==}
|
||||
|
||||
'@types/d3-path@3.1.1':
|
||||
resolution: {integrity: sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==}
|
||||
|
||||
'@types/d3-scale@4.0.9':
|
||||
resolution: {integrity: sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==}
|
||||
|
||||
'@types/d3-shape@3.1.8':
|
||||
resolution: {integrity: sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==}
|
||||
|
||||
'@types/d3-time@3.0.4':
|
||||
resolution: {integrity: sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==}
|
||||
|
||||
'@types/d3-timer@3.0.2':
|
||||
resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==}
|
||||
|
||||
'@types/deep-eql@4.0.2':
|
||||
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
|
||||
|
||||
@@ -1651,6 +1704,9 @@ packages:
|
||||
'@types/react@19.2.18':
|
||||
resolution: {integrity: sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==}
|
||||
|
||||
'@types/readdir-glob@1.1.5':
|
||||
resolution: {integrity: sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==}
|
||||
|
||||
'@types/set-cookie-parser@2.4.10':
|
||||
resolution: {integrity: sha512-GGmQVGpQWUe5qglJozEjZV/5dyxbOOZ0LHe/lqyWssB88Y4svNfst0uqBVscdDeIKl5Jy5+aPSvy7mI9tYRguw==}
|
||||
|
||||
@@ -1666,6 +1722,9 @@ packages:
|
||||
'@types/statuses@2.0.6':
|
||||
resolution: {integrity: sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==}
|
||||
|
||||
'@types/use-sync-external-store@0.0.6':
|
||||
resolution: {integrity: sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.66.0':
|
||||
resolution: {integrity: sha512-p088eaGrzYz1s+7cov0aMOCkNGTJlVxF4jgubf28c8L0Cv9Rloj8YBHnv4hXLq6IIEE1AsjNWavO+k+8kP2Y0A==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@@ -1932,6 +1991,10 @@ packages:
|
||||
resolution: {integrity: sha512-ZcbTaIqJOfCc03QwD468Unz/5Ir8ATtvAHsK+FdXbDIbGfihqh9mrvdcYunQzqn4HrvWWaFyaxJhGZagaJJpPQ==}
|
||||
engines: {node: '>= 14'}
|
||||
|
||||
archiver@8.0.0:
|
||||
resolution: {integrity: sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
argparse@2.0.1:
|
||||
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
||||
|
||||
@@ -2255,6 +2318,10 @@ packages:
|
||||
resolution: {integrity: sha512-6FqVXeETqWPoGcfzrXb37E50NP0LXT8kAMu5ooZayhWWdgEY4lBEEcbQNXtkuKQsGduxiIcI4gOTsxTmuq/bSg==}
|
||||
engines: {node: '>= 14'}
|
||||
|
||||
compress-commons@7.0.1:
|
||||
resolution: {integrity: sha512-g0S8KAD8qf4+V//pr3BfB1aBnARLXNz2Gx+jmHU0LEriUuoQUOPOulVquHKTJ8+EAIIO7fhseNDr9wK5Q9FKBQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
concat-map@0.0.1:
|
||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||
|
||||
@@ -2281,6 +2348,10 @@ packages:
|
||||
resolution: {integrity: sha512-piICUB6ei4IlTv1+653yq5+KoqfBYmj9bw6LqXoOneTMDXk5nM1qt12mFW1caG3LlJXEKW1Bp0WggEmIfQB34g==}
|
||||
engines: {node: '>= 14'}
|
||||
|
||||
crc32-stream@7.0.1:
|
||||
resolution: {integrity: sha512-IBWsY8xznyQrcHn8h4bC8/4ErNke5elzgG8GcqF4RFPw6aHkWWRc7Tgw6upjaTX/CT/yQgqYENkxYsTYN+hW2g==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
cross-spawn@7.0.6:
|
||||
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
|
||||
engines: {node: '>= 8'}
|
||||
@@ -2295,6 +2366,50 @@ packages:
|
||||
csstype@3.2.3:
|
||||
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
|
||||
|
||||
d3-array@3.2.4:
|
||||
resolution: {integrity: sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-color@3.1.0:
|
||||
resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-ease@3.0.1:
|
||||
resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-format@3.1.2:
|
||||
resolution: {integrity: sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-interpolate@3.0.1:
|
||||
resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-path@3.1.0:
|
||||
resolution: {integrity: sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-scale@4.0.2:
|
||||
resolution: {integrity: sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-shape@3.2.0:
|
||||
resolution: {integrity: sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-time-format@4.1.0:
|
||||
resolution: {integrity: sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-time@3.1.0:
|
||||
resolution: {integrity: sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
d3-timer@3.0.1:
|
||||
resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
damerau-levenshtein@1.0.8:
|
||||
resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==}
|
||||
|
||||
@@ -2331,6 +2446,9 @@ packages:
|
||||
supports-color:
|
||||
optional: true
|
||||
|
||||
decimal.js-light@2.5.1:
|
||||
resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==}
|
||||
|
||||
decimal.js@10.6.0:
|
||||
resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==}
|
||||
|
||||
@@ -2543,6 +2661,9 @@ packages:
|
||||
resolution: {integrity: sha512-yPDz7wqpg1/mmHLmS3tcfTfbw5f1eryXvyghYBffGdERwe+mV7ZcWzTR8LR17Kvqt3qfPurjlonmnq3MKXIOXw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
es-toolkit@1.50.0:
|
||||
resolution: {integrity: sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w==}
|
||||
|
||||
esbuild@0.18.20:
|
||||
resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -2693,6 +2814,9 @@ packages:
|
||||
resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
eventemitter3@5.0.4:
|
||||
resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==}
|
||||
|
||||
events-universal@1.0.1:
|
||||
resolution: {integrity: sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==}
|
||||
|
||||
@@ -2912,6 +3036,9 @@ packages:
|
||||
resolution: {integrity: sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==}
|
||||
engines: {node: '>= 4'}
|
||||
|
||||
immer@11.1.16:
|
||||
resolution: {integrity: sha512-Xs7H9rBc+kti1J6RueUvbEBkmOz7jqj11XYgf+YMXAYzu8EeE7hwZ9poLXdVfVnGmJu7QAf41T7H2KuF6QoK6Q==}
|
||||
|
||||
import-fresh@3.3.1:
|
||||
resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -2931,6 +3058,10 @@ packages:
|
||||
resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
internmap@2.0.3:
|
||||
resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
is-array-buffer@3.0.5:
|
||||
resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -3028,6 +3159,10 @@ packages:
|
||||
resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
is-stream@4.0.1:
|
||||
resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
is-string@1.1.1:
|
||||
resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -3710,6 +3845,18 @@ packages:
|
||||
react-is@17.0.2:
|
||||
resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==}
|
||||
|
||||
react-redux@9.3.0:
|
||||
resolution: {integrity: sha512-KQopgqFo/p/fgmAs5qz6p5RWaNAzq40WAu7fJIXnQpYxFPbJYtsJPWvGeF2rOBaY/kEuV77AVsX8TsQzKm+A/g==}
|
||||
peerDependencies:
|
||||
'@types/react': ^18.2.25 || ^19
|
||||
react: ^18.0 || ^19
|
||||
redux: ^5.0.0
|
||||
peerDependenciesMeta:
|
||||
'@types/react':
|
||||
optional: true
|
||||
redux:
|
||||
optional: true
|
||||
|
||||
react@19.2.8:
|
||||
resolution: {integrity: sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -3728,10 +3875,30 @@ packages:
|
||||
readdir-glob@1.1.3:
|
||||
resolution: {integrity: sha512-v05I2k7xN8zXvPD9N+z/uhXPaj0sUFCe2rcWZIpBsqxfP7xXFQ0tipAd/wjj1YxWyWtUS5IDJpOG82JKt2EAVA==}
|
||||
|
||||
readdir-glob@3.0.0:
|
||||
resolution: {integrity: sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
recharts@3.10.1:
|
||||
resolution: {integrity: sha512-QXFrvt6IVcw7eeZCoyXTwkIJAX3Dv1nyVhMicXJ47GsGDDpcN8z6o644DibE9XjpBTThtsomLKnTV6lc+cVFUA==}
|
||||
engines: {node: '>=18'}
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||
react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||
react-is: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||
|
||||
redent@3.0.0:
|
||||
resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
redux-thunk@3.1.0:
|
||||
resolution: {integrity: sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==}
|
||||
peerDependencies:
|
||||
redux: ^5.0.0
|
||||
|
||||
redux@5.0.1:
|
||||
resolution: {integrity: sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==}
|
||||
|
||||
reflect.getprototypeof@1.0.10:
|
||||
resolution: {integrity: sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -3748,6 +3915,9 @@ packages:
|
||||
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
reselect@5.2.0:
|
||||
resolution: {integrity: sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw==}
|
||||
|
||||
resolve-from@4.0.0:
|
||||
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -4056,6 +4226,9 @@ packages:
|
||||
tiny-inflate@1.0.3:
|
||||
resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==}
|
||||
|
||||
tiny-invariant@1.3.3:
|
||||
resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}
|
||||
|
||||
tinybench@2.9.0:
|
||||
resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
|
||||
|
||||
@@ -4185,9 +4358,17 @@ packages:
|
||||
uri-js@4.4.1:
|
||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||
|
||||
use-sync-external-store@1.6.0:
|
||||
resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==}
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||
|
||||
util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
|
||||
victory-vendor@37.3.6:
|
||||
resolution: {integrity: sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==}
|
||||
|
||||
vite@8.2.1:
|
||||
resolution: {integrity: sha512-EU/eS7BH3XROHh2YnBefjM6DBKA6ZeMZEYQbj7NLWg5wHYlhB8B/Mayd5XsgWq+NFYccDOTemRpdETWR6Ka/lw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
@@ -4376,6 +4557,10 @@ packages:
|
||||
resolution: {integrity: sha512-zK7YHHz4ZXpW89AHXUPbQVGKI7uvkd3hzusTdotCg1UxyaVtg0zFJSTfW/Dq5f7OBBVnq6cZIaC8Ti4hb6dtCA==}
|
||||
engines: {node: '>= 14'}
|
||||
|
||||
zip-stream@7.0.5:
|
||||
resolution: {integrity: sha512-dSvYKdvLsAHCDqPOhIwk/q5CvuWtTB3Dgpoe0uVEFjTzIOAmsQpprX25InCvrvJsirEbu1OHyy67n/kAj1Sw/w==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
zod-validation-error@4.0.2:
|
||||
resolution: {integrity: sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==}
|
||||
engines: {node: '>=18.0.0'}
|
||||
@@ -5287,6 +5472,18 @@ snapshots:
|
||||
optionalDependencies:
|
||||
'@types/react': 19.2.18
|
||||
|
||||
'@reduxjs/toolkit@2.12.0(react-redux@9.3.0(@types/react@19.2.18)(react@19.2.8)(redux@5.0.1))(react@19.2.8)':
|
||||
dependencies:
|
||||
'@standard-schema/spec': 1.1.0
|
||||
'@standard-schema/utils': 0.3.0
|
||||
immer: 11.1.16
|
||||
redux: 5.0.1
|
||||
redux-thunk: 3.1.0(redux@5.0.1)
|
||||
reselect: 5.2.0
|
||||
optionalDependencies:
|
||||
react: 19.2.8
|
||||
react-redux: 9.3.0(@types/react@19.2.18)(react@19.2.8)(redux@5.0.1)
|
||||
|
||||
'@rolldown/binding-android-arm64@1.2.3':
|
||||
optional: true
|
||||
|
||||
@@ -5335,6 +5532,8 @@ snapshots:
|
||||
|
||||
'@standard-schema/spec@1.1.0': {}
|
||||
|
||||
'@standard-schema/utils@0.3.0': {}
|
||||
|
||||
'@swc/helpers@0.5.15':
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
@@ -5453,6 +5652,11 @@ snapshots:
|
||||
tslib: 2.8.1
|
||||
optional: true
|
||||
|
||||
'@types/archiver@8.0.0':
|
||||
dependencies:
|
||||
'@types/node': 24.13.3
|
||||
'@types/readdir-glob': 1.1.5
|
||||
|
||||
'@types/aria-query@5.0.4': {}
|
||||
|
||||
'@types/chai@5.2.3':
|
||||
@@ -5460,6 +5664,30 @@ snapshots:
|
||||
'@types/deep-eql': 4.0.2
|
||||
assertion-error: 2.0.1
|
||||
|
||||
'@types/d3-array@3.2.2': {}
|
||||
|
||||
'@types/d3-color@3.1.3': {}
|
||||
|
||||
'@types/d3-ease@3.0.2': {}
|
||||
|
||||
'@types/d3-interpolate@3.0.4':
|
||||
dependencies:
|
||||
'@types/d3-color': 3.1.3
|
||||
|
||||
'@types/d3-path@3.1.1': {}
|
||||
|
||||
'@types/d3-scale@4.0.9':
|
||||
dependencies:
|
||||
'@types/d3-time': 3.0.4
|
||||
|
||||
'@types/d3-shape@3.1.8':
|
||||
dependencies:
|
||||
'@types/d3-path': 3.1.1
|
||||
|
||||
'@types/d3-time@3.0.4': {}
|
||||
|
||||
'@types/d3-timer@3.0.2': {}
|
||||
|
||||
'@types/deep-eql@4.0.2': {}
|
||||
|
||||
'@types/docker-modem@3.0.6':
|
||||
@@ -5514,6 +5742,10 @@ snapshots:
|
||||
dependencies:
|
||||
csstype: 3.2.3
|
||||
|
||||
'@types/readdir-glob@1.1.5':
|
||||
dependencies:
|
||||
'@types/node': 24.13.3
|
||||
|
||||
'@types/set-cookie-parser@2.4.10':
|
||||
dependencies:
|
||||
'@types/node': 24.13.3
|
||||
@@ -5533,6 +5765,8 @@ snapshots:
|
||||
|
||||
'@types/statuses@2.0.6': {}
|
||||
|
||||
'@types/use-sync-external-store@0.0.6': {}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.66.0(@typescript-eslint/parser@8.66.0(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.5(jiti@2.7.0))(typescript@5.9.3)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.2
|
||||
@@ -5794,6 +6028,22 @@ snapshots:
|
||||
- bare-buffer
|
||||
- react-native-b4a
|
||||
|
||||
archiver@8.0.0:
|
||||
dependencies:
|
||||
async: 3.2.6
|
||||
buffer-crc32: 1.0.0
|
||||
is-stream: 4.0.1
|
||||
lazystream: 1.0.1
|
||||
normalize-path: 3.0.0
|
||||
readable-stream: 4.7.0
|
||||
readdir-glob: 3.0.0
|
||||
tar-stream: 3.2.0
|
||||
zip-stream: 7.0.5
|
||||
transitivePeerDependencies:
|
||||
- bare-abort-controller
|
||||
- bare-buffer
|
||||
- react-native-b4a
|
||||
|
||||
argparse@2.0.1: {}
|
||||
|
||||
aria-query@5.3.0:
|
||||
@@ -6096,6 +6346,14 @@ snapshots:
|
||||
normalize-path: 3.0.0
|
||||
readable-stream: 4.7.0
|
||||
|
||||
compress-commons@7.0.1:
|
||||
dependencies:
|
||||
crc-32: 1.2.2
|
||||
crc32-stream: 7.0.1
|
||||
is-stream: 4.0.1
|
||||
normalize-path: 3.0.0
|
||||
readable-stream: 4.7.0
|
||||
|
||||
concat-map@0.0.1: {}
|
||||
|
||||
convert-source-map@2.0.0: {}
|
||||
@@ -6117,6 +6375,11 @@ snapshots:
|
||||
crc-32: 1.2.2
|
||||
readable-stream: 4.7.0
|
||||
|
||||
crc32-stream@7.0.1:
|
||||
dependencies:
|
||||
crc-32: 1.2.2
|
||||
readable-stream: 4.7.0
|
||||
|
||||
cross-spawn@7.0.6:
|
||||
dependencies:
|
||||
path-key: 3.1.1
|
||||
@@ -6132,6 +6395,44 @@ snapshots:
|
||||
|
||||
csstype@3.2.3: {}
|
||||
|
||||
d3-array@3.2.4:
|
||||
dependencies:
|
||||
internmap: 2.0.3
|
||||
|
||||
d3-color@3.1.0: {}
|
||||
|
||||
d3-ease@3.0.1: {}
|
||||
|
||||
d3-format@3.1.2: {}
|
||||
|
||||
d3-interpolate@3.0.1:
|
||||
dependencies:
|
||||
d3-color: 3.1.0
|
||||
|
||||
d3-path@3.1.0: {}
|
||||
|
||||
d3-scale@4.0.2:
|
||||
dependencies:
|
||||
d3-array: 3.2.4
|
||||
d3-format: 3.1.2
|
||||
d3-interpolate: 3.0.1
|
||||
d3-time: 3.1.0
|
||||
d3-time-format: 4.1.0
|
||||
|
||||
d3-shape@3.2.0:
|
||||
dependencies:
|
||||
d3-path: 3.1.0
|
||||
|
||||
d3-time-format@4.1.0:
|
||||
dependencies:
|
||||
d3-time: 3.1.0
|
||||
|
||||
d3-time@3.1.0:
|
||||
dependencies:
|
||||
d3-array: 3.2.4
|
||||
|
||||
d3-timer@3.0.1: {}
|
||||
|
||||
damerau-levenshtein@1.0.8: {}
|
||||
|
||||
data-urls@7.0.0(@noble/hashes@2.3.0):
|
||||
@@ -6167,6 +6468,8 @@ snapshots:
|
||||
dependencies:
|
||||
ms: 2.1.3
|
||||
|
||||
decimal.js-light@2.5.1: {}
|
||||
|
||||
decimal.js@10.6.0: {}
|
||||
|
||||
deep-is@0.1.4: {}
|
||||
@@ -6374,6 +6677,8 @@ snapshots:
|
||||
is-date-object: 1.1.0
|
||||
is-symbol: 1.1.1
|
||||
|
||||
es-toolkit@1.50.0: {}
|
||||
|
||||
esbuild@0.18.20:
|
||||
optionalDependencies:
|
||||
'@esbuild/android-arm': 0.18.20
|
||||
@@ -6672,6 +6977,8 @@ snapshots:
|
||||
|
||||
event-target-shim@5.0.1: {}
|
||||
|
||||
eventemitter3@5.0.4: {}
|
||||
|
||||
events-universal@1.0.1:
|
||||
dependencies:
|
||||
bare-events: 2.9.1
|
||||
@@ -6894,6 +7201,8 @@ snapshots:
|
||||
|
||||
ignore@7.0.6: {}
|
||||
|
||||
immer@11.1.16: {}
|
||||
|
||||
import-fresh@3.3.1:
|
||||
dependencies:
|
||||
parent-module: 1.0.1
|
||||
@@ -6911,6 +7220,8 @@ snapshots:
|
||||
hasown: 2.0.4
|
||||
side-channel: 1.1.1
|
||||
|
||||
internmap@2.0.3: {}
|
||||
|
||||
is-array-buffer@3.0.5:
|
||||
dependencies:
|
||||
call-bind: 1.0.9
|
||||
@@ -7009,6 +7320,8 @@ snapshots:
|
||||
|
||||
is-stream@2.0.1: {}
|
||||
|
||||
is-stream@4.0.1: {}
|
||||
|
||||
is-string@1.1.1:
|
||||
dependencies:
|
||||
call-bound: 1.0.4
|
||||
@@ -7658,6 +7971,15 @@ snapshots:
|
||||
|
||||
react-is@17.0.2: {}
|
||||
|
||||
react-redux@9.3.0(@types/react@19.2.18)(react@19.2.8)(redux@5.0.1):
|
||||
dependencies:
|
||||
'@types/use-sync-external-store': 0.0.6
|
||||
react: 19.2.8
|
||||
use-sync-external-store: 1.6.0(react@19.2.8)
|
||||
optionalDependencies:
|
||||
'@types/react': 19.2.18
|
||||
redux: 5.0.1
|
||||
|
||||
react@19.2.8: {}
|
||||
|
||||
readable-stream@2.3.8:
|
||||
@@ -7688,11 +8010,41 @@ snapshots:
|
||||
dependencies:
|
||||
minimatch: 5.1.9
|
||||
|
||||
readdir-glob@3.0.0:
|
||||
dependencies:
|
||||
minimatch: 10.2.6
|
||||
|
||||
recharts@3.10.1(@types/react@19.2.18)(react-dom@19.2.8(react@19.2.8))(react-is@17.0.2)(react@19.2.8)(redux@5.0.1):
|
||||
dependencies:
|
||||
'@reduxjs/toolkit': 2.12.0(react-redux@9.3.0(@types/react@19.2.18)(react@19.2.8)(redux@5.0.1))(react@19.2.8)
|
||||
clsx: 2.1.1
|
||||
decimal.js-light: 2.5.1
|
||||
es-toolkit: 1.50.0
|
||||
eventemitter3: 5.0.4
|
||||
immer: 11.1.16
|
||||
react: 19.2.8
|
||||
react-dom: 19.2.8(react@19.2.8)
|
||||
react-is: 17.0.2
|
||||
react-redux: 9.3.0(@types/react@19.2.18)(react@19.2.8)(redux@5.0.1)
|
||||
reselect: 5.2.0
|
||||
tiny-invariant: 1.3.3
|
||||
use-sync-external-store: 1.6.0(react@19.2.8)
|
||||
victory-vendor: 37.3.6
|
||||
transitivePeerDependencies:
|
||||
- '@types/react'
|
||||
- redux
|
||||
|
||||
redent@3.0.0:
|
||||
dependencies:
|
||||
indent-string: 4.0.0
|
||||
strip-indent: 3.0.0
|
||||
|
||||
redux-thunk@3.1.0(redux@5.0.1):
|
||||
dependencies:
|
||||
redux: 5.0.1
|
||||
|
||||
redux@5.0.1: {}
|
||||
|
||||
reflect.getprototypeof@1.0.10:
|
||||
dependencies:
|
||||
call-bind: 1.0.9
|
||||
@@ -7717,6 +8069,8 @@ snapshots:
|
||||
|
||||
require-from-string@2.0.2: {}
|
||||
|
||||
reselect@5.2.0: {}
|
||||
|
||||
resolve-from@4.0.0: {}
|
||||
|
||||
resolve-pkg-maps@1.0.0: {}
|
||||
@@ -8136,6 +8490,8 @@ snapshots:
|
||||
|
||||
tiny-inflate@1.0.3: {}
|
||||
|
||||
tiny-invariant@1.3.3: {}
|
||||
|
||||
tinybench@2.9.0: {}
|
||||
|
||||
tinyexec@1.3.0: {}
|
||||
@@ -8304,8 +8660,29 @@ snapshots:
|
||||
dependencies:
|
||||
punycode: 2.3.1
|
||||
|
||||
use-sync-external-store@1.6.0(react@19.2.8):
|
||||
dependencies:
|
||||
react: 19.2.8
|
||||
|
||||
util-deprecate@1.0.2: {}
|
||||
|
||||
victory-vendor@37.3.6:
|
||||
dependencies:
|
||||
'@types/d3-array': 3.2.2
|
||||
'@types/d3-ease': 3.0.2
|
||||
'@types/d3-interpolate': 3.0.4
|
||||
'@types/d3-scale': 4.0.9
|
||||
'@types/d3-shape': 3.1.8
|
||||
'@types/d3-time': 3.0.4
|
||||
'@types/d3-timer': 3.0.2
|
||||
d3-array: 3.2.4
|
||||
d3-ease: 3.0.1
|
||||
d3-interpolate: 3.0.1
|
||||
d3-scale: 4.0.2
|
||||
d3-shape: 3.2.0
|
||||
d3-time: 3.1.0
|
||||
d3-timer: 3.0.1
|
||||
|
||||
vite@8.2.1(@types/node@24.13.3)(esbuild@0.28.1)(jiti@2.7.0)(tsx@4.23.11)(yaml@2.9.0):
|
||||
dependencies:
|
||||
lightningcss: 1.33.0
|
||||
@@ -8475,6 +8852,12 @@ snapshots:
|
||||
compress-commons: 6.0.2
|
||||
readable-stream: 4.7.0
|
||||
|
||||
zip-stream@7.0.5:
|
||||
dependencies:
|
||||
compress-commons: 7.0.1
|
||||
normalize-path: 3.0.0
|
||||
readable-stream: 4.7.0
|
||||
|
||||
zod-validation-error@4.0.2(zod@4.4.3):
|
||||
dependencies:
|
||||
zod: 4.4.3
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
"use client";
|
||||
|
||||
import { useTheme } from "next-themes";
|
||||
import {
|
||||
Bar,
|
||||
BarChart,
|
||||
ResponsiveContainer,
|
||||
Tooltip,
|
||||
XAxis,
|
||||
YAxis,
|
||||
CartesianGrid,
|
||||
} from "recharts";
|
||||
|
||||
type DownloadsChartProps = {
|
||||
data: { date: string; downloads: number }[];
|
||||
};
|
||||
|
||||
export function DownloadsChart({ data }: DownloadsChartProps) {
|
||||
const { theme } = useTheme();
|
||||
|
||||
// Indigo primary color variables
|
||||
const primaryColor = theme === "dark" ? "#6366f1" : "#4f46e5"; // indigo-500 : indigo-600
|
||||
|
||||
return (
|
||||
<div className="h-[300px] w-full mt-4">
|
||||
{data.length === 0 ? (
|
||||
<div className="flex h-full items-center justify-center text-muted-foreground">
|
||||
Keine Download-Daten in den letzten 30 Tagen verfügbar.
|
||||
</div>
|
||||
) : (
|
||||
<ResponsiveContainer width="100%" height="100%">
|
||||
<BarChart data={data} margin={{ top: 10, right: 10, left: -20, bottom: 0 }}>
|
||||
<CartesianGrid strokeDasharray="3 3" vertical={false} stroke={theme === "dark" ? "#333" : "#e5e5e5"} />
|
||||
<XAxis
|
||||
dataKey="date"
|
||||
stroke="#888888"
|
||||
fontSize={12}
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
tickFormatter={(value) => {
|
||||
const date = new Date(value);
|
||||
return date.toLocaleDateString("de-DE", { day: "2-digit", month: "short" });
|
||||
}}
|
||||
/>
|
||||
<YAxis
|
||||
stroke="#888888"
|
||||
fontSize={12}
|
||||
tickLine={false}
|
||||
axisLine={false}
|
||||
tickFormatter={(value) => `${value}`}
|
||||
allowDecimals={false}
|
||||
/>
|
||||
<Tooltip
|
||||
cursor={{ fill: theme === "dark" ? "#ffffff10" : "#00000005" }}
|
||||
contentStyle={{
|
||||
backgroundColor: theme === "dark" ? "#1f2937" : "#ffffff",
|
||||
borderColor: theme === "dark" ? "#374151" : "#e5e7eb",
|
||||
borderRadius: "8px",
|
||||
color: theme === "dark" ? "#f3f4f6" : "#111827",
|
||||
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
||||
}}
|
||||
labelFormatter={(label: any) => {
|
||||
const date = new Date(label as string);
|
||||
return date.toLocaleDateString("de-DE", { weekday: 'long', day: '2-digit', month: 'long', year: 'numeric' });
|
||||
}}
|
||||
formatter={(value: any) => [value as number, "Downloads"]}
|
||||
/>
|
||||
<Bar
|
||||
dataKey="downloads"
|
||||
fill={primaryColor}
|
||||
radius={[4, 4, 0, 0]}
|
||||
maxBarSize={40}
|
||||
animationDuration={1000}
|
||||
/>
|
||||
</BarChart>
|
||||
</ResponsiveContainer>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { headers } from "next/headers";
|
||||
import Link from "next/link";
|
||||
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { DownloadsChart } from "./downloads-chart";
|
||||
|
||||
export default async function AdminDashboardPage() {
|
||||
await requireAdmin(new Headers(await headers()));
|
||||
@@ -47,6 +48,33 @@ export default async function AdminDashboardPage() {
|
||||
.orderBy(desc(sql`COUNT(${usages.id})`))
|
||||
.limit(5);
|
||||
|
||||
// 4. Time-series data for the last 30 days
|
||||
const thirtyDaysAgo = new Date();
|
||||
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
|
||||
|
||||
const dailyDownloads = await db
|
||||
.select({
|
||||
date: sql<string>`DATE_TRUNC('day', ${usages.createdAt})::date::text`,
|
||||
downloads: sql<number>`COUNT(${usages.id})::int`,
|
||||
})
|
||||
.from(usages)
|
||||
.where(gte(usages.createdAt, thirtyDaysAgo))
|
||||
.groupBy(sql`DATE_TRUNC('day', ${usages.createdAt})`)
|
||||
.orderBy(sql`DATE_TRUNC('day', ${usages.createdAt})`);
|
||||
|
||||
// Fill in missing days
|
||||
const chartData = [];
|
||||
for (let i = 29; i >= 0; i--) {
|
||||
const d = new Date();
|
||||
d.setDate(d.getDate() - i);
|
||||
const dateStr = d.toISOString().split('T')[0];
|
||||
const record = dailyDownloads.find(r => r.date === dateStr);
|
||||
chartData.push({
|
||||
date: dateStr,
|
||||
downloads: record ? record.downloads : 0,
|
||||
});
|
||||
}
|
||||
|
||||
const formatter = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" });
|
||||
|
||||
return (
|
||||
@@ -82,6 +110,16 @@ export default async function AdminDashboardPage() {
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Downloads der letzten 30 Tage</CardTitle>
|
||||
<CardDescription>Tägliche Nutzung des Bildarchivs über alle Redaktionen hinweg.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<DownloadsChart data={chartData} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { desc } from "drizzle-orm";
|
||||
|
||||
import Link from "next/link";
|
||||
import { db } from "@/db/client";
|
||||
import { editorialAccounts } from "@/db/schema";
|
||||
import { PageHeader } from "@/components/ui/page-header";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
|
||||
export default async function EditorialsPage() {
|
||||
const editorials = await db
|
||||
@@ -22,48 +24,88 @@ export default async function EditorialsPage() {
|
||||
const archivedEditorials = editorials.filter((e) => e.archivedAt);
|
||||
|
||||
return (
|
||||
<section className="content-section" aria-labelledby="editorials-title">
|
||||
<p className="eyebrow">Kontoverwaltung</p>
|
||||
<h1 id="editorials-title">Redaktionen</h1>
|
||||
<div className="space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500 max-w-7xl">
|
||||
<PageHeader
|
||||
kicker="Kontoverwaltung"
|
||||
title="Redaktionen"
|
||||
description="Verwalte hier alle registrierten und archivierten Redaktionszugänge."
|
||||
/>
|
||||
|
||||
{activeEditorials.length === 0 ? (
|
||||
<p>Noch keine aktiven Redaktionen registriert.</p>
|
||||
<p className="text-muted-foreground">Noch keine aktiven Redaktionen registriert.</p>
|
||||
) : (
|
||||
<ul>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{activeEditorials.map((editorial) => (
|
||||
<li key={editorial.id}>
|
||||
<a href={`/admin/redaktionen/${editorial.id}`}>{editorial.name}</a>
|
||||
<p>
|
||||
{editorial.contactName} · {editorial.loginEmail} · Status: {editorial.status}
|
||||
{editorial.currentPriceCents === null
|
||||
? " · Preis noch nicht festgelegt"
|
||||
: ` · Netto ${formatCents(editorial.currentPriceCents)}`}
|
||||
</p>
|
||||
</li>
|
||||
<Link key={editorial.id} href={`/admin/redaktionen/${editorial.id}`} className="block group">
|
||||
<Card className="h-full transition-all duration-300 hover:shadow-md hover:border-primary-500/50 hover:-translate-y-1">
|
||||
<CardContent className="p-6 flex flex-col h-full justify-between">
|
||||
<div>
|
||||
<h3 className="text-xl font-semibold mb-2 group-hover:text-primary-600 dark:group-hover:text-primary-400 transition-colors">
|
||||
{editorial.name}
|
||||
</h3>
|
||||
<div className="space-y-1 text-sm text-muted-foreground">
|
||||
<p className="flex items-center gap-2">
|
||||
<span className="font-medium text-foreground">Kontakt:</span> {editorial.contactName}
|
||||
</p>
|
||||
<p className="flex items-center gap-2">
|
||||
<span className="font-medium text-foreground">E-Mail:</span> {editorial.loginEmail}
|
||||
</p>
|
||||
<p className="flex items-center gap-2">
|
||||
<span className="font-medium text-foreground">Status:</span>
|
||||
<span className={`px-2 py-0.5 rounded-full text-xs font-medium ${
|
||||
editorial.status === "active" ? "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400" :
|
||||
editorial.status === "pending_approval" ? "bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400" :
|
||||
"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"
|
||||
}`}>
|
||||
{editorial.status === "active" ? "Aktiv" : editorial.status === "pending_approval" ? "Ausstehend" : "Gesperrt"}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-6 pt-4 border-t border-border">
|
||||
<p className="text-sm font-medium">
|
||||
{editorial.currentPriceCents === null
|
||||
? "Preis noch nicht festgelegt"
|
||||
: `Netto ${formatCents(editorial.currentPriceCents)}`}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{archivedEditorials.length > 0 && (
|
||||
<details className="mt-8">
|
||||
<summary className="cursor-pointer text-sm font-semibold text-gray-500 uppercase tracking-widest">
|
||||
<details className="mt-12 group">
|
||||
<summary className="cursor-pointer flex items-center gap-2 text-sm font-semibold uppercase tracking-widest text-muted-foreground hover:text-foreground transition-colors mb-6 list-none">
|
||||
<span className="bg-muted p-1 rounded-sm group-open:rotate-90 transition-transform">
|
||||
▶
|
||||
</span>
|
||||
Archivierte Redaktionen ({archivedEditorials.length})
|
||||
</summary>
|
||||
<ul className="mt-4 opacity-75">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 opacity-75 grayscale hover:grayscale-0 transition-all duration-500">
|
||||
{archivedEditorials.map((editorial) => (
|
||||
<li key={editorial.id}>
|
||||
<a href={`/admin/redaktionen/${editorial.id}`} className="text-gray-600">
|
||||
{editorial.name}
|
||||
</a>
|
||||
<p className="text-gray-500">
|
||||
{editorial.contactName} · {editorial.loginEmail} · Archiviert am:{" "}
|
||||
{editorial.archivedAt?.toLocaleDateString("de-DE")}
|
||||
</p>
|
||||
</li>
|
||||
<Link key={editorial.id} href={`/admin/redaktionen/${editorial.id}`} className="block group">
|
||||
<Card className="h-full transition-all duration-300 hover:shadow-sm">
|
||||
<CardContent className="p-6">
|
||||
<h3 className="text-lg font-semibold mb-2 text-muted-foreground group-hover:text-foreground transition-colors">
|
||||
{editorial.name}
|
||||
</h3>
|
||||
<div className="space-y-1 text-sm text-muted-foreground">
|
||||
<p>{editorial.contactName} · {editorial.loginEmail}</p>
|
||||
<p className="pt-2">
|
||||
Archiviert am: {editorial.archivedAt?.toLocaleDateString("de-DE")}
|
||||
</p>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</details>
|
||||
)}
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,17 @@ import { expect, test, vi } from "vitest";
|
||||
import { PrincipalAuthorizationError } from "@/modules/auth/principal";
|
||||
import { createThumbnailHandler } from "./thumbnail-handler";
|
||||
|
||||
vi.mock("sharp", () => {
|
||||
return {
|
||||
default: () => ({
|
||||
metadata: vi.fn().mockResolvedValue({ width: 100, height: 100 }),
|
||||
composite: vi.fn().mockReturnThis(),
|
||||
webp: vi.fn().mockReturnThis(),
|
||||
toBuffer: vi.fn().mockResolvedValue(Buffer.from(new Uint8Array([1, 2, 3]))),
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
const grantedAlbum = {
|
||||
id: "allowed",
|
||||
albumName: "Freigegebenes Heimspiel",
|
||||
@@ -42,9 +53,15 @@ function createHandler(options?: {
|
||||
requireAdmin: vi.fn().mockResolvedValue({ userId: "admin-1" }),
|
||||
getGrantedAlbumIds: vi.fn().mockResolvedValue(options?.grantedAlbumIds ?? ["allowed"]),
|
||||
immich: {
|
||||
listAlbumsForAsset: vi.fn().mockImplementation(async () => {
|
||||
getAsset: vi.fn().mockImplementation(async () => {
|
||||
if (options?.assetAlbumLookupError) throw options.assetAlbumLookupError;
|
||||
return (options?.assetAlbumIds ?? ["allowed"]).map((id) => ({ id }));
|
||||
return {
|
||||
id: "asset-1",
|
||||
originalFileName: "foo.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
type: "IMAGE",
|
||||
albums: (options?.assetAlbumIds ?? ["allowed"]).map((id) => ({ id })),
|
||||
};
|
||||
}),
|
||||
getAlbum: vi.fn().mockImplementation(async () => {
|
||||
return {
|
||||
@@ -88,7 +105,7 @@ test("refuses a thumbnail immediately after its last grant is revoked", async ()
|
||||
const response = await call(handler);
|
||||
|
||||
expect(response.status).toBe(404);
|
||||
expect(dependencies.immich.listAlbumsForAsset).not.toHaveBeenCalled();
|
||||
expect(dependencies.immich.getAsset).not.toHaveBeenCalled();
|
||||
expect(dependencies.immich.getAlbum).not.toHaveBeenCalled();
|
||||
expect(dependencies.immich.getThumbnail).not.toHaveBeenCalled();
|
||||
});
|
||||
@@ -147,8 +164,8 @@ test("uses one asset-album membership lookup for a 60-photo gallery regardless o
|
||||
const response = await call(handler);
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(dependencies.immich.listAlbumsForAsset).toHaveBeenCalledTimes(1);
|
||||
expect(dependencies.immich.listAlbumsForAsset).toHaveBeenCalledWith("asset-1");
|
||||
expect(dependencies.immich.getAsset).toHaveBeenCalledTimes(1);
|
||||
expect(dependencies.immich.getAsset).toHaveBeenCalledWith("asset-1");
|
||||
expect(dependencies.immich.getAlbum).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ type ThumbnailRouteContext = Readonly<{ params: Promise<{ assetId: string }> }>;
|
||||
type ThumbnailImmich = {
|
||||
listAlbumsForAsset(assetId: string): Promise<Array<{ id: string }>>;
|
||||
getAlbum(albumId: string): Promise<{ albumThumbnailAssetId: string | null }>;
|
||||
getAsset(assetId: string): Promise<{ albums: Array<{ id: string }> }>;
|
||||
getThumbnail(assetId: string): Promise<ImmichBinary>;
|
||||
};
|
||||
|
||||
@@ -83,7 +84,8 @@ async function isGrantedEditorialAsset(
|
||||
return false;
|
||||
}
|
||||
|
||||
const assetAlbums = await dependencies.immich.listAlbumsForAsset(assetId);
|
||||
const asset = await dependencies.immich.getAsset(assetId);
|
||||
const assetAlbums = asset.albums;
|
||||
const granted = new Set(grantedAlbumIds);
|
||||
return assetAlbums.some((album) => granted.has(album.id));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
import { NextRequest } from "next/server";
|
||||
import { requireActiveEditorial } from "@/modules/auth/principal";
|
||||
import { usageService } from "@/modules/usages/service";
|
||||
import { immichClient } from "@/modules/immich/client";
|
||||
import { downloadDeliveryRepository } from "@/modules/downloads/stream";
|
||||
import { albumGrantService } from "@/modules/albums/grants";
|
||||
const archiver = require("archiver");
|
||||
import { Readable } from "stream";
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const principal = await requireActiveEditorial(request.headers);
|
||||
const { assetIds, purpose } = await request.json();
|
||||
|
||||
if (!Array.isArray(assetIds) || assetIds.length === 0 || !purpose) {
|
||||
return new Response("Invalid request", { status: 400 });
|
||||
}
|
||||
|
||||
const grantedAlbumIds = await albumGrantService.getGrantedAlbumIds(principal.editorialId);
|
||||
const grantedSet = new Set(grantedAlbumIds);
|
||||
|
||||
const downloadsToProcess: { assetId: string, downloadId: string, filename: string, intentKind: "new_usage" | "repeat" }[] = [];
|
||||
|
||||
for (const assetId of assetIds) {
|
||||
// 1. Fetch asset to find its albums
|
||||
let asset;
|
||||
try {
|
||||
asset = await immichClient.getAsset(assetId);
|
||||
} catch (err) {
|
||||
console.error("Asset fetch failed", assetId, err);
|
||||
continue; // Skip unavailable assets
|
||||
}
|
||||
|
||||
// 2. Find the first album the editorial has access to
|
||||
const validAlbum = asset.albums.find(a => grantedSet.has(a.id));
|
||||
if (!validAlbum) continue; // Editorial does not have access
|
||||
|
||||
// 3. Check for prior usages to avoid double charging
|
||||
const priorUsages = await usageService.listPriorUsages(principal.editorialId, assetId);
|
||||
const isRepeat = priorUsages.length > 0;
|
||||
|
||||
// 4. Create new usage (or repeat download if prior usages exist)
|
||||
// Since createNewUsage handles idempotent repeats automatically, we just need to pass an idempotency key.
|
||||
const idempotencyKey = `${principal.editorialId}-${assetId}-${purpose}`;
|
||||
|
||||
const newUsage = await usageService.createNewUsage({
|
||||
editorialId: principal.editorialId,
|
||||
assetId,
|
||||
albumId: validAlbum.id,
|
||||
purpose,
|
||||
reference: undefined,
|
||||
idempotencyKey,
|
||||
});
|
||||
|
||||
downloadsToProcess.push({
|
||||
assetId,
|
||||
downloadId: newUsage.id,
|
||||
filename: asset.originalFileName,
|
||||
intentKind: isRepeat ? "repeat" : "new_usage",
|
||||
});
|
||||
}
|
||||
|
||||
if (downloadsToProcess.length === 0) {
|
||||
return new Response("No valid assets found for download", { status: 404 });
|
||||
}
|
||||
|
||||
// Create a streaming response with archiver
|
||||
const archive = archiver('zip', { zlib: { level: 0 } }); // No compression, images are already compressed
|
||||
|
||||
// We must return a ReadableStream to Next.js
|
||||
const transformStream = new TransformStream();
|
||||
|
||||
// Pipe archiver output to the writable side of the TransformStream
|
||||
const writableNodeStream = new WritableStreamToNodeStream(transformStream.writable);
|
||||
archive.pipe(writableNodeStream);
|
||||
|
||||
// Start appending files asynchronously
|
||||
(async () => {
|
||||
for (const download of downloadsToProcess) {
|
||||
// Claim the download to verify it's authorized
|
||||
const claim = await downloadDeliveryRepository.claimAuthorized(principal.editorialId, download.downloadId);
|
||||
if (claim.outcome !== "claimed") continue;
|
||||
|
||||
try {
|
||||
const original = await immichClient.getOriginal(download.assetId);
|
||||
|
||||
// Track bytes read for accounting
|
||||
let transferredBytes = 0;
|
||||
const trackingTransform = new TransformStream({
|
||||
transform(chunk, controller) {
|
||||
transferredBytes += chunk.length;
|
||||
controller.enqueue(chunk);
|
||||
},
|
||||
async flush() {
|
||||
await downloadDeliveryRepository.markCompleted(download.downloadId, transferredBytes);
|
||||
}
|
||||
});
|
||||
|
||||
const trackedStream = original.body.pipeThrough(trackingTransform);
|
||||
const nodeStream = Readable.fromWeb(trackedStream as any);
|
||||
|
||||
archive.append(nodeStream, { name: download.filename });
|
||||
} catch (err) {
|
||||
console.error("Failed to append original for asset", download.assetId, err);
|
||||
await downloadDeliveryRepository.failBeforeDelivery(download.downloadId, {
|
||||
voidNewUsage: download.intentKind === "new_usage"
|
||||
});
|
||||
}
|
||||
}
|
||||
archive.finalize();
|
||||
})();
|
||||
|
||||
const date = new Date().toISOString().split('T')[0];
|
||||
return new Response(transformStream.readable, {
|
||||
headers: {
|
||||
"Content-Type": "application/zip",
|
||||
"Content-Disposition": `attachment; filename="leuchtkasten-${date}.zip"`,
|
||||
},
|
||||
});
|
||||
|
||||
} catch (err) {
|
||||
console.error("Bulk download failed", err);
|
||||
return new Response("Internal Server Error", { status: 500 });
|
||||
}
|
||||
}
|
||||
|
||||
// Helper to convert Web WritableStream to Node Writable Stream
|
||||
import { Writable } from "stream";
|
||||
class WritableStreamToNodeStream extends Writable {
|
||||
private writer: WritableStreamDefaultWriter<any>;
|
||||
|
||||
constructor(writableStream: WritableStream) {
|
||||
super();
|
||||
this.writer = writableStream.getWriter();
|
||||
}
|
||||
|
||||
_write(chunk: any, encoding: string, callback: (error?: Error | null) => void) {
|
||||
this.writer.write(chunk).then(() => callback()).catch(callback);
|
||||
}
|
||||
|
||||
_final(callback: (error?: Error | null) => void) {
|
||||
this.writer.close().then(() => callback()).catch(callback);
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,110 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useState, useRef } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
export function DownloadLightboxForm({ assetIds }: { assetIds: string[] }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const dialogRef = useRef<HTMLDialogElement>(null);
|
||||
const [purpose, setPurpose] = useState("");
|
||||
const router = useRouter();
|
||||
|
||||
function handleBulkDownload() {
|
||||
alert("Bulk-Download ist aktuell in Entwicklung. Bitte klicke auf die Bilder, um sie einzeln herunterzuladen.");
|
||||
async function handleBulkDownload(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
if (!purpose.trim() || assetIds.length === 0) return;
|
||||
|
||||
setLoading(true);
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/lightbox/bulk-download", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ assetIds, purpose }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Download fehlgeschlagen");
|
||||
}
|
||||
|
||||
// Download the ZIP file
|
||||
const blob = await response.blob();
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `leuchtkasten-${new Date().toISOString().split("T")[0]}.zip`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
dialogRef.current?.close();
|
||||
setPurpose("");
|
||||
router.refresh(); // Refresh to update usage history
|
||||
} catch (err) {
|
||||
alert("Es gab einen Fehler beim Bulk-Download. Bitte versuche es später erneut.");
|
||||
console.error(err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleBulkDownload}
|
||||
disabled={loading || assetIds.length === 0}
|
||||
className="primary-action m-0"
|
||||
>
|
||||
Alle herunterladen
|
||||
</button>
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => dialogRef.current?.showModal()}
|
||||
disabled={assetIds.length === 0}
|
||||
className="primary-action m-0"
|
||||
>
|
||||
Alle herunterladen
|
||||
</button>
|
||||
|
||||
<dialog ref={dialogRef} className="rounded-xl p-0 backdrop:bg-black/50 shadow-2xl border border-border bg-card text-card-foreground overflow-hidden max-w-md w-full">
|
||||
<div className="p-6">
|
||||
<h2 className="text-xl font-bold mb-4">Verwendungszweck angeben</h2>
|
||||
<p className="text-sm text-muted-foreground mb-6">
|
||||
Bitte gib einen gemeinsamen Verwendungszweck für alle {assetIds.length} Bilder an. Diese werden in einem ZIP-Archiv heruntergeladen.
|
||||
</p>
|
||||
|
||||
<form onSubmit={handleBulkDownload}>
|
||||
<div className="space-y-4">
|
||||
<div>
|
||||
<label htmlFor="purpose" className="block text-sm font-medium mb-1">
|
||||
Verwendungszweck
|
||||
</label>
|
||||
<input
|
||||
id="purpose"
|
||||
type="text"
|
||||
required
|
||||
placeholder="z.B. Webseite, Social Media"
|
||||
value={purpose}
|
||||
onChange={(e) => setPurpose(e.target.value)}
|
||||
className="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50"
|
||||
disabled={loading}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-8 flex justify-end gap-3">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => dialogRef.current?.close()}
|
||||
className="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"
|
||||
disabled={loading}
|
||||
>
|
||||
Abbrechen
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
className="inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2"
|
||||
disabled={loading || !purpose.trim()}
|
||||
>
|
||||
{loading ? "Wird verpackt..." : "Download starten (ZIP)"}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import React from "react";
|
||||
|
||||
type PageHeaderProps = {
|
||||
kicker: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
export function PageHeader({ kicker, title, description }: PageHeaderProps) {
|
||||
return (
|
||||
<div className="editorial-section">
|
||||
<p className="editorial-kicker text-sm font-semibold text-muted-foreground tracking-widest uppercase mb-2">{kicker}</p>
|
||||
<div className="editorial-title-row mb-6">
|
||||
<h1 className="text-4xl font-bold tracking-tight text-foreground">{title}</h1>
|
||||
</div>
|
||||
{description && (
|
||||
<p className="text-lg text-muted-foreground max-w-3xl mb-8">
|
||||
{description}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -92,22 +92,15 @@ function createRepository() {
|
||||
function createService() {
|
||||
const state = createRepository();
|
||||
const immich = {
|
||||
listAlbumsForAsset: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
description: null,
|
||||
albumThumbnailAssetId: assetId,
|
||||
assetCount: 1,
|
||||
},
|
||||
]),
|
||||
getAlbum: vi.fn().mockResolvedValue({
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
}),
|
||||
getAsset: vi.fn().mockResolvedValue({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
localDateTime: null,
|
||||
fileCreatedAt: null,
|
||||
albums: [{ id: albumId }],
|
||||
}),
|
||||
};
|
||||
@@ -231,63 +224,63 @@ test.each([
|
||||
}),
|
||||
).rejects.toMatchObject({ code });
|
||||
expect(findIntent).not.toHaveBeenCalled();
|
||||
expect(immich.listAlbumsForAsset).not.toHaveBeenCalled();
|
||||
expect(immich.getAsset).not.toHaveBeenCalled();
|
||||
expect(immich.getAlbum).not.toHaveBeenCalled();
|
||||
},
|
||||
);
|
||||
|
||||
test("rejects an asset outside the exact requested album", async () => {
|
||||
const { service, immich, usages } = createService();
|
||||
immich.listAlbumsForAsset.mockResolvedValue([
|
||||
{
|
||||
id: otherAlbumId,
|
||||
albumName: "Andere Bilder",
|
||||
description: null,
|
||||
albumThumbnailAssetId: null,
|
||||
assetCount: 1,
|
||||
},
|
||||
]);
|
||||
immich.getAsset.mockResolvedValue({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [{ id: otherAlbumId }],
|
||||
});
|
||||
|
||||
await expect(service.createNewUsage(newUsageInput)).rejects.toMatchObject({
|
||||
code: "ASSET_NOT_IN_ALBUM",
|
||||
});
|
||||
expect(immich.getAsset).not.toHaveBeenCalled();
|
||||
expect(immich.getAlbum).not.toHaveBeenCalled();
|
||||
expect(usages).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("rejects removal from the requested album between preflight and locked refresh", async () => {
|
||||
const { service, immich, usages } = createService();
|
||||
immich.listAlbumsForAsset
|
||||
.mockResolvedValueOnce([
|
||||
{
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
description: null,
|
||||
albumThumbnailAssetId: assetId,
|
||||
assetCount: 1,
|
||||
},
|
||||
])
|
||||
.mockResolvedValueOnce([]);
|
||||
immich.getAsset
|
||||
.mockResolvedValueOnce({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [{ id: albumId }],
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [],
|
||||
});
|
||||
|
||||
await expect(service.createNewUsage(newUsageInput)).rejects.toMatchObject({
|
||||
code: "ASSET_NOT_IN_ALBUM",
|
||||
});
|
||||
expect(immich.listAlbumsForAsset).toHaveBeenCalledTimes(2);
|
||||
expect(immich.getAsset).toHaveBeenCalledTimes(2);
|
||||
expect(usages).toHaveLength(0);
|
||||
});
|
||||
|
||||
test("persists metadata from the locked final Immich refresh", async () => {
|
||||
const { service, immich, usages } = createService();
|
||||
immich.listAlbumsForAsset
|
||||
.mockResolvedValueOnce([
|
||||
{
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
description: null,
|
||||
albumThumbnailAssetId: assetId,
|
||||
assetCount: 1,
|
||||
},
|
||||
])
|
||||
immich.getAsset
|
||||
.mockResolvedValueOnce({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [{ id: albumId }],
|
||||
})
|
||||
.mockResolvedValueOnce([
|
||||
{
|
||||
id: albumId,
|
||||
|
||||
@@ -57,11 +57,13 @@ export type UsageRepository = {
|
||||
};
|
||||
|
||||
type UsageImmich = {
|
||||
listAlbumsForAsset(assetId: string): Promise<ImmichAlbumSummary[]>;
|
||||
getAlbum(albumId: string): Promise<{ id: string; albumName: string }>;
|
||||
getAsset(assetId: string): Promise<{
|
||||
id: string;
|
||||
type: string;
|
||||
originalFileName: string;
|
||||
originalMimeType: string;
|
||||
type: string;
|
||||
albums: Array<{ id: string }>;
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -330,15 +332,25 @@ async function loadRequestedAlbum(
|
||||
immich: UsageImmich,
|
||||
assetId: string,
|
||||
albumId: string,
|
||||
): Promise<ImmichAlbumSummary> {
|
||||
let albums: ImmichAlbumSummary[];
|
||||
): Promise<{ id: string; albumName: string }> {
|
||||
let asset;
|
||||
try {
|
||||
albums = await immich.listAlbumsForAsset(assetId);
|
||||
asset = await immich.getAsset(assetId);
|
||||
} catch {
|
||||
throw new UsageAccountingError("IMMICH_UNAVAILABLE");
|
||||
}
|
||||
const album = albums.find((candidate) => candidate.id === albumId);
|
||||
if (!album) throw new UsageAccountingError("ASSET_NOT_IN_ALBUM");
|
||||
|
||||
if (!asset.albums.some((a) => a.id === albumId)) {
|
||||
throw new UsageAccountingError("ASSET_NOT_IN_ALBUM");
|
||||
}
|
||||
|
||||
let album;
|
||||
try {
|
||||
album = await immich.getAlbum(albumId);
|
||||
} catch {
|
||||
throw new UsageAccountingError("IMMICH_UNAVAILABLE");
|
||||
}
|
||||
|
||||
return album;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,12 +44,6 @@ const asset = {
|
||||
|
||||
function createServices() {
|
||||
const immich = {
|
||||
listAlbumsForAsset: vi.fn().mockResolvedValue([
|
||||
{
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
description: null,
|
||||
albumThumbnailAssetId: assetId,
|
||||
assetCount: 1,
|
||||
},
|
||||
]),
|
||||
|
||||
Reference in new issue
Block a user