From 7acdd3654f86ca1515666e05ebae496871492973 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Sat, 21 Feb 2026 23:41:07 -0500 Subject: [PATCH] fix: Add pagination controls to uMod browse tab Prev/Next buttons at top and bottom of results table. New search resets to page 1. Buttons disable at bounds and during loading. Co-Authored-By: Claude Opus 4.6 --- frontend/src/views/admin/PluginsView.vue | 56 ++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/admin/PluginsView.vue b/frontend/src/views/admin/PluginsView.vue index a966645..d8022d7 100644 --- a/frontend/src/views/admin/PluginsView.vue +++ b/frontend/src/views/admin/PluginsView.vue @@ -12,6 +12,7 @@ const toast = useToastStore() const searchQuery = ref('') const tab = ref<'installed' | 'browse' | 'upload'>('installed') const browseQuery = ref('') +const browsePage = ref(1) const browseDebounce = ref | null>(null) const installing = ref(null) @@ -71,10 +72,11 @@ async function handleUninstall(plugin: PluginEntry) { } } -async function handleBrowseSearch() { +async function handleBrowseSearch(page = 1) { if (!browseQuery.value.trim()) return + browsePage.value = page try { - await pluginStore.browseUmod(browseQuery.value.trim()) + await pluginStore.browseUmod(browseQuery.value.trim(), page) } catch { toast.error('Failed to search uMod plugins') } @@ -82,7 +84,17 @@ async function handleBrowseSearch() { function scheduleBrowseSearch() { if (browseDebounce.value) clearTimeout(browseDebounce.value) - browseDebounce.value = setTimeout(handleBrowseSearch, 400) + browseDebounce.value = setTimeout(() => handleBrowseSearch(1), 400) +} + +function browsePrev() { + if (browsePage.value > 1) handleBrowseSearch(browsePage.value - 1) +} + +function browseNext() { + if (pluginStore.browseResults && browsePage.value < pluginStore.browseResults.last_page) { + handleBrowseSearch(browsePage.value + 1) + } } async function installFromBrowse(result: UmodPlugin) { @@ -325,6 +337,22 @@ onMounted(() => { {{ pluginStore.browseResults.total.toLocaleString() }} plugins found • Page {{ pluginStore.browseResults.current_page }} of {{ pluginStore.browseResults.last_page }}

+
+ + +
@@ -366,6 +394,28 @@ onMounted(() => {
+ +
+

+ Page {{ pluginStore.browseResults.current_page }} of {{ pluginStore.browseResults.last_page }} +

+
+ + +
+