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 }}
+
+
+
+
+
+