From 138ffde7e28d490688cce9716905b6e58de682ec Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 25 Aug 2023 10:42:14 -0500 Subject: [PATCH] refactor: remove the pagination feature of plugin management (#4473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /area console /kind improvement /milestone 2.9.x #### What this PR does / why we need it: 移除插件管理列表的分页功能,默认列表出所有安装的插件。 #### Which issue(s) this PR fixes: Fixes #4469 #### Does this PR introduce a user-facing change? ```release-note 移除 Console 端插件管理列表的分页功能,默认列表出所有安装的插件。 ``` --- .../src/modules/system/plugins/PluginList.vue | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/console/src/modules/system/plugins/PluginList.vue b/console/src/modules/system/plugins/PluginList.vue index 3250e5f1b..8f3dd452b 100644 --- a/console/src/modules/system/plugins/PluginList.vue +++ b/console/src/modules/system/plugins/PluginList.vue @@ -7,7 +7,6 @@ import { VCard, VEmpty, VPageHeader, - VPagination, VSpace, VLoading, Dialog, @@ -21,10 +20,8 @@ import { useQuery } from "@tanstack/vue-query"; import type { Plugin } from "@halo-dev/api-client"; import { useI18n } from "vue-i18n"; import { useRouteQuery } from "@vueuse/router"; -import { watch } from "vue"; const { t } = useI18n(); - const { currentUserHasPermission } = usePermission(); const pluginInstallationModal = ref(false); @@ -36,9 +33,6 @@ function handleOpenUploadModal(plugin?: Plugin) { } const keyword = ref(""); -const page = ref(1); -const size = ref(20); -const total = ref(0); const selectedEnabledValue = ref(); const selectedSortValue = ref(); @@ -52,33 +46,16 @@ function handleClearFilters() { selectedEnabledValue.value = undefined; } -watch( - () => [selectedEnabledValue.value, selectedSortValue.value, keyword.value], - () => { - page.value = 1; - } -); - const { data, isLoading, isFetching, refetch } = useQuery({ - queryKey: [ - "plugins", - page, - size, - keyword, - selectedEnabledValue, - selectedSortValue, - ], + queryKey: ["plugins", keyword, selectedEnabledValue, selectedSortValue], queryFn: async () => { const { data } = await apiClient.plugin.listPlugins({ - page: page.value, - size: size.value, + page: 0, + size: 0, keyword: keyword.value, enabled: selectedEnabledValue.value, sort: [selectedSortValue.value].filter(Boolean) as string[], }); - - total.value = data.total; - return data.items; }, keepPreviousData: true, @@ -251,20 +228,6 @@ onMounted(() => { - -