diff --git a/package.json b/package.json index 31d0264f5..a48c6669b 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@formkit/vue": "1.0.0-beta.9", "@halo-dev/admin-api": "^1.1.0", "@halo-dev/admin-shared": "workspace:*", - "@halo-dev/api-client": "^0.0.5", + "@halo-dev/api-client": "^0.0.6", "@halo-dev/components": "workspace:*", "@vueuse/components": "^8.9.4", "@vueuse/core": "^8.9.4", diff --git a/packages/shared/package.json b/packages/shared/package.json index 5857e1698..b1ef3fb25 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -35,7 +35,7 @@ "homepage": "https://github.com/halo-dev/halo-admin/tree/next/shared/components#readme", "license": "MIT", "dependencies": { - "@halo-dev/api-client": "^0.0.5", + "@halo-dev/api-client": "^0.0.6", "@halo-dev/components": "workspace:*", "axios": "^0.27.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c097308f7..1a1d8fe28 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,7 +14,7 @@ importers: '@formkit/vue': 1.0.0-beta.9 '@halo-dev/admin-api': ^1.1.0 '@halo-dev/admin-shared': workspace:* - '@halo-dev/api-client': ^0.0.5 + '@halo-dev/api-client': ^0.0.6 '@halo-dev/components': workspace:* '@rushstack/eslint-patch': ^1.1.4 '@tailwindcss/aspect-ratio': ^0.4.0 @@ -84,7 +84,7 @@ importers: '@formkit/vue': 1.0.0-beta.9_jly5jqkcc2zgnt3crhnp3znzv4 '@halo-dev/admin-api': 1.1.0 '@halo-dev/admin-shared': link:packages/shared - '@halo-dev/api-client': 0.0.5 + '@halo-dev/api-client': 0.0.6 '@halo-dev/components': link:packages/components '@vueuse/components': 8.9.4_vue@3.2.37 '@vueuse/core': 8.9.4_vue@3.2.37 @@ -176,12 +176,12 @@ importers: packages/shared: specifiers: - '@halo-dev/api-client': ^0.0.5 + '@halo-dev/api-client': ^0.0.6 '@halo-dev/components': workspace:* axios: ^0.27.2 vite-plugin-dts: ^1.3.1 dependencies: - '@halo-dev/api-client': 0.0.5 + '@halo-dev/api-client': 0.0.6 '@halo-dev/components': link:../components axios: 0.27.2 devDependencies: @@ -1873,8 +1873,8 @@ packages: - debug dev: false - /@halo-dev/api-client/0.0.5: - resolution: {integrity: sha512-UqT6svy1nEVGF1swZXJgvu9iy6gQhaJ/o8lY5736Q4BbW8pYrqQBEQYNv8ySRBQr762/Cy7wDFijAGlPod7tDw==} + /@halo-dev/api-client/0.0.6: + resolution: {integrity: sha512-JDWGlTq+pHVrZsmqDCXAowZQFcNL3M6+guL37yrKbhylUgIutYpCMU/d2Qogc+c43FzFBq84igP84T5XtuknjQ==} dev: false /@halo-dev/logger/1.1.0: diff --git a/src/modules/system/plugins/PluginDetail.vue b/src/modules/system/plugins/PluginDetail.vue index 7dc4fde28..1a76c0d97 100644 --- a/src/modules/system/plugins/PluginDetail.vue +++ b/src/modules/system/plugins/PluginDetail.vue @@ -1,7 +1,7 @@ diff --git a/src/modules/system/plugins/PluginList.vue b/src/modules/system/plugins/PluginList.vue index 987646d7d..039a2fe3b 100644 --- a/src/modules/system/plugins/PluginList.vue +++ b/src/modules/system/plugins/PluginList.vue @@ -12,23 +12,42 @@ import { } from "@halo-dev/components"; import PluginListItem from "./components/PluginListItem.vue"; import PluginInstallModal from "./components/PluginInstallModal.vue"; -import { onMounted, ref } from "vue"; +import { onMounted, ref, watch } from "vue"; import { apiClient } from "@halo-dev/admin-shared"; import type { Plugin } from "@halo-dev/api-client"; const plugins = ref([] as Plugin[]); const pluginInstall = ref(false); +const keyword = ref(""); const handleFetchPlugins = async () => { try { + const fieldSelector: Array = []; + + if (keyword.value) { + fieldSelector.push(`name=${keyword.value}`); + } + const { data } = - await apiClient.extension.plugin.listpluginHaloRunV1alpha1Plugin(); + await apiClient.extension.plugin.listpluginHaloRunV1alpha1Plugin( + 0, + 0, + [], + fieldSelector + ); plugins.value = data.items; } catch (e) { console.error("Fail to fetch plugins", e); } }; +watch( + () => keyword.value, + () => { + handleFetchPlugins(); + } +); + onMounted(handleFetchPlugins);