From f702de4ad176c34991bd3cf7d8d0261c0b488678 Mon Sep 17 00:00:00 2001
From: Ryan Wang
Date: Thu, 19 Jan 2023 10:58:14 +0800
Subject: [PATCH] feat: update theme requires field and supports show failed
message (halo-dev/console#826)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
#### What type of PR is this?
/kind feature
#### What this PR does / why we need it:
修改主题的 `spec.require` 字段为 `spec.requires`,以及支持显示错误信息。适配:https://github.com/halo-dev/halo/pull/3150
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3088
#### Screenshots:
#### Special notes for your reviewer:
测试方式:
1. Halo 切换到 https://github.com/halo-dev/halo/pull/3150 分支。
2. Console 需要 `pnpm install`。
3. 修改主题的 `spec.requires`,根据 https://github.com/halo-dev/halo/pull/3150 中的测试条件修改这个值。
4. 检查是否可以显示异常版本信息。
#### Does this PR introduce a user-facing change?
```release-note
Console 端支持显示主题的版本异常信息
```
---
package.json | 2 +-
pnpm-lock.yaml | 8 ++++----
src/modules/interface/themes/ThemeDetail.vue | 11 +++++++++--
.../themes/components/components/ThemeListItem.vue | 13 +++++++++++--
.../interface/themes/composables/use-theme.ts | 14 ++++++++++++++
5 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/package.json b/package.json
index e517bc69d..154c1554a 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"@formkit/utils": "^1.0.0-beta.12",
"@formkit/validation": "1.0.0-beta.12",
"@formkit/vue": "^1.0.0-beta.12",
- "@halo-dev/api-client": "0.0.66",
+ "@halo-dev/api-client": "0.0.70",
"@halo-dev/components": "workspace:*",
"@halo-dev/console-shared": "workspace:*",
"@halo-dev/richtext-editor": "^0.0.0-alpha.17",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 24a5cfd22..25d76f10e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -13,7 +13,7 @@ importers:
'@formkit/utils': ^1.0.0-beta.12
'@formkit/validation': 1.0.0-beta.12
'@formkit/vue': ^1.0.0-beta.12
- '@halo-dev/api-client': 0.0.66
+ '@halo-dev/api-client': 0.0.70
'@halo-dev/components': workspace:*
'@halo-dev/console-shared': workspace:*
'@halo-dev/richtext-editor': ^0.0.0-alpha.17
@@ -108,7 +108,7 @@ importers:
'@formkit/utils': 1.0.0-beta.12-e579559
'@formkit/validation': 1.0.0-beta.12
'@formkit/vue': 1.0.0-beta.12-e579559_ior6jr3fpijijuwpr34w2i25va
- '@halo-dev/api-client': 0.0.66
+ '@halo-dev/api-client': 0.0.70
'@halo-dev/components': link:packages/components
'@halo-dev/console-shared': link:packages/shared
'@halo-dev/richtext-editor': 0.0.0-alpha.17_vue@3.2.45
@@ -2298,8 +2298,8 @@ packages:
- windicss
dev: false
- /@halo-dev/api-client/0.0.66:
- resolution: {integrity: sha512-TxiNVki2FGUXYCy/zmvHQJV5BfXIF6dT3JwtoT0Vo6IjlN47lxND1y8ZV4QB+msj4u/jIF3s9skxzvMoyqRbog==}
+ /@halo-dev/api-client/0.0.70:
+ resolution: {integrity: sha512-qAvxUFJPPKZwNfGVd2xC33kSUtlFAR0x0wZZyJKQE9hO0K+850+xCVm/XpOaodTGZq0zSuYvdckVngMOY2DILg==}
dev: false
/@halo-dev/richtext-editor/0.0.0-alpha.17_vue@3.2.45:
diff --git a/src/modules/interface/themes/ThemeDetail.vue b/src/modules/interface/themes/ThemeDetail.vue
index 6827af0f6..02be79d96 100644
--- a/src/modules/interface/themes/ThemeDetail.vue
+++ b/src/modules/interface/themes/ThemeDetail.vue
@@ -14,6 +14,7 @@ import {
Dialog,
VAvatar,
Toast,
+ VStatusDot,
} from "@halo-dev/components";
import ThemeUploadModal from "./components/ThemeUploadModal.vue";
@@ -26,7 +27,7 @@ import { apiClient } from "@/utils/api-client";
const selectedTheme = inject>("selectedTheme", ref());
const upgradeModal = ref(false);
-const { isActivated, handleResetSettingConfig } =
+const { isActivated, getFailedMessage, handleResetSettingConfig } =
useThemeLifeCycle(selectedTheme);
const handleReloadTheme = async () => {
@@ -83,6 +84,12 @@ const onUpgradeModalClose = () => {