From ac660c2aa2c056ab8570e9b91da2c3cfd3e611ef Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Wed, 26 Oct 2022 11:26:09 +0800 Subject: [PATCH] feat: add upgrade plugin support (#663) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature /milestone 2.0 #### What this PR does / why we need it: 支持插件升级,适配 https://github.com/halo-dev/halo/pull/2624 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/2551 #### Screenshots: image image #### Special notes for your reviewer: 测试方式: 1. Halo 需要使用 https://github.com/halo-dev/halo/pull/2624 PR 的分支。 2. Console 需要 `pnpm install` 3. 修改已安装的插件,构建之后更新插件,检查是否更新成功。 #### Does this PR introduce a user-facing change? ```release-note 支持插件升级 ``` --- package.json | 2 +- pnpm-lock.yaml | 8 +++--- src/modules/system/plugins/PluginList.vue | 6 ++-- .../plugins/components/PluginListItem.vue | 26 ++++++++++++++++- ...InstallModal.vue => PluginUploadModal.vue} | 28 +++++++++++++++++-- 5 files changed, 59 insertions(+), 11 deletions(-) rename src/modules/system/plugins/components/{PluginInstallModal.vue => PluginUploadModal.vue} (76%) diff --git a/package.json b/package.json index 4787bd5d..3ca0f442 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@formkit/inputs": "^1.0.0-beta.11", "@formkit/themes": "^1.0.0-beta.11", "@formkit/vue": "^1.0.0-beta.11", - "@halo-dev/api-client": "^0.0.38", + "@halo-dev/api-client": "^0.0.39", "@halo-dev/components": "workspace:*", "@halo-dev/console-shared": "workspace:*", "@halo-dev/richtext-editor": "^0.0.0-alpha.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a74a8d4..856329f8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ importers: '@formkit/inputs': ^1.0.0-beta.11 '@formkit/themes': ^1.0.0-beta.11 '@formkit/vue': ^1.0.0-beta.11 - '@halo-dev/api-client': ^0.0.38 + '@halo-dev/api-client': ^0.0.39 '@halo-dev/components': workspace:* '@halo-dev/console-shared': workspace:* '@halo-dev/richtext-editor': ^0.0.0-alpha.8 @@ -101,7 +101,7 @@ importers: '@formkit/inputs': 1.0.0-beta.11 '@formkit/themes': 1.0.0-beta.11_tailwindcss@3.1.8 '@formkit/vue': 1.0.0-beta.11_k5hp3txgeyj6le63abiyc7wx3u - '@halo-dev/api-client': 0.0.38 + '@halo-dev/api-client': 0.0.39 '@halo-dev/components': link:packages/components '@halo-dev/console-shared': link:packages/shared '@halo-dev/richtext-editor': 0.0.0-alpha.8_vue@3.2.40 @@ -1892,8 +1892,8 @@ packages: - windicss dev: false - /@halo-dev/api-client/0.0.38: - resolution: {integrity: sha512-7Vlc/tXkpERi2xWxtoWOVtYbZi+sksrueBAj64gr0cAUOqRy7A82oJXpeabLKeJAjDNdQKZ7eL7CClnf9NJTEA==} + /@halo-dev/api-client/0.0.39: + resolution: {integrity: sha512-GuTTJDOj0PPMXo3KTiNYGACRUXqJKnjnApK303eNPWqVodgR3mJVLFTXwa+euAJOkcSG3KkB5OtUFAkZeHRbPA==} dev: false /@halo-dev/richtext-editor/0.0.0-alpha.8_vue@3.2.40: diff --git a/src/modules/system/plugins/PluginList.vue b/src/modules/system/plugins/PluginList.vue index 4aceba2d..3686498f 100644 --- a/src/modules/system/plugins/PluginList.vue +++ b/src/modules/system/plugins/PluginList.vue @@ -13,7 +13,7 @@ import { VSpace, } from "@halo-dev/components"; import PluginListItem from "./components/PluginListItem.vue"; -import PluginInstallModal from "./components/PluginInstallModal.vue"; +import PluginUploadModal from "./components/PluginUploadModal.vue"; import { onMounted, ref } from "vue"; import { apiClient } from "@/utils/api-client"; import type { PluginList } from "@halo-dev/api-client"; @@ -140,7 +140,7 @@ function handleSortItemChange(sortItem?: SortItem) { }