-
-
-
-
- {#each paginationItems as item}
- {#if typeof item === 'number'}
-
-
-
- {:else}
-
...
- {/if}
- {/each}
-
-
-
-
+
{/if}
diff --git a/packages/frontend/src/routes/dashboard/search/+page.svelte b/packages/frontend/src/routes/dashboard/search/+page.svelte
index 4fd539b..34df5df 100644
--- a/packages/frontend/src/routes/dashboard/search/+page.svelte
+++ b/packages/frontend/src/routes/dashboard/search/+page.svelte
@@ -17,6 +17,9 @@
import CircleAlertIcon from '@lucide/svelte/icons/circle-alert';
import * as Alert from '$lib/components/ui/alert/index.js';
import { t } from '$lib/translations';
+ import * as Pagination from '$lib/components/ui/pagination/index.js';
+ import ChevronLeft from 'lucide-svelte/icons/chevron-left';
+ import ChevronRight from 'lucide-svelte/icons/chevron-right';
let { data }: { data: PageData } = $props();
let searchResult = $derived(data.searchResult);
@@ -121,55 +124,6 @@
return snippets;
}
-
- const getPaginationItems = (currentPage: number, totalPages: number, siblingCount = 1) => {
- const totalPageNumbers = siblingCount + 5;
-
- if (totalPages <= totalPageNumbers) {
- return Array.from({ length: totalPages }, (_, i) => i + 1);
- }
-
- const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
- const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
-
- const shouldShowLeftDots = leftSiblingIndex > 2;
- const shouldShowRightDots = rightSiblingIndex < totalPages - 2;
-
- const firstPageIndex = 1;
- const lastPageIndex = totalPages;
-
- if (!shouldShowLeftDots && shouldShowRightDots) {
- let leftItemCount = 3 + 2 * siblingCount;
- let leftRange = Array.from({ length: leftItemCount }, (_, i) => i + 1);
- return [...leftRange, '...', totalPages];
- }
-
- if (shouldShowLeftDots && !shouldShowRightDots) {
- let rightItemCount = 3 + 2 * siblingCount;
- let rightRange = Array.from(
- { length: rightItemCount },
- (_, i) => totalPages - rightItemCount + i + 1
- );
- return [firstPageIndex, '...', ...rightRange];
- }
-
- if (shouldShowLeftDots && shouldShowRightDots) {
- let middleRange = Array.from(
- { length: rightSiblingIndex - leftSiblingIndex + 1 },
- (_, i) => leftSiblingIndex + i
- );
- return [firstPageIndex, '...', ...middleRange, '...', lastPageIndex];
- }
-
- return [];
- };
-
- let paginationItems = $derived(
- getPaginationItems(
- page,
- Math.ceil((searchResult?.total || 0) / (searchResult?.limit || 10))
- )
- );
@@ -336,42 +290,57 @@
{#if searchResult.total > searchResult.limit}
-
-
-
-
-
- {#each paginationItems as item}
- {#if typeof item === 'number'}
-
-
-
- {:else}
-
...
- {/if}
- {/each}
-
-
-
-
+
{/if}
{/if}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 71c7dee..2bb8071 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -83,12 +83,6 @@ importers:
'@azure/msal-node':
specifier: ^3.6.3
version: 3.6.3
- '@bull-board/api':
- specifier: ^6.13.0
- version: 6.13.0(@bull-board/ui@6.13.0)
- '@bull-board/express':
- specifier: ^6.13.0
- version: 6.13.0
'@casl/ability':
specifier: ^6.7.3
version: 6.7.3
@@ -283,9 +277,6 @@ importers:
'@sveltejs/kit':
specifier: ^2.38.1
version: 2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1))
- bits-ui:
- specifier: ^2.8.10
- version: 2.8.10(@internationalized/date@3.8.2)(svelte@5.35.5)
clsx:
specifier: ^2.1.1
version: 2.1.1
@@ -324,8 +315,8 @@ importers:
specifier: ^3.8.2
version: 3.8.2
'@lucide/svelte':
- specifier: ^0.515.0
- version: 0.515.0(svelte@5.35.5)
+ specifier: ^0.544.0
+ version: 0.544.0(svelte@5.35.5)
'@sveltejs/adapter-auto':
specifier: ^6.0.0
version: 6.0.1(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))
@@ -344,6 +335,9 @@ importers:
'@types/semver':
specifier: ^7.7.1
version: 7.7.1
+ bits-ui:
+ specifier: ^2.12.0
+ version: 2.12.0(@internationalized/date@3.8.2)(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)
dotenv:
specifier: ^17.2.0
version: 17.2.0
@@ -652,17 +646,6 @@ packages:
resolution: {integrity: sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==}
engines: {node: '>=6.9.0'}
- '@bull-board/api@6.13.0':
- resolution: {integrity: sha512-GZ0On0VeL5uZVS1x7UdU90F9GV1kdmHa1955hW3Ow1PmslCY/2YwmvnapVdbvCUSVBqluTfbVZsE9X3h79r1kw==}
- peerDependencies:
- '@bull-board/ui': 6.13.0
-
- '@bull-board/express@6.13.0':
- resolution: {integrity: sha512-PAbzD3dplV2NtN8ETs00bp++pBOD+cVb1BEYltXrjyViA2WluDBVKdlh/2wM+sHbYO2TAMNg8bUtKxGNCmxG7w==}
-
- '@bull-board/ui@6.13.0':
- resolution: {integrity: sha512-63I6b3nZnKWI5ok6mw/Tk2rIObuzMTY/tLGyO51p0GW4rAImdXxrK6mT7j4SgEuP2B+tt/8L1jU7sLu8MMcCNw==}
-
'@casl/ability@6.7.3':
resolution: {integrity: sha512-A4L28Ko+phJAsTDhRjzCOZWECQWN2jzZnJPnROWWHjJpyMq1h7h9ZqjwS2WbIUa3Z474X1ZPSgW0f1PboZGC0A==}
@@ -1205,8 +1188,8 @@ packages:
'@layerstack/utils@2.0.0-next.12':
resolution: {integrity: sha512-fhGZUlSr3N+D44BYm37WKMGSEFyZBW+dwIqtGU8Cl54mR4TLQ/UwyGhdpgIHyH/x/8q1abE0fP0Dn6ZsrDE3BA==}
- '@lucide/svelte@0.515.0':
- resolution: {integrity: sha512-CEAyqcZmNBfYzVgaRmK2RFJP5tnbXxekRyDk0XX/eZQRfsJmkDvmQwXNX8C869BgNeryzmrRyjHhUL6g9ZOHNA==}
+ '@lucide/svelte@0.544.0':
+ resolution: {integrity: sha512-9f9O6uxng2pLB01sxNySHduJN3HTl5p0HDu4H26VR51vhZfiMzyOMe9Mhof3XAk4l813eTtl+/DYRvGyoRR+yw==}
peerDependencies:
svelte: ^5
@@ -2176,8 +2159,8 @@ packages:
birpc@2.5.0:
resolution: {integrity: sha512-VSWO/W6nNQdyP520F1mhf+Lc2f8pjGQOtoHHm7Ze8Go1kX7akpVIrtTa0fn+HB0QJEDVacl6aO08YE0PgXfdnQ==}
- bits-ui@2.8.10:
- resolution: {integrity: sha512-MOobkqapDZNrpcNmeL2g664xFmH4tZBOKBTxFmsQYMZQuybSZHQnPXy+AjM5XZEXRmCFx5+XRmo6+fC3vHh1hQ==}
+ bits-ui@2.12.0:
+ resolution: {integrity: sha512-8NF4ILNyAJlIxDXpl/akGXGBV5QmZAe+8gTfPttM5P6/+LrijumcSfFXY5cr4QkXwTmLA7H5stYpbgJf2XFJvg==}
engines: {node: '>=20'}
peerDependencies:
'@internationalized/date': ^3.8.1
@@ -2726,11 +2709,6 @@ packages:
ee-first@1.1.1:
resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
- ejs@3.1.10:
- resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==}
- engines: {node: '>=0.10.0'}
- hasBin: true
-
emoji-regex-xs@1.0.0:
resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==}
@@ -2886,9 +2864,6 @@ packages:
file-uri-to-path@1.0.0:
resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==}
- filelist@1.0.4:
- resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==}
-
fill-range@7.1.1:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
@@ -3217,11 +3192,6 @@ packages:
jackspeak@3.4.3:
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
- jake@10.9.2:
- resolution: {integrity: sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==}
- engines: {node: '>=10'}
- hasBin: true
-
jiti@2.4.2:
resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==}
hasBin: true
@@ -3416,6 +3386,10 @@ packages:
resolution: {integrity: sha512-RkRWjA926cTvz5rAb1BqyWkKbbjzCGchDUIKMCUvNi17j6f6j8uHGDV82Aqcqtzd+icoYpELmG3ksgGiFNNcNg==}
engines: {node: '>=12'}
+ lz-string@1.5.0:
+ resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==}
+ hasBin: true
+
magic-string@0.30.17:
resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}
@@ -4017,9 +3991,6 @@ packages:
resolution: {integrity: sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==}
engines: {node: '>=4'}
- redis-info@3.1.0:
- resolution: {integrity: sha512-ER4L9Sh/vm63DkIE0bkSjxluQlioBiBgf5w1UuldaW/3vPcecdljVDisZhmnCMvsxHNiARTTDDHGg9cGwTfrKg==}
-
redis-parser@3.0.0:
resolution: {integrity: sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==}
engines: {node: '>=4'}
@@ -4092,10 +4063,14 @@ packages:
peerDependencies:
svelte: ^5.7.0
- runed@0.29.2:
- resolution: {integrity: sha512-0cq6cA6sYGZwl/FvVqjx9YN+1xEBu9sDDyuWdDW1yWX7JF2wmvmVKfH+hVCZs+csW+P3ARH92MjI3H9QTagOQA==}
+ runed@0.35.1:
+ resolution: {integrity: sha512-2F4Q/FZzbeJTFdIS/PuOoPRSm92sA2LhzTnv6FXhCoENb3huf5+fDuNOg1LNvGOouy3u/225qxmuJvcV3IZK5Q==}
peerDependencies:
+ '@sveltejs/kit': ^2.21.0
svelte: ^5.7.0
+ peerDependenciesMeta:
+ '@sveltejs/kit':
+ optional: true
rw@1.3.3:
resolution: {integrity: sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==}
@@ -4351,18 +4326,18 @@ packages:
peerDependencies:
svelte: ^5.0.0
+ svelte-toolbelt@0.10.6:
+ resolution: {integrity: sha512-YWuX+RE+CnWYx09yseAe4ZVMM7e7GRFZM6OYWpBKOb++s+SQ8RBIMMe+Bs/CznBMc0QPLjr+vDBxTAkozXsFXQ==}
+ engines: {node: '>=18', pnpm: '>=8.7.0'}
+ peerDependencies:
+ svelte: ^5.30.2
+
svelte-toolbelt@0.7.1:
resolution: {integrity: sha512-HcBOcR17Vx9bjaOceUvxkY3nGmbBmCBBbuWLLEWO6jtmWH8f/QoWmbyUfQZrpDINH39en1b8mptfPQT9VKQ1xQ==}
engines: {node: '>=18', pnpm: '>=8.7.0'}
peerDependencies:
svelte: ^5.0.0
- svelte-toolbelt@0.9.3:
- resolution: {integrity: sha512-HCSWxCtVmv+c6g1ACb8LTwHVbDqLKJvHpo6J8TaqwUme2hj9ATJCpjCPNISR1OCq2Q4U1KT41if9ON0isINQZw==}
- engines: {node: '>=18', pnpm: '>=8.7.0'}
- peerDependencies:
- svelte: ^5.30.2
-
svelte@5.35.5:
resolution: {integrity: sha512-KuRvI82rhh0RMz1EKsUJD96gZyHJ+h2+8zrwO8iqE/p/CmcNKvIItDUAeUePhuCDgtegDJmF8IKThbHIfmTgTA==}
engines: {node: '>=18'}
@@ -5367,24 +5342,6 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
- '@bull-board/api@6.13.0(@bull-board/ui@6.13.0)':
- dependencies:
- '@bull-board/ui': 6.13.0
- redis-info: 3.1.0
-
- '@bull-board/express@6.13.0':
- dependencies:
- '@bull-board/api': 6.13.0(@bull-board/ui@6.13.0)
- '@bull-board/ui': 6.13.0
- ejs: 3.1.10
- express: 5.1.0
- transitivePeerDependencies:
- - supports-color
-
- '@bull-board/ui@6.13.0':
- dependencies:
- '@bull-board/api': 6.13.0(@bull-board/ui@6.13.0)
-
'@casl/ability@6.7.3':
dependencies:
'@ucast/mongo2js': 1.4.0
@@ -5738,7 +5695,7 @@ snapshots:
d3-time-format: 4.1.0
lodash-es: 4.17.21
- '@lucide/svelte@0.515.0(svelte@5.35.5)':
+ '@lucide/svelte@0.544.0(svelte@5.35.5)':
dependencies:
svelte: 5.35.5
@@ -6805,16 +6762,18 @@ snapshots:
birpc@2.5.0: {}
- bits-ui@2.8.10(@internationalized/date@3.8.2)(svelte@5.35.5):
+ bits-ui@2.12.0(@internationalized/date@3.8.2)(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5):
dependencies:
'@floating-ui/core': 1.7.2
'@floating-ui/dom': 1.7.2
'@internationalized/date': 3.8.2
esm-env: 1.2.2
- runed: 0.29.2(svelte@5.35.5)
+ runed: 0.35.1(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)
svelte: 5.35.5
- svelte-toolbelt: 0.9.3(svelte@5.35.5)
+ svelte-toolbelt: 0.10.6(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)
tabbable: 6.2.0
+ transitivePeerDependencies:
+ - '@sveltejs/kit'
bl@4.1.0:
dependencies:
@@ -7293,10 +7252,6 @@ snapshots:
ee-first@1.1.1: {}
- ejs@3.1.10:
- dependencies:
- jake: 10.9.2
-
emoji-regex-xs@1.0.0: {}
emoji-regex@8.0.0: {}
@@ -7518,10 +7473,6 @@ snapshots:
file-uri-to-path@1.0.0: {}
- filelist@1.0.4:
- dependencies:
- minimatch: 5.1.6
-
fill-range@7.1.1:
dependencies:
to-regex-range: 5.0.1
@@ -7917,13 +7868,6 @@ snapshots:
optionalDependencies:
'@pkgjs/parseargs': 0.11.0
- jake@10.9.2:
- dependencies:
- async: 3.2.6
- chalk: 4.1.2
- filelist: 1.0.4
- minimatch: 3.1.2
-
jiti@2.4.2: {}
jose@6.0.11: {}
@@ -8128,6 +8072,8 @@ snapshots:
luxon@3.7.1: {}
+ lz-string@1.5.0: {}
+
magic-string@0.30.17:
dependencies:
'@jridgewell/sourcemap-codec': 1.5.4
@@ -8717,10 +8663,6 @@ snapshots:
redis-errors@1.2.0: {}
- redis-info@3.1.0:
- dependencies:
- lodash: 4.17.21
-
redis-parser@3.0.0:
dependencies:
redis-errors: 1.2.0
@@ -8814,10 +8756,14 @@ snapshots:
esm-env: 1.2.2
svelte: 5.35.5
- runed@0.29.2(svelte@5.35.5):
+ runed@0.35.1(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5):
dependencies:
+ dequal: 2.0.3
esm-env: 1.2.2
+ lz-string: 1.5.0
svelte: 5.35.5
+ optionalDependencies:
+ '@sveltejs/kit': 2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1))
rw@1.3.3: {}
@@ -9103,6 +9049,15 @@ snapshots:
runed: 0.28.0(svelte@5.35.5)
svelte: 5.35.5
+ svelte-toolbelt@0.10.6(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5):
+ dependencies:
+ clsx: 2.1.1
+ runed: 0.35.1(@sveltejs/kit@2.38.1(@sveltejs/vite-plugin-svelte@5.1.0(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)(vite@6.3.5(@types/node@24.0.13)(jiti@2.4.2)(lightningcss@1.30.1)))(svelte@5.35.5)
+ style-to-object: 1.0.9
+ svelte: 5.35.5
+ transitivePeerDependencies:
+ - '@sveltejs/kit'
+
svelte-toolbelt@0.7.1(svelte@5.35.5):
dependencies:
clsx: 2.1.1
@@ -9110,13 +9065,6 @@ snapshots:
style-to-object: 1.0.9
svelte: 5.35.5
- svelte-toolbelt@0.9.3(svelte@5.35.5):
- dependencies:
- clsx: 2.1.1
- runed: 0.29.2(svelte@5.35.5)
- style-to-object: 1.0.9
- svelte: 5.35.5
-
svelte@5.35.5:
dependencies:
'@ampproject/remapping': 2.3.0