diff --git a/frontend/src/components/Packages.vue b/frontend/src/components/Packages.vue index 82773f6..c44fb49 100644 --- a/frontend/src/components/Packages.vue +++ b/frontend/src/components/Packages.vue @@ -36,11 +36,15 @@ variant="outlined"> + + + + { if (selectRepo.value.value !== 'any') params.append('repo', selectRepo.value.value) if (selectStatus.value.value !== 'any') params.append('status', selectStatus.value.value) + if (enableExact.value) { + params.append('exact', '') + } else { + params.delete('exact') + } + fetch('https://api.alhp.dev/packages?' + params, { method: 'GET' }) @@ -364,6 +375,7 @@ window.addEventListener('load', () => { .toLowerCase() : 'Status (any)' } + enableExact.value = url.searchParams.has('exact') searchPackages(0) }) @@ -375,6 +387,16 @@ watch( } ) +watch(() => enableExact.value, () => { + if (enableExact.value) { + url.searchParams.set('exact', '') + } else { + url.searchParams.delete('exact', '') + } + window.history.pushState(null, '', url.toString()) + searchPackages(0) +}) + // @ts-ignore let delayTimer = null watch(