diff --git a/packages/shared/package.json b/packages/shared/package.json index 8df20229..3e264361 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.3", + "@halo-dev/api-client": "^0.0.4", "@halo-dev/components": "workspace:*", "axios": "^0.27.2" }, diff --git a/packages/shared/src/utils/api-client.ts b/packages/shared/src/utils/api-client.ts index 5d87f360..64d63c84 100644 --- a/packages/shared/src/utils/api-client.ts +++ b/packages/shared/src/utils/api-client.ts @@ -1,18 +1,17 @@ import { - PluginHaloRunV1alpha1PluginApi, - V1alpha1UserApi, + ApiHaloRunV1alpha1PluginApi, ApiHaloRunV1alpha1UserApi, + PluginHaloRunV1alpha1PluginApi, + PluginHaloRunV1alpha1ReverseProxyApi, V1alpha1ConfigMapApi, V1alpha1PersonalAccessTokenApi, - V1alpha1RoleBindingApi, V1alpha1RoleApi, + V1alpha1RoleBindingApi, V1alpha1SettingApi, - PluginHaloRunV1alpha1ReverseProxyApi, - CoreHaloRunV1alpha1LinkApi, - CoreHaloRunV1alpha1LinkGroupApi, + V1alpha1UserApi, } from "@halo-dev/api-client"; -import axios from "axios"; import type { AxiosInstance } from "axios"; +import axios from "axios"; let apiUrl: string | undefined; const axiosInstance = axios.create({ @@ -61,10 +60,11 @@ function setupApiClient(axios: AxiosInstance) { user: new V1alpha1UserApi(undefined, apiUrl, axios), // TODO optional - link: new CoreHaloRunV1alpha1LinkApi(undefined, apiUrl, axios), - linkGroup: new CoreHaloRunV1alpha1LinkGroupApi(undefined, apiUrl, axios), + // link: new CoreHaloRunV1alpha1LinkApi(undefined, apiUrl, axios), + // linkGroup: new CoreHaloRunV1alpha1LinkGroupApi(undefined, apiUrl, axios), }, user: new ApiHaloRunV1alpha1UserApi(undefined, apiUrl, axios), + plugin: new ApiHaloRunV1alpha1PluginApi(undefined, apiUrl, axios), }; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e182751f..8e4dfe74 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -172,12 +172,12 @@ importers: packages/shared: specifiers: - '@halo-dev/api-client': ^0.0.3 + '@halo-dev/api-client': ^0.0.4 '@halo-dev/components': workspace:* axios: ^0.27.2 vite-plugin-dts: ^1.3.1 dependencies: - '@halo-dev/api-client': 0.0.3 + '@halo-dev/api-client': 0.0.4 '@halo-dev/components': link:../components axios: 0.27.2 devDependencies: @@ -1873,6 +1873,10 @@ packages: resolution: {integrity: sha512-ybtVcjeeFqOldPIKRrm3socfGtbSR5GL+MXVmkSJwD2fCwT9OiXEvs3cgceWceIZI0Ug7AEKwxbcO+ZfOmDlYA==} dev: false + /@halo-dev/api-client/0.0.4: + resolution: {integrity: sha512-rNkQJWBL+1du/wfe70cqc7YczcQMTlQBQb0xmBLXCvQvxIlANpEVo0YKlbMXBvznaec2MYUFu7aF0b8hi4GEDw==} + dev: false + /@halo-dev/logger/1.1.0: resolution: {integrity: sha512-y0jVivYwF8MCVi/OdW2D0LN+GTM5rzMsR/ZmQVfgmKQw7Q7Q+EXPijxON6iCMZnWANGa4NaAcOO9k3ggG8oRwg==} engines: {node: '>=12.0.0'} diff --git a/src/modules/system/plugins/PluginList.vue b/src/modules/system/plugins/PluginList.vue index 765f9d84..fc4ec242 100644 --- a/src/modules/system/plugins/PluginList.vue +++ b/src/modules/system/plugins/PluginList.vue @@ -13,6 +13,7 @@ import { VSwitch, VTag, } from "@halo-dev/components"; +import PluginInstallModal from "./components/PluginInstallModal.vue"; import { onMounted, ref } from "vue"; import { useRouter } from "vue-router"; import { apiClient } from "@halo-dev/admin-shared"; @@ -20,6 +21,7 @@ import type { Plugin } from "@halo-dev/api-client"; import cloneDeep from "lodash.clonedeep"; const plugins = ref([] as Plugin[]); +const pluginInstall = ref(false); const router = useRouter(); const dialog = useDialog(); @@ -69,12 +71,22 @@ const handleChangeStatus = (plugin: Plugin) => { onMounted(handleFetchPlugins);